# The probability of exactly k successes in n independent Bernoulli trials

A coin is biased so that the probability of heads is $2/3$. What is the probability that exactly four heads come up when the coin is flipped seven times, assuming that the flips are independent?

I am Wondering can someone solve this problem other than using (Bernoulli trials) $$\binom 74\cdot \left(\cfrac 23\right)^4\cdot\left(\cfrac 13\right)^3$$

-
One could arrive at that formula from numerous arguments. Are there any particular properties you are looking for in a solution? –  Jonas Meyer Dec 4 '12 at 6:01
I understand Bernoulli trials formula for solving this problem but I was wondering if there is another easier solution for this -type- of problem exist or not , –  Hooman Dec 4 '12 at 6:04

We could do it more explicitly as a counting problem. An urn has $2$ red balls and $1$ green ball, each with an ID number written on it. We take a ball out of the urn, record its colour and ID number, replace the ball, and do this again and again, a total of $7$ times.

There are $3^7$ sequences of ID numbers, all equally likely.

How many of these sequences have exactly $4$ red? The locations of the reds can be chosen in $\dbinom{7}{4}$ ways.

For each choice of locations, there are $2^4$ possible sequences of ID numbers.

Once the locations of the red ID numbers, and the exact sequence of red ID numbers, are known, the rest of the locations can only be filled in $1$ way.

So there are $\dbinom{7}{4}4^7$ sequences that give us $4$ red and the rest black. The required probability is therefore $$\frac{\binom{7}{4}2^4}{3^7}.$$ Naturally, this is the same number as the one obtained from the known binomial distribution formula.

-
That's neat. It might be difficult to adapt to the case when the probability of a head is $\dfrac{1}{\sqrt 2}$. –  Jonas Meyer Dec 4 '12 at 6:45
Yes, the ancient Pythagoreans were experts in combinatorics, and they got upset by the very phenomenon that you point out, that combinatorics is insufficient for probability. –  André Nicolas Dec 4 '12 at 7:05