Two friends flip a coin $100$ times, and $58$ it is head. One says the coin is rigged, the other says it is not, and that it happened by chance. The problem asks to verify the hypothesis $p=1/2$ versus $p \neq1/2$, and who should I believe. He then asks to do the same in a situation with $1000$ throws and $580$ heads.
I know I am supposed to use De Moivre-Laplace approximation, but in the result it says that in the first case the coin is not rigged starting from level $0.011$ approximately, while in the other case you have to refute the hypothesis. What does that level mean, in fact? And how do I find that number?
The approach I want to take is define 100 Bernoulli variables $X_i$ and take their mean $Y$. I know that the expected value is 50 (under the hypothesis $p=1/2$), so I think you should do something like $P\{|Y-50|<8\}>1- \alpha$. That is, find $\alpha$ manipulating the inequality to use De Moivre-Laplace. But in fact I don’t know if this is the correct approach, I am used to unilateral tests, but not to these...
This is equivalent to proportion hypothesis testing which is the same as frequentist approach.
Hypothesis framework:
$H_0 : p = .5$
$H_1 : p \ne 0.5$
Use the z-statistic and find the p-value. That p-value is the level above which the null hypothesis ( the coin is not rigged) is rejected.
z -statistic =$ \dfrac{\hat p - p_0}{\sqrt{\frac{p_0(1-p_0)}{n}}}$
$\hat p =\frac{58}{100} =0.58$ and $p_0 = \frac{50}{100} =0.5$
$p - value = 2*$(1-Normsdist(z-statistic))
Do the same for the other experiment involved with 1000 flips and you will see that the z-statistic is large and one would have to reject the null hypothesis that the coin in not rigged.