When a coin is tossed over and over again, we say that heads leads when there are more heads than tails, and that tail leads when there are more tails than heads. When the number of heads and tails is the same, nobody leads (heads and tails are tied).
There is an interesting theorem that says that if the coin is fair, namely, the probabilities of getting head and getting tail are both ½, then the lead will keep changing. More precisely, if you don’t stop tossing, the probability that the lead will eventually change is 1.
But it almost impossible to predict how soon the lead will change. So we are going to investigate the pattern of changes in the lead by simulating repeated coin tosses on the TI-84 calculator and see what happens.
This program simulates flipping a fair coin, and it counts the number of times the lead (tails ahead or heads ahead) changes. For example, the output {7 145} means that, so far, there have been 7 changes of the lead during 145 flips. The program does not stop by itself. It only pauses after each change of lead. You have to terminate its execution by pressing the ON key. Then you still can look at all the program variables to see how many flips were made and how big the lead was.
PROGRAM:CHANGE | Comments: |
:2randInt(0,1)-1→L | L is the size of the lead, positive and negative values show whether heads leads or tails leads |
:1→N | N is the number of flips |
:0→C | C is the number of changes of the lead so far |
:While 1 | |
:L→P | P is the size of the lead before the next two tosses |
:For(K,1,2) | We flip a coin twice, because the lead cannot change after just one flip |
:L+2randInt(0,1)-1→L | |
:End | |
:N+2→N | The number of flips increases by 2 |
:If P*L<0 | When P times L is negative, it means that the lead has changed, and it will be displayed |
:Then | |
:C+1→C | The number of changes increases by 1 |
:Disp "CHANGE",{C,N} | The word CHANGE is displayed, followed by the number of changes and the number of flips |
:Pause | The program waits for you to press ENTER before it starts running again |
:End | |
:End |
I ran the program CHANGE on my calculator until the lead changed 50 times, and I wrote down all the outcomes. The first output, {1 575}, shows that the first change of the lead occurred at flip number 575. Notice that there was a long stretch of flips between lead changes 22 and 23, which occurred on flips numbered 1055 and 38109. I had to wait a long time! Also notice that some lead changes happened only two flips apart.
{1 575} | {26 38447} |
{2 579} | {27 38467} |
{3 581} | {28 38489} |
{4 605} | {29 38491} |
{5 623} | {30 38521} |
{6 627} | {31 38783} |
{7 693} | {32 38787} |
{8 711} | {33 38789} |
{9 713} | {34 38793} |
{10 715} | {35 38805} |
{11 771} | {36 39103} |
{12 779} | {37 39107} |
{13 831} | {38 39199} |
{14 833} | {39 39225} |
{15 835} | {40 39231} |
{16 919} | {41 39233} |
{17 999} | {42 39235} |
{18 1003} | {43 39257} |
{19 1033} | {44 39267} |
{20 1039} | {45 39283} |
{21 1043} | {46 39305} |
{22 1055} | {47 39309} |
{23 38019} | {48 39313} |
{24 38049} | {49 39541} |
{25 38441} | {50 39543} |