# Help understanding why p-hat is 1/20 and why the CI is (0.0286,0.0714)?

A software engineer is creating a new computer software program. She wants to make sure that the crash rate is extremely low so that users would give high satisfaction ratings. In a sample of $400$ users, $20$ of them had their computers crash during the $1$-week trial period.

$(a)$ What is $\hat{p}$?

$$\frac{1}{20}$$

$(b)$ What is the $95$% confidence interval for $\hat{p}$? (Use a table or technology. Round your answers to three decimal places.)

$$(0.0286 , 0.0714)$$

I don't understand. Can someone please explain how $(a)$ and $(b)$ were achieved?

Thank you

The best estimate for $p$, $\hat{p}$, is obtained by checking the proportion in your sample. Thus the best you can do is $\hat{p} = \frac{20}{400} = \frac{1}{20}$.

Confidence intervals for a proportion are generated by

$$\hat{p} \pm z^* \cdot \sqrt{\frac{\hat{p}(1 - \hat{p})}{n}}$$

where $z^*$ is the critical value for the desired confidence interval. Since we desire a $95\%$ confidence interval, $z^* = 1.96$ here (remember this magic number! This pops up time and time again. Other magic numbers are $1.645$ at the $90\%$ level and $2.575$ for the $99\%$ level). Use the value of $\hat{p}$ above and the sample size to generate the interval.

I'm almost certain that your notes have this information. Can you take it from here?

$\hat{p}$ is the proportion of success. Since we have $20$ successes in $400$ trials we get

$$\hat{p}=\frac{20}{400}=\frac{1}{20}$$

A $(100-\alpha)$% confidence interval for the population proportion $p$ is given by

$$\hat{p}\pm z_{\alpha/2}\cdot\sqrt{\frac{\hat{p}(1-\hat{p})}{n}}$$

where $z_{0.05/2}\approx1.96$. You can find this by looking at a $z$-table and finding what $z$-score yields

$$P(Z\leq z)=0.975$$

since $1-0.975=0.025=\frac{0.05}{2}$

In R statistical software, we can get a more accurate value

> qnorm(.975)
[1] 1.959964


We then get

$$\hat{p}\pm 1.96\cdot\sqrt{\frac{\hat{p}(1-\hat{p})}{n}}$$

Plug in $\hat{p}$ and $n$ and you will obtain the desired confidence interval.