Binomial Distributions
\(X = {}\) the number of heads when flipping 3 coins:
\(X\) models “the number of heads in 3 tosses of a fair coin”.
3 coin tosses
Taking a token 3 times from a bag with one red and one blue token, with replacement. Counting the number of red tokens.
Asking 3 people to randomly select one of two characters, when they have no preference. Counting the number of times the friendly character was selected.
Randomly selecting 3 people from a large crowd that has 50% males and 50% females. Counting the number of females.
Randomly selecting 3 plants from a field in which 50% of the plants have some specific genetic mutation. Counting the number of plants with the mutation.
Randomly guessing on a quiz with 3 true/false questions
Mathematically, all of those are the same.
All these can be modeled by so-called binomial random variables.
\(X\) is a binomial random variable if it represents the number of successes in \(n\) replications of an experiment where
This is also called a binomial process.
A binomial random variable takes on values \(0, 1, 2, \dots, n\).
The numbers \(n\) and \(p\) are the parameters of the distribution.
We write \(X \sim \operatorname{Binom}(n, p)\).
Suppose \(X\sim \operatorname{Binom}(n,p)\). What is \(P(X = x)\)?
\[\begin{gather} P(\text{first } x \text{ are successes and last } n - x \text{ are failures}) = \\ \underbrace{p\cdot p\cdot p \cdots p}_{x\text{ times}}\cdot\underbrace{(1-p)\cdot(1-p)\cdots(1-p)}_{(n-x) \text{ times}} = p^x\cdot (1-p)^{n-x} \end{gather}\]
\[\begin{gather} P(\text{first } n-x \text{ are failures and last } x \text{ are successes}) = \\ \underbrace{(1-p)\cdot(1-p)\cdots(1-p)}_{(n-x) \text{ times}} \cdot \underbrace{p\cdot p\cdot p \cdots p}_{x\text{ times}} = p^x\cdot (1-p)^{n-x} \end{gather}\]
or it may be that the first is success, then there are two failures, then a success, and so on.
How many different ways can we choose \(x\) successes out of \(n\) repetitions?
The binomial coefficient \(\binom{n}{x}\) is the number of ways to choose \(x\) items from a set of size \(n\), where the order of the choices is ignored.
Mathematically,
\[\binom{n}{x} = \frac{\overbrace{n\cdot(n-1)\cdot(n-2)\cdots(n-x+1)}^{x \text{ factors}}} {\underbrace{x\cdot(x-1)\cdot(x-2)\cdots 1}_{x \text{ factors}}}\]
Each specific sequence of \(x\) successes in \(n\) trials has probability
\[p^x\cdot(1 - p)^{n-x}\]
There are \(\binom{n}{x}\) such sequences. The sequences are mutually exclusive!
The probability of exactly \(x\) successes in \(n\) trials is
\[\binom{n}{x} p^x (1-p)^{n-x}\]
Let \(X\) = number of successes in \(n\) trials, and \(0 \le x \le n\).
\[P(X = x)=\binom{n}{x} p^x (1-p)^{n-x}\]
Parameters of the distribution:
\(n\) = number of trials
\(p\) = probability of success
Let \(n = 3\) and \(p = 1/2\).
Calculate \(P(X = 1)\).
Let \(n = 3\) and \(p = 1/6\).
Calculate \(P(X = 2)\).
Let \(n = 16\) and \(p = 1/2\).
Calculate \(P(X = 14)\).
(Hint: \(\binom{16}{14} = \binom{16}{2}\))