Computing p-value vs. constructing confidence interval from sample for proportions Let's say D is a Bernoulli distribution with parameter $\mu = 0.6$ and we want to test whether or not $\mu=0.5$. So,
Null hypothesis: $\mu = 0.5$
Alt hypothesis: $\mu \neq 0.5$.
Suppose we have a sample $X_1,\ldots, X_n \sim D$ for large $n$. Now, my understanding is there are two ways to do the hypothesis test. One approach is to assume the null hypothesis is correct and calculate the probability of seeing $\bar{X}_n$. If the null is correct, then we expect the distribution for the sample mean to be
$$N(0.5, (0.5*0.5)/n)$$
Then we can calculate the p-value. However, equivalently we can construct a confidence interval from our sample and reject the null hypothesis if 0.5 is not in our constructed range.
$$N(\hat{p}, \hat{p}(1-\hat{p})/n)$$
My confusion is, are these two methods really equivalent? Because the variance of the normal distribution would be smaller for the second approach, isn't it possible that you could reject the null hypothesis in the second approach, but fail to reject the null hypothesis in the first approach? Any intuitive explanation for why they are equivalent?

A confidence interval based on normal approximation for the Bernoulli where $\hat p(1−\hat p)$ (by the way $\hat p=\bar X_n$) is plugged in for the variance estimator involves two approximations (one by the Central Limit Theorem, the other by variance estimation) and is therefore not equivalent to a test that does not involve variance estimation.
There are confidence intervals for the Bernoulli that don't estimate the variance either though, see https://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval.
I believe that the Wilson score interval explained there will, by checking whether 0.5 is in it, give you a test equivalent to the one you discuss, i.e., with normal approximation but without estimating the variance (assuming that the test is two-sided).
