Start with one flip of a coin. If you flip the coin once, you know the answer. Call the probability of getting heads P, so the probability of getting tails is (1-P). The symbol kPn represents the probability of getting k heads in n flips.
Flip the coin a second time. Now there are several possibilities. You could have two tails, two heads, a head and a tail, or a tail and a head. I wrote down the probabilities for one flip. The probabilities for the second flip are the same, but I have to multiply the first flip by the second. The probability of getting two heads in a row is the probability of getting heads on the first toss times the probability of getting heads on the second toss:
The most interesting example is the 1P2. It says that the probability of getting one head in two tosses is the probability of getting a head then a tail, plus a tail then a head. Substituting in the values for 0P1 and 1P1 from the previous example gives:
I want to flip the coin one more time before moving on to the general case:
With the three-flip case, what is happening becomes more obvious. It finds all the ways that I can select k heads from n flips, and it multiplies by Pk to give the probability for this number of heads. Then I multiply again by (1-P)n-k to give the probability for this number of tails. Any statistics text will tell you that the number of ways of picking k from n is:
So:
Checking this equation against the values already calculated for n = 3 in the previous example shows that it is correct:
Note that 0! and 1! are both equal to 1: