# Bernoulli Binomial Distribution

1. Nov 18, 2015

### RyanTAsher

1. The problem statement, all variables and given/known data

Derive the bernoulli binomial distribution by generalizing the probability of a coin flip.

$P(k, n) = \binom{n}{k}p^{k}q^{(n-k)}$, q = p - 1

2. Relevant equations

Combination: $\binom{n}{k} = \frac {n!} {k!(n-k)!}$

Prob. of coin flip: $\frac {\binom{n}{k}} {2^n}$

3. The attempt at a solution

I don't have much background in statistics, so I'm trying to figure out how these distributions were derived and such.

Looking at it in terms of a game, like flipping a coin, where heads is a win, tails is a lose, I don't understand things like why the probability of getting a win is $p^{k}$ , or why the probability of losing is $(p-1)^{n-k}$. Then after that, why is the $\binom{n}{k}$ even included in the equation.

I've been reading books, and articles, and I'm just not really wrapping my head around how multiplying the combination of $\binom{n}{k}$ by the probability of winning by the probability of losing, even gives us the probability of the outcome.

2. Nov 18, 2015

### RUber

If p is the probability of a win, then p^k is the probability of winning k times in a row.
If you have n trials and only win k times, then you lose the rest (n-k) of te trials. So the probability of winning the first k and then losing the rest would be $p^k(1-p)^{n-k}$.
Now comes the combination part.
As I said, the probability of winning the first k and losing the rest is that piece of the formula. But the probability would be the same if you lost the first n-k and won the last k.
In all, you have to add up all the possible ways to win k times out of n. Each way has the same probability, so the total probability of winning k times is the probability of one of the ways times the number of combinations of k wins and n-k losses.

3. Nov 18, 2015

### Ray Vickson

Suppose n = 5, for example, and k = 2; so, we toss a coin 5 times and are interested in the event {2 heads, 3 tails}. We can list all the possible outcomes in order from toss 1, toss 2, ..., toss 5:
(1) HHTTT
(2) HTHTT
(3) HTTHT
(4) HTHTT
(5) HTTTH
(6) TTTHH
(7) TTHTH
(8) TTHHT
(9) THHTT
(10) THTHT
If p = probability of H in one toss (and 1 = 1-p = probability of T), ask yourself: what is P(outcome 1)? What is P(outcome 2)? ... P(outcome 10)? Rember, we are assuming independent tosses, so getting H or T on one toss does not affect in any way the probability of H or T in any other toss.

Now put it all together: what is P(2 H and 3 T)?

4. Nov 18, 2015

### RyanTAsher

Thank you, this outline of all the constituents really helped, I was able to visualized how it was put together here.

Okay, this exercise helped, a lot. I think a lot of my confusion was stemming from the fact that the game of flipping a coin, both the win, and lose have equal probability, so I kept just writing the probability as $p^{n}$, which would work in the case of a coin, but since we are generalizing it for other scenarios, we need to take into account the fact that the probability of losing and winning could be different, and it really showcased the need for that combination as well.

So, I ended up doing outcome 1, and outcome 2, that was where I realized the point of the $1 - p = p(T)$.

$P(O_1) = p * p * (1-p) * (1-p) * (1-p) = p^{2}(p-1)^{3}$
$P(O_2) = p * (1-p) * p * (1-p) * (1-p) = p^{2}(p-1)^{3}$

That's kinda when I realized you could generalize it as $p^{k}(1-p)^{(n-k)}$...

Then, to take into account all the different combinations, you would have to use the $\binom{n}{k}$, to take into account the probability of all those outcomes together.

$P(k,n) = \binom{n}{k} p^{k}(1-p)^{(n-k)}$

To solve the problem...

$P(2H and 3T) = \binom{5}{2} p^{2}(1-p)^{3} = \binom{5}{2} (\frac 1 2)^{5} = (10)(\frac {1} {32}) = .3125 = 31.25 \%$