# Binomial Distribution Derivation

#### earthboy

A population of $$\displaystyle n$$ elements include $$\displaystyle np$$ red ones and $$\displaystyle nq$$ black ones, such that $$\displaystyle p+q=1$$. A random sample of size $$\displaystyle r$$ is taken with replacement. Prove that the probability of its including exactly $$\displaystyle k$$ red elements is $$\displaystyle \binom{r}{k}p^{k}q^{r-k}$$

#### romsek

MHF Helper
This derivation appears in a zillion places on the web but no.. you want one of us to painstakingly write it out for you.

1 person

#### Walagaster

MHF Helper
A population of $$\displaystyle n$$ elements include $$\displaystyle np$$ red ones and $$\displaystyle nq$$ black ones, such that $$\displaystyle p+q=1$$. A random sample of size $$\displaystyle r$$ is taken with replacement. Prove that the probability of its including exactly $$\displaystyle k$$ red elements is $$\displaystyle \binom{r}{k}p^{k}q^{r-k}$$
What a strange way to give the numbers of elements. So the probability of picking a red one in one trial is$$P = \frac {\text{number of reds}}{\text{total number of elements}} = \frac{np}{np+nq}= \frac p {p+q} = \frac p 1 = p$$
Therefore you want the binomial B(n,p) distribution which, as romsek has pointed out, is all over the place on the net.

#### earthboy

I might not have made my question clear, but I wanted to derive the distribution from a purely counting point of view.
So, what I wanted to ask actually was if there is a way to prove $$\displaystyle \frac{\binom{np}{k}\binom{nq}{r-k}}{n^r} = \binom{r}{k}p^{k}q^{r-k}$$, which is where I got stuck.

#### HallsofIvy

MHF Helper
One way to get "r" red and "n- r" black is to get all r red first then n- r black:rrrrr...rrbbbb...bb. The probability of that is (p)(p)(p)…(p) (r times) times q(q)(q)…(q) (n- r times). The probability of that is p^rq^(n-r). But another way would be to get rrrr...rbrbbb..bb. The probability of that is (p)(p)(p)…(q)(p)(q)(q)…(q) which is exactly the same product. The number of different orders of r red and n- r black is the binomial coefficient $$\displaystyle \begin{pmatrix}n \\ r \end{pmatrix}$$ so the probability of "r" red and "n-r" black in any order is $$\displaystyle \begin{pmatrix}n \\ r \end{pmatrix}p^rq^{n-r}$$.