Understanding solution of tossing a coin 400 times..

818 Views Asked by At

Why in this If, tossing a coin 400 times, we count the heads, what is the probability that the number of heads is [160,190]? question heropup's asnwer is like that?

I don't understand the blue text, I think it should be 190 instead of $\color{blue}{200}.$

And why to do this step $\color{blue}{\Pr[159.5 \le X \le 200.5] }?$ when you can pass directly to standarization.

This is his/her answer:

With $n = 400$ trials, the exact probability distribution for the number of heads $X$ observed is given by $X \sim {\rm Binomial}(n = 400, p = 1/2)$, assuming the coin is fair. Since calculating $\Pr[160 \le X \le \color{blue}{200}]$ requires a computer, and $n$ is large, we can approximate the distribution of $X$ as ${\rm Normal}(\mu = np = 200, \sigma^2 = np(1-p) = 100)$. Thus $$\begin{align*} \Pr[160 \le X \le 200] &\approx \color{blue}{\Pr[159.5 \le X \le 200.5] }\\ &= \Pr\left[\frac{159.5 - 200}{\sqrt{100}} \le \frac{X - \mu}{\sigma} \le \frac{200.5 - 200}{\sqrt{100}} \right] \\ &= \Pr[-4.05 \le Z \le 0.05] \\ &= \Phi(0.05) - \Phi(-4.05) \\ &\approx 0.519913. \end{align*}$$ Note that we employed continuity correction for this calculation. The exact probability is $0.5199104479\ldots$.

A similar calculation applies for $\Pr[160 \le X \le 190]$. Using the normal approximation to the binomial, you would get an approximate value of $0.171031$. Using the exact distribution, the probability is $0.17103699497659\ldots$.

2

There are 2 best solutions below

4
On BEST ANSWER

As mentioned in the linked post, if $X \sim \mathsf{Binom}(400, .5),$ then $$P(160 \le X \le 200) = P(159 < X < 201) = P(159.5 < X < 200.5) = 0.5199$$ to four places. [The computation is from R statistical software, in which pbinom is a binomial CDF.]

pbinom(200, 400, .5) - pbinom(159, 400, .5)
[1] 0.5199104

Computing with the normal approximation, it is best to use the form $P(159.5 < X < 201.5)$ because that gives the best fit for using the continuous normal distribution to get probabilities for the discrete binomial distribution. The approximating normal distribution is $\mathsf{Norm}(\mu=200,\, \sigma = 10).$

Using endpoints 160 and 200 gives the normal approximation 0.49997, which is a little too small.

diff(pnorm(c(160,200), 200, 10))
[1] 0.4999683

Using the endpoints 159 and 201, we get 0.53980 (a little too large).

diff(pnorm(c(159,201), 200, 10))
[1] 0.5398072

With the endpoints 159.5 and 200.5, we get 0.5199, which is very nearly the correct answer. [All three normal approximations are done using software, which gives slightly more accurate values than are often possible from printed normal tables of the standard normal distribution.]

diff(pnorm(c(159.5,200.5), 200, 10))
[1] 0.5199132

The plot below shows the binomial distribution (vertical bars) and the approximating normal distribution (blue curve). Vertical broken lines enclose the desired probability.

enter image description here

Note1: (1) Notice that the binomial probability $P(X = 200)$ is approximated by the normal probability $P(199.5 < X < 200.5),$ so if you use 200 as the upper boundary, you are losing about half of the probability of this one binomial value.

(2) Here the normal approximation (with continuity correction) is accurate to four places because (a) $n=400$ is relatively large and (b) $p = 1/2,$ for a symmetrical distribution. If $n$ is smaller or $p$ is far from $1/2,$ it is typical for the normal approximation to give only about two places of accuracy. For example, if $Y \sim \mathsf{Binom}(36, 1/3),$ then $P(5 \le Y \le 9) = 0.1875,$ but the normal approximation with continuity correction is $0.1844$ (or something like $0.1854,$ rounding to use printed normal tables).

pbinom(9, 36, 1/3) - pbinom(4, 36, 1/3)
[1] 0.1874903
diff(pnorm(c(4.5, 9.5), 12, sqrt(8)))
[1] 0.1843746
1
On

Note that the binomial probability distribution is a discrete probability distribution, while normal probability distribution is a continuous probability distribution.

When the binomial probability distribution is approximated (under certain conditions) with the normal probability distribution, so called continuity correction factor should be applied. Refer to the graph below (source: wikipedia):

$\hspace{6cm}$1

For example: $$P(1\le \underbrace{X}_{\text{binomial rv}}\le 4) = P(1-0.5\le \underbrace{X}_{\text{normal rv}}\le 4+0.5)=\\ P\left(\frac{(1-0.5)-np}{\sqrt{npq}}\le \underbrace{Z}_{\text{st.normal rv}}\le \frac{(4+0.5)-np}{\sqrt{npq}}\right),$$ because:

$\hspace{2cm}$2