statistics is consistent: 

Theorem 2.1. Let Y be continuous, and X categorical with K categories. Let N$_{g}$ be the total number of observations from distribution g ∈ { 1 , . . . , K } , and N = ∑ K g $_{=1}$N$_{g}$ . If the distribution of Y differs at a continuous density point y$_{0}$ across values of X in at least two categories, label these 1 and 2, lim$_{N}$$_{→∞}$ min( N$_{1}$,N$_{2}$ ) N > 0 , and m finite or lim$_{N}$$_{→∞}$ m/N = 0 , then the distribution-free permutation tests based on S$_{m}$ and M$_{m}$ are consistent. 

We omit the proof, since it is similar to (yet simpler than) the proof of Theorem 2.2 below. 

Test statistics for the independence problem We now consider the case that X is continuous. For N pairs of observations, there are ( N − 1 m − 1 ) × ( N − 1 m − 1 ) partitions of the sample space into m × m cells, where a cell is a rectangular area in the plane. We refer to these partitions as the all derived partitions (ADP) and denote this set by Π ADP m . Since the cell membership of observations is the same regardless of whether the partition is defined on the original observations or on the ranked observations, and the statistics we suggest only depend on these cell memberships, we describe the proposed test statistics on the ranked observations, so the N pairs of observations are on the grid { 1 , . . . , N } $^{2}$. For any fixed partition I = { ( i$_{1}$, j$_{1}$ ) , . . . , ( i$_{m}$$_{−}$$_{1}$, j$_{m}$$_{−}$$_{1}$ ) } ⊂ { 1 . 5 , . . . , N − 0 . 5 } $^{2}$, , i$_{1}$ < i$_{2}$ < . . . < i$_{m}$$_{−}$$_{1}$ , j$_{1}$ < j$_{2}$ < . . . < j$_{m}$$_{−}$$_{1}$ , C ( I ) is the set of m × m cells defined by the partition. For a cell C ∈ C ( I ), let o$_{C}$ and e$_{C}$ be the observed and expected counts inside the cell, respectively. The expected count in cell C with boundaries [ i$_{k}$, i$_{k}$$_{+1}$ ] × [ j$_{l}$, j$_{l}$$_{+1}$ ] is e$_{C}$ = ( i$_{k}$$_{+1}$ − i$_{k}$ ) × ( j$_{l}$$_{+1}$ − j$_{l}$ ) /N , where k, l ∈ { 0 , . . . , m − 1 } , i$_{0}$ = j$_{0}$ = 0 . 5 , i$_{m}$ = j$_{m}$ = N + 0 . 5. As with the K -sample problem, we consider either Pearson’s score or the likelihood ratio score for a given 

