The Gambler's Ruin

The gambler starts with an unit stake and the casino or house starts with units. They repeatedly play a game for which the gambler has a fixed probability of winning and the winner gets 1 unit from the loser. Play continues until the gambler "succeeds" by acquiring units or is "ruined" by dropping to 0 units. This Demonstration computes the probability that the gambler will succeed by breaking the bank. Subtracting this probability from 1 gives the gambler's ruin probability. The theoretical expected number of plays of the game until success or ruin is also computed and a simulation gives empirical results for the various parameter values. In the example shown in the thumbnail we use , the player's probability of winning an "even money" bet in American roulette.
  • Contributed by: Ed Packel (Lake Forest College)


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


Snapshot 1: a fair game—in such cases the gambler's overall success probability is simply , the gambler's proportion of the total stake and the expected number of plays until ruin is
Snapshot 2: , which is about what an expert card counter in blackjack might achieve; in the simulation, the gambler generates a nice profit, but would require a very long time to break the bank
Snapshot 3: results also apply to two individuals playing "head on"; here the "player" triumphs with the help of a larger bankroll, despite the fact that the odds slightly favor the opponent
Related results: Derivation of the relevant formulas for probability of success and for expected time for success or ruin involves a nice application of recurrence relations. It also provides an interesting example of an absorbing Markov chain. For a more elementary approach, see Chapter 6 of the reference below.
E. Packel, The Mathematics of Games and Gambling, 2nd ed., Washington: The Mathematical Association of America, 2006.
    • 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+