Calculating the value of a binomial distribution

56 Views Asked by At

Suppose $X$ is a discrete random variable such that $X$~$B(100,0.028)$.

What would be the fastest way to calculate something along the lines of: $P$ { $2 \le X \le 6 $ } ?

3

There are 3 best solutions below

0
On

This would be the fastest. $$ P(2 \leq X\leq 6) = P(X\leq 6) - P(X<2) $$ so this would be $$ P(X=2) + P(X=3) + P(X=4) + P(X=5) + P(X=6) $$

0
On

As far as I know, if $X\sim \mathcal{B}(n,p)$, then it can be approached by the Gaussian distribution $\mathcal{N}\big(np,np(1-p)\big)$, as long as $\mathbf{n\ge 30}$ and $\mathbf{np \ge 5}$, which can give us a fairly good approximation. In that case, we have: $$\Pr(a\le X\le b)\approx \Pr\left(\frac{a - np}{\sqrt{np(1-np)}}\le Z = \frac{X-\mu}{\sigma} \le \frac{b-np}{\sqrt{np(1-p)}}\right),$$ where $\mu = np, \sigma = \sqrt{np(1-p)}$ and $Z \sim \mathcal{N}(0,1)$. In that specific situation we have that $n = 100$ and $p = 0.028$, which implies $np = 2.8$. So, I don't know if that approach would be good enough.

  • Following the normal procedure, we have (with the help of Mathematica): $$\textbf{prob_1}=\Pr(2\le X\le 6) = \sum_{k = 2}^{6}\binom{100}k\cdot 0.028^k \cdot (1-0.028)^{100-k}=\boxed{0.750672}. $$

  • Considering the approach by the Gaussian distribution (which is a lot faster in some way), we have:

$$\textbf{prob_2} = \Pr(-0.484929\le Z \le 1.93971) \begin{array}[t]{l} =\Phi(1.93971) - \Phi(-0.484929) \\ =\Phi(1.93971) + \Phi(0.484929)-1 \\ = \boxed{0.65993}. \end{array}$$

As long as $n\ge 30$ and $np\gg 5$, then $\left| \textbf{prob_1} - \textbf{prob_2} \right| \to 0$.

0
On

You can also approximate the answer using a normal approximation to the binomial, since $n$ is fairly large:

$$X\sim B(100,0.028)$$ can be recast as a normal distribution:

$$X\sim N(np,npq) \implies X\sim N(np,np(1-p))$$ so with your numbers, $n=100$, $p=0.028$:

$$X\sim N(2.8,2.7216)$$.