Gambler's Ruin and Hitting Times

You start with ii units and bet one unit at a time. Each bet wins with probability pp and loses with probability q=1−pq = 1 - p. You stop when you reach NN units or lose everything. Two questions follow: how likely is each ending, and how long does the game last?

This is gambler's ruin, a random walk between two absorbing barriers, and it is the most reused setup in interview probability. The same equations answer a particle on a line, a best-of series between two players, a price that must hit a stop or a target first, and a trader with limited capital and a small edge.

The first-step equation

Let PiP_i be the probability of reaching NN from ii. Condition on the first bet:

Pi=p Pi+1+q Pi−1,P0=0,PN=1P_i = p\,P_{i+1} + q\,P_{i-1}, \qquad P_0 = 0, \quad P_N = 1

The rest of this lesson is for subscribers

Unlock every lesson in Advanced Topics in Probability and Statistics, and every other premium course.

Subscribe to continue

Test your knowledge

Questions are only available to subscribers.

Keep reading Advanced Topics in Probability and Statistics

47 lessons in this course, and every other premium course, on one subscription.

  • Every lesson in every course, with the worked examples and interactive simulators
  • Graded questions on every lesson, with explanations for the wrong answers as well as the right one
  • The trainers, timed assessments and brainteaser library that go with them