Determining whether a coin is fair I have a dataset where an ostensibly 50% process has been tested 118 times and has come up positive 84 times.
My actual question:


*

*IF a process has a 50% chance of testing positive and

*IF you then run it 118 times

*What is the probability that you get AT LEAST 84 successes?


My gut feeling is that, the more tests are run, the closer to a 50% success rate I should get and so something might be wrong with the process (That is, it might not truly be 50%) but at the same time, it looks like it's running correctly, so I want to know what the chances are that it's actually correct and I've just had a long string of successes.

Let $X\equiv$ number of times the process comes up positive in $n=118$ trials, where we observe that $x=84$. Then $X \sim \text{Binomial}(118,p)$, where $p$ represents the probability of a positive result. Our hypotheses are:


*

*$H_0: p=0.5$ (The process really is $50\%$.)

*$H_1: p \ne 0.5$ (The process actually isn't $50\%$.)


We now calculate our $p$-value to be:
$$
2Pr(X\ge84 \mid H_0 \text{ is true}) = 2\left[\sum_{k=84}^{118} \binom{118}{k}(0.5)^{118} \right] \approx 4.72447 \times 10^{-6}
$$
Hence, since this $p$-value is much less than $\alpha=0.05$, we reject $H_0$ and conclude that there is strong evidence that the process actually isn't $50\%$.
