Gambler's Ruin Calculator
The Gambler's Ruin Calculator computes the probability of wining a game, the probability of losing all your money (ruin) and the expected number of bets before ruin. The computations apply to a fair game (probability of winning a bet is 0.5) and an unfair game (probability if winning a bet is not equal to 0.5).
Computational Notes:
Key Variables
- i The gambler's starting capital.
- N The gambler's target total capital (the winning goal).
- p The probability of winning a single bet.
- q The probability of losing a single bet. q = 1 - p.
- r = q/p The ratio of the probability of losing a bet to the probability of winning a bet.
Probabilities for Fair Game (p = .5)
Probability of ruin (Losing all money) = (N - i) / N
Probability of reaching target $ amount =1 - Probability of ruin (Losing all money)
Expected number bets for the game = i * (N - i)
Probabilities for Unfair Game (p <> .5)
Probability of ruin (Losing all money) =(r**N - r**i) / (r**N - 1)
Probability of reaching target $ amount = 1 - Probability of ruin (Losing all money)
Expected number bets for the game = i / (q - p) - N / (q - p) * (1 - r**i) / (1 - r**N)