I am stuck with this problem:
The proportion of a random sample of 400 elements from an infinite population is 0.49215. With the level of significance 5$\%$ test if the sample comes from a population for which the proportion equals 0.51.
I got this solution:
\begin{align*} H_0:&\ p=0.51\\ H_1:&\ p\neq 0.51 \end{align*}
\begin{align*} n&=400\\ p_0&=0.51\\ 1-p_0&=1-0.51=0.49\\ \hat{p}&=0.49215\\ \alpha&=0.05\\ z_{\alpha /2}&=1.96\qquad \text{(two-sided test)}\\ \sqrt{\frac{p_0(1-p_0)}{n}}&=\sqrt{\frac{0.51\cdot 0.49}{400}}=0.024995 \end{align*} Using $z$-test: \begin{align*} z&=\frac{\hat{p}-p_0}{\sqrt{\frac{p_0(1-p_0)}{n}}}=\frac{0.49215-0.51}{0.024995}=-0.714143\\ \\ |z|&=0.714143<z_{\alpha /2}=1.96 \Longrightarrow \ \ \text{accepted}\ H_0 \end{align*}