2 people flip a coin 100 times. The first person get 42 heads, the second person gets 58 heads.
What is the probability of this outcome and all other possible outcomes that have an equal or lower probability of occurring?
The calculation of the specific outcome is straightforward enough to calculate as the product of two binomials (i get p=0.02229 * 0.02229 = 0.000497). There are 9800 possible outcomes that have probability of .000497 or lower, out a total of 101 x 101 = 10201 possible outcomes. When I sum all of the 9800 occurrences that have probability of .000497 or lower, I get a probability of .077687.
Now given the number of trials involved, I would think that a z-test for difference in proportions with continuity correction (or if you prefer, chi-square with 1 degree of freedom) would give nearly the same probability, but it does not - I get z = 2.1213 and p=.033895 (chi-square stat is 4.5).
I can only assume I am making some type of logical error - should not the product of 2 binomials converge to a normal distribution as the number of trials increases? Note I have rounded some of the probabilities above but they are not rounded in the spreadsheet I used to make the calculations.
pbinom
function. So, for example, to compute the probability that someone gets 42 or fewer heads from 100 fair coin tosses, you would dopbinom(q=42, size=100, prob=0.5)
. To compute the probability of MORE than 42 heads, you just add thelower.tail=FALSE
argument. $\endgroup$