A Curious Coin-Flipping Game

Three players have , , and unbiased coins. The players simultaneously flip coins.
• If the result is three heads or three tails, nobody wins or loses on that toss.
• If the result is either two heads and one tail or one head and two tails, then the two players whose coins matched give those coins to the third player.
Tosses are continued until one of the players has no more coins. This Demonstration shows simulations of this game. The histogram is a fixed image.


  • [Snapshot]
  • [Snapshot]
  • [Snapshot]


In the first snapshot, the game stopped as soon as possible (in six tosses), but in the second snapshot the game lasted 51 tosses. Note that steps down are one unit while steps up are two units. When the paths remain constant, the outcome was three heads or three tails.
In the third snapshot we see relative frequencies of the duration of the game when each player initially has six coins. These relative frequencies are based on one million simulations of the game (these simulations were done outside of this Demonstration). On average, the game lasted 18 tosses. About half of the games lasted at most 14 tosses and about half at least 15 tosses. The most frequent duration was 7. Interestingly, the histogram is two-peaked, with peaks at 7 and 10 and a local minimum at 9. The shortest duration is 6 but there is no upper bound on the duration; among the one million simulations, one game lasted 151 tosses! However, almost all games last at most, say, 80 tosses (there is a probability of approximately 0.0015 that the game lasts more than 80 tosses).
This Demonstration shows the expected duration of the game, which is . Its derivation was posed as a problem in the August–September 1941 issue of American Mathematical Monthly (p. 483). This hard problem was solved 25 years later, in 1966 [1]. The solution is cited in problem 4 of [2, pp. 42, 114]; our Demonstration is based on this book.
[1] R. C. Read, "A Type of 'Gambler’s Ruin' Problem," American Mathematical Monthly, 1966 pp. 177–179.
[2] P. J. Nahin, Digital Dice: Computational Solutions to Practical Probability Problems, Princeton: Princeton University Press, 2008.
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.

Mathematica »
The #1 tool for creating Demonstrations
and anything technical.
Wolfram|Alpha »
Explore anything with the first
computational knowledge engine.
MathWorld »
The web's most extensive
mathematics resource.
Course Assistant Apps »
An app for every course—
right in the palm of your hand.
Wolfram Blog »
Read our views on math,
science, and technology.
Computable Document Format »
The format that makes Demonstrations
(and any information) easy to share and
interact with.
STEM Initiative »
Programs & resources for
educators, schools & students.
Computerbasedmath.org »
Join the initiative for modernizing
math education.
Step-by-Step Solutions »
Walk through homework problems one step at a time, with hints to help along the way.
Wolfram Problem Generator »
Unlimited random practice problems and answers with built-in step-by-step solutions. Practice online or make a printable study sheet.
Wolfram Language »
Knowledge-based programming for everyone.
Powered by Wolfram Mathematica © 2018 Wolfram Demonstrations Project & Contributors  |  Terms of Use  |  Privacy Policy  |  RSS Give us your feedback
Note: To run this Demonstration you need Mathematica 7+ or the free Mathematica Player 7EX
Download or upgrade to Mathematica Player 7EX
I already have Mathematica Player or Mathematica 7+