# Binomial Distribution

> ***GitHub***: https://github.com/czs108

## Definition

\begin{equation}
P(X = r) =\, ^{n}C_{r} \cdot p^{r} \cdot (1 - p)^{n - r}
\end{equation}

\begin{align}
X &= \text{The total number of successes.} \\
p &= \text{The probability of a success on an individual trial.} \\
n &= \text{The number of trials.}
\end{align}

If a variable $X$ follows a *Binomial Distribution* where the probability of *success* in a trial is $p$, and $n$ is the *total* number of trials. This can be written as

\begin{equation}
X \sim B(n,\, p)
\end{equation}

## Expectation

\begin{equation}
E(X) = np
\end{equation}

## Variance

\begin{equation}
Var(X) = np \cdot (1 - p)
\end{equation}

## Approximation

### Poisson Distribution

$X \sim B(n,\, p)$ can be approximated by the *Poisson Distribution* $X \sim Po(np)$ if $n$ is *large* and $p$ is *small*.

Because both the *expectation* and *variance* of $X \sim Po(np)$ are $np$. When $n$ is large and $p$ is small, $(1 - p) \approx 1$ and for $X \sim B(n,\, p)$:

\begin{equation}
E(X) = np
\end{equation}

\begin{equation}
Var(X) \approx np
\end{equation}

The approximation is typically very close if $n > 50$ and $p < 0.1$.

### Normal Distribution

Suppose $q$ is $(1 - p)$.

Normally if $np > 5$ and $nq > 5$, $X \sim B(n,\, p)$ also can be approximated by the *Normal Distribution* $X \sim N(np,\, npq)$.

f99a902de98a89b27d709a3b194ddff3d00c37af
ipynb
Jupyter Notebook
exercises/Binomial Distribution.ipynb
czs108/Probability-Theory-Exercises
60c6546db1e7f075b311d1e59b0afc3a13d93229
MIT
exercises/Binomial Distribution.ipynb
czs108/Probability-Theory-Exercises
60c6546db1e7f075b311d1e59b0afc3a13d93229
MIT
exercises/Binomial Distribution.ipynb
czs108/Probability-Theory-Exercises
60c6546db1e7f075b311d1e59b0afc3a13d93229
MIT
2022-03-21T05:04:07.000Z
2022-03-21T05:04:07.000Z
Qwen/Qwen-72B
1. YES
2. YES