If a question asked to find on a specific confidence level then we have that:
$P(-a \le \hat {p} - p \le a) = P(-a \le \frac{X_1 + ... +X_n - np}{n} \le a) = P(\frac {-a\sqrt n}{\sqrt {p(1-p)}} \le \frac {X_1 + ... +X_n - np}{\sqrt n \sqrt {p(1-p)}} \le \frac{a\sqrt n}{\sqrt {p(1-p)}} $
How were they able to find the standard deviation of $X_1$ to be $\sqrt {p(1-p)}$? I have not seen that formula before. I have only seen the case when
$P(\frac{-a\sqrt n}{\sigma} \le \hat {p} - p \le \frac{a\sqrt n}{\sigma})$
In what cases do we want to use $\sqrt {p(1-p)}$ from $\frac{-a\sqrt n}{\sigma}$ to find the standard deviation?