The Bernoulli distribution

The Bernoulli distribution is named after Jacob Bernoulli, a famous mathematician. It arises as the result of a binary outcome. Bernoulli random variables take (only) the values 1 and 0 with probabilities of (say) \(p\) and \(1-p\) respectively

\[ P(X = x) = p^x(1 - p)^{1-x} \]

The mean of a Bernoulli random variable is p and the variance is \(p(1-p)\)

Binomial Trials

A binomial trial is the sum of heads of flips of a potentially biased coin. In specific, let \(X_1, ..., X_n\) be iid Bernoulli\((p)\); Then \(X = \sum_{i = 1}^n X_i\) is a binomial random variable

\[ P(X = x) = \binom nk p^x(1-p)^{n-x} \]

Recall the notation

\[ \binom nx = \frac{n!}{x!(n-x)!} \]

and that

\[ \binom n0 = \binom nn = 1 \]

Example

Suppose a friend has 8 children (oh my!), 7 of which are girls If each gender has an independent 50% probability for each birth, what’s the probability of getting 7 or more girls out of 8 births?

\[ \binom 87 0.5^7(1-0.5) + \binom 88 0.5^8(1-0.5)^0 \approx 0.04 \]

The R code

choose(8, 7) * .5 ^ 8 + choose(8, 8) * .5 ^ 8
## [1] 0.03515625
pbinom(6, size = 8, prob = .5, lower.tail = F)
## [1] 0.03515625