Flipping coins


 

Flip a coin until the number of heads equals the number of tails. Record the number of tosses. What do you observe?

 

Remark. Instead of flipping coins, students may toss a die and record whether the score is even or odd. Or they may use pseudo-random number generators on their calculators.

 

Students will observe that most of the time the number of required tosses is very small, but that also often it is large. Some students will have to give up, because they will not get an even number of heads and tails within the time allotted.

 

A theoretical explanation.

 

Variables:

      n       the number of tosses until an equal number of heads and tails is reached.
      p(n)       the probability of getting an equal number of heads and tails in n tosses.
      C(n)       cumulative probability of p(n).
      a(n)       average number of tosses, providing that it didn't exceed n.

 

Notice that we only need to look at even numbers. For odd numbers, the number of heads and tails has to be different.

 

Theoretical data for a perfect coin (rounded).

n:       p(n):       C(n):       a(n):      
2 .5 .5 2
4 .125 .625 2.4
6 .0625 .6875 2.728
8 .0391 .7266 3.01
10 .0273 .7539 3.264
12 .0205 .7744 3.496
14 .0161 .7905 3.71
16 .0131 .8036 3.91
18 .0109 .8145 4.098
20 .0093 .8238 4.278
... ... ... ...
40 .0032 .8746 5.734
... ... ... ...
60 .0017 .8974 6.858
... ... ... ...
80 .0011 .9111 7.808
... ... ... ...
100 .0008 .9204 8.648
... ... ... ...
130 .0005 .9302 9.762
... ... ... ...
160 .0004 .9370 10.674
... ... ... ...
190 .0003 .9422 11.658

 

Observations.

1. At first, p(n) decreases fast. But its decrease slows down considerably.

2. C(190) = .9422. This means that in almost 6% of the cases we need more than 190 tosses to get an equal number of heads and tails. So we can expect that some runs will be very long. This brings the question: "What is the chance that the run would never end, namely, that heads (or tails) will never lose its lead?"

This question cannot be answered experimentally. The theoretical answer is such that for a perfect coin the chance of an infinite run is 0. But if the coin is biased toward heads (or tails), then such runs can happen with a probability that depends on the bias.

3. We see that the average grows. This is obvious, because if we wait longer, we will see more longer runs. But the question is, "Is its growth bounded?", or maybe, "Does the average grow indefinitely?" The average does grow indefinitely. This means that the expected time until the number of heads and tails is the same is "infinite".

 

Remark.

These and similar results are studied in probability theory under the headlines of "Random walks."


Webpage Maintained by Owen Ramsey
Lesson Index