Solution
Rearranging the Labels
Show the problem again
Group A has measurements 12, 15, 19 and group B has 7, 9, 14, 16. To test whether A tends to give larger values, use a permutation test with test statistic equal to the mean of group A (equivalently, the difference in group means). Under the null hypothesis that group labels are exchangeable, all $\binom73=35$ ways of choosing which three of the seven values form group A are equally likely. What is the exact one-sided p-value, the probability under relabeling of a group-A mean at least as large as the observed one? Give a reduced fraction.
Worked solution
The observed group-A sum is $12+15+19=46$. Count 3-subsets of $\{7,9,12,14,15,16,19\}$ with sum at least 46. With 19 included we need two others summing to at least 27: the pairs reaching at least 27 are $\{12,15\},\{12,16\},\{14,15\},\{14,16\},\{15,16\}$ ($\{12,14\}=26$ just fails). That is 5 subsets. Without 19 the largest sum is $14+15+16=45<46$. So 5 of 35 subsets are as extreme as the observation: $p=5/35=1/7$.
Source: Original problem written for AxiomIQ. The permutation (randomization) test goes back to R. A. Fisher and E. J. G. Pitman. Statement written for AxiomIQ.