Example 5.3.1.
We find a coin and wonder if itβs fair. Let \(\theta\) be the probability of the coin coming up heads on a flip. Let \(S\) count the number of heads in 100 flips. Under the null hypothesis that \(\theta = 0.5\text{,}\) \(S\) is binomial, with:
\begin{align*}
\E(S) \amp = (n)(\theta) = (100)(0.5) = 50 \\
\Var(S) \amp = (n)(\theta)(1 - \theta) = (100)(0.5)(0.5) = 25
\end{align*}
Using a normal approximation, \(S \approx \Norm(50, 25)\text{.}\) In the calculation of the \(p\)-value for a 2-tailed test, we will eventually reach the expression:
\begin{gather*}
\Pr(Z \geq z) + \Pr(Z \leq -z)
\end{gather*}
for some \(z\)-score. To address the first question above, we can calculate, for a specified significance level \(\alpha\text{,}\) the \(z\)-score that represents data at the cutoff between accepting and rejecting the null hypothesis:
\begin{align*}
\alpha \amp = \Pr(Z \geq z) + \Pr(Z \leq -z) \\
\amp = \Phi(-z) + (1 - \Phi(z)) \\
\amp = 2 \Phi(-z) \\
\Rightarrow \Phi(-z) \amp = \frac{\alpha}{2} \\
-z \amp = \Phi^{-1}\left(\frac{\alpha}{2}\right)
\end{align*}
For the significance level \(\alpha = 0.05\text{,}\) weβll have \(z = 1.96\text{.}\) Now, we convert back to values of \(S\text{,}\) keeping in mind that a continuity correction would be involved:
\begin{align*}
\frac{S - 0.5 - 50}{\sqrt{25}} \amp = 1.96 \\
S \amp = 50.5 + 1.96 \sqrt{25} = 60.3.
\end{align*}
We canβt flip a fractional number of heads, so it would take a result of 61 or more heads (or, equally extreme in the other direction, 39 heads or fewer) to reject the null hypothesis.
