We perform $n$ independent Bernoulli trials, each with the same probability of success $p$, where $0<p<1$. Let $X$ be the Random variable equal to the total number of successes.

The distribution of $X$ is called a **Binomial distribution** with parameters $n$ and $p$. The textbook writes this as $X∼Bin(n,p)$.

If we want to show a distribution is binomial, we can simply explain what the number of trials are, what the chance of success is, and that each trial is independent of one another.

Connection to the Bernoulli distribution

If the number of trials is $n=1$, then the Binomial distribution is the same as the Bernoulli distribution. That is, $X∼Bern(p)$ as well.

## PMF

If $X∼Bin(n,p)$, then the PMF of $X$ is given by

$P(X=k)=(kn )p_{k}(1−p)_{n−k}$Intuitively, we are asking the probability of getting exactly $k$ successful trials out of the $n$. Since the success rate is $p$, we have $p_{k}$. Similarly, the failure rate must be $1−p$, and the number of failed trials is $n−k$, so we also have $(1−p)_{n−k}$.

## Expectation

Using the PMF, we can derive the Binomial expectation of $X$. Remember that we can also end up with zero successes, so the summation begins at zero. (Although, $x_{0}=0$ and so this term does nothing in the summation.)

$E(X)=i=0∑n x_{i}⋅P(X=x_{i})=i=0∑n x_{i}⋅(x_{i}n )p_{x_{i}}(1−p)_{n−x_{i}}$This sucks to calculate. Instead, remember that each $x_{i}$ represents one Bernoulli trial, which either *succeeds* (with rate $p$) or *fails*. We can represent $X$ as a sum of $n$ Indicator variables, where $I_{i}$ is the r.v. for $x_{i}$. Then by LOE, we have

## Variance

As shown above, we can represent $X$ as a sum of indicator variables. These indicators each correspond to one Bernoulli trial, and we know they’re all *independent*, so $Var(X)$ is given by