Let X_{1},\,\ldots,\,X_{20} be i.i.d. r.v.’s denoting the number of typographical errors in 20 pages of a book.We may assume that theX_{i}’s are independently distributed as P(θ), and let us test the hypothesis \ H_{0}\colon\theta\gt 0.5 (the average number of errors is more than 1 per couple of pages) against the alternative H_{A}\colon\theta\leq0.5 at level α = 0.05.
In (27),
P_{\theta_{0}}(X\leq C-1)+\gamma P_{\theta_0}(X=C)=\alpha,\quad X\sim P(n\theta_{0}).\qquad\qquad(27)
X ∼ P(10), so that
P_{0.5}(X\leq C-1)+\gamma P_{0.5}(X=C)=0.05,
and hence C−1 = 4 and P_{0.5}(X\leq4)=0.0293,P_{0.5}(X=5)=0.0671-0.0293=0.0378.It follows that \gamma\;=\;{\frac{\mathrm{\ 0.05-0.0293}}{\mathrm{\ 0.0378}}}\;\simeq\;0.548.Therefore by (26),
\varphi(x_1,\dots,x_n)=\begin {cases} 1&\mathrm {if}\sum_{i=1}^{n} x_i \lt C\\\gamma &\mathrm {if}\sum_{i=1}^{n} x_i =C \\0 &\mathrm {if}\sum_{i=1}^{n} x_i \gt C, \end{cases} \qquad(26)
reject the hypothesis outright if x ≤ 4, reject it with probability 0.548 if x = 5, and accept it otherwise. The power of the test is: For θ = 0.2, X ∼ P(4) and:
\pi_{\varphi}(0.2)=P_{0.2}(X\leq4)+0.548P_{0.2}(X=5)=0.6288+0.548\times0.1563\simeq0.714.
If the observed value x is 6, then the P-value is ({\mathrm{for~}}X\sim P_{0.5}(10));\,P(X\leq5)+ 0.548 P_{0.5}(X=6)\simeq 0.102.