The distribution of the correct number of guesses under the alternative hypothesis follows a non-central hypergeometric distribution, which is parameterized in terms of the odds ratio, that is, how much higher are the odds that the lady will guess "tea first" when in fact tea was really added first as opposed to when in fact milk was added first (or the other way around). If the odds ratio is 1, then we get the central hypergeometric distribution.
Let's see if this works. I will use R for illustration purposes, using the MCMCpack
package, which has function dnoncenhypergeom()
for computing the density of a (non-central) hypergeometric distribution. It has arguments x
for the correct number of guesses (careful: this is the correct number of guesses under one of the two conditions, for example, when tea was really added first), arguments n1
, n2
, and m1
for three of the four margins, and psi
for the true odds ratio. Let's compute the density for x
equal to 0 to 4 (with all margins equal to 4) when the true odds ratio is 1:
install.packages("MCMCpack")
library(MCMCpack)
sapply(0:4, function(x) dnoncenhypergeom(x, n1=4, n2=4, m1=4, psi=1))
This yields:
[1] 0.01428571 0.22857143 0.51428571 0.22857143 0.01428571
So, there is a 1.43% chance that the lady will make 8 correct guesses (i.e., she guesses all 4 cups correctly where tea was added first and hence she also guesses all 4 cups correctly where milk was added first) under the null hypothesis. This is in fact the amount of evidence that Fisher considered sufficient to reject the null hypothesis.
The probabilities specified in the question can be used to compute the odds ratio, namely, $(.90/(1-.90)) / (.10/(1-.10)) = 81$ (i.e., $\text{odds}(\text{guess}A|\text{true}A) / \text{odds}(\text{guess}A|\text{true}B)$). What are the chances now that the lady will guess all 8 cups correctly (i.e., she will guess all 4 cups correctly where tea was added first and hence also the 4 cups correctly where milk was added first)?
dnoncenhypergeom(4, n1=4, n2=4, m1=4, psi=81)
This yields:
[1] 0.8312221
So power is about 83% then.