(https://www.dartmouth.edu/~chance/teaching_aids/books_articles/probability_book/amsbook.mac.pdf) (this question comes from here page 6)

“Peter and Paul play a game called heads or tails. In this game, a fair coin is tossed a sequence of times—we choose 40. Each time a head comes up Peter wins 1 penny from Paul, and each time a tail comes up Peter loses 1 penny to Paul. We adopt the convention that, when Peter’s winnings are 0, he is in the lead if he was ahead at the previous toss and not if he was behind at the previous toss. With this convention, Peter is in the lead 34 times in our example. Again, our intuition might suggest that the most likely number of times to be in the lead is 1/2 of 40, or 20, and the least likely numbers are the extreme cases of 40 or 0. Our intuition about Peter’s final winnings was quite correct, but our intuition about the number of times Peter was in the lead was completely wrong. The simulation suggests that the least likely number of times in the lead is 20 and the most likely is 0 or 40. This is indeed correct, and the explanation for it is suggested by playing the game of heads or tails with a large number of tosses and looking at a graph of Peter’s winnings. In Figure 1.4 we show the results of a simulation of the game, for 1000 tosses and in Figure 1.5 for 10,000 tosses"



The intuition that 20 should be the most likely result is probably related to the Gambler's fallacy.

It might feel intuitive, or more fair, that after Peter wins the first toss (say) the odds should turn to Paul's favor to even out the score. In reality, once one player has a lead, the expectation is that they keep the lead - the fact that Peter won more often in the past is irrelevant.


The fundamental result is called the Arcsine Law, for which @user462110 gives a nice intuitive justification (+1). Feller's famous probability book has a proof, which this page discusses in detail.

Roughly stated the Arcsine Law says that, for sufficiently large number $n$ of plays, the proportion of the time that Peter is ahead is approximately $\mathsf{Beta}(.5,.5).$ The name 'Arcsine Law' arises because the CDF of this beta distribution contains an arcsine function.

Below is a simulation for $n = 200,$ which is large enough for a histogram of the proportion of time Peter is ahead to give a very nice fit to the PDF (red curve below) of $\mathsf{Beta}(.5,.5).$ Certainly, your claim is true for $n = 40$ (the low bin of the histogram is centered at 0.5), but $n = 200$ makes a nicer graph.

The R program below simulates a million 200-toss games. Each game begins with a vector ht of 200 coin tosses. The vector x finds Peter's cumulative 'fortune' after each toss, and the lagged vector xp shows his fortune at the previous toss in order to implement your convention about being ahead or behind if a $0$ fortune occurs. Finally, the quantity ahead shows the proportion of tosses at which Peter was ahead in the $i$th game.

m = 10^6;  ahead= numeric(m);  n = 200
for(i in 1:m) {
  ht = sample(c(-1,1), n, repl=T)
  x = cumsum(ht); xp = c(0,x[1:(n-1)])
  ahead[i] = mean(sign(x+xp)>0) }
mean(ahead);  sd(ahead)
## 0.5000942  # aprx mean of BETA(.5,.5)
## 0.3552423  # aprx SD

hist(ahead, prob=T, col="skyblue2")
curve(dbeta(x,.5,.5), lwd=2, col="red", add=T)

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.