Skip to content
DiceSim

Learn · Risk

Risk of ruin in dice betting, explained

Risk of ruin is the probability that a dice strategy loses its whole bankroll within a given number of rolls. For a betting progression such as the martingale it can be estimated from three inputs: the chance of losing one roll, the longest losing streak the bankroll can pay for, and the number of rolls you plan to play. This article explains the risk of ruin formula DiceSim uses and works through an example with real numbers.

What risk of ruin means

In DiceSim a run is ruined when the script asks for a bet larger than the remaining balance. The engine stops the run there and marks it as bankrupt. A balance of a few satoshis left over does not help, because the strategy can no longer follow its own rules.

Risk of ruin always has a time horizon attached. A figure such as "5% risk of ruin" means nothing until you say over how many rolls. The same strategy can have a small risk over 1,000 rolls and a near certain one over 100,000.

It is also separate from the expected loss. The house edge takes a fixed share of everything wagered (see dice house edge explained), so a run can avoid ruin and still finish below where it started. Risk of ruin measures only the total wipeout.

Why progressions trade small wins for rare total loss

A negative progression raises the bet after a loss so that one win recovers everything lost in the sequence. The martingale doubles after each loss at a 2x payout. When the win finally comes, the sequence closes with a profit of one base bet.

That design produces a long series of small, frequent gains. It also means the bet grows exponentially during a losing streak. Sooner or later a streak arrives that is long enough to need a bet the balance cannot cover, and that single streak loses most of the bankroll at once.

The odds of each roll stay the same. The progression gathers the losses into rare, large events, which is why a balance chart for a martingale tends to climb in a smooth line and then drop in one step.

The max survivable streak

With base bet b and a multiplier r applied after each loss, the stakes after a run of losses are b, b·r, b·r² and so on. The total lost after N straight losses is a geometric sum:

B_req = b · (r^N − 1) / (r − 1)
Bankroll used by N straight losses

Setting B_req equal to the balance and solving for N gives the longest streak the bankroll can absorb. DiceSim rounds it down, since a partial bet is not possible:

N = floor( ln(1 + balance · (r − 1) / b) / ln r )
Max survivable streak (r = 1 gives balance / b)

The streak after that one, N + 1 losses in a row, ends the run. Because N grows with the logarithm of balance divided by base bet, doubling the bankroll at r = 2 adds only one survivable loss. The bankroll management guide has a table of N for different base bet sizes.

The waiting-time model

Expected rolls until N losses in a row

Let q be the chance of losing one roll, so q = 1 − chance / 100. The probability that one particular block of N rolls is all losses is q^N. More useful is the expected number of rolls until the first run of N losses appears anywhere in the sequence. For independent rolls this is a standard result for runs in Bernoulli trials (Feller, An Introduction to Probability Theory and Its Applications, Vol. 1, chapter XIII):

E_S = (1 − q^N) / ((1 − q) · q^N)
Expected rolls until the first run of N losses

E_S is roughly 1 / (p · q^N) when q^N is small, where p = 1 − q. A losing run has to start somewhere, which needs a win just before it, so the waiting time is longer than 1 / q^N.

From waiting time to risk of ruin

Fatal streaks are rare and the rolls are independent, so they arrive close to a Poisson process with an average gap of E_S rolls. The chance of at least one arrival within T rolls is then:

RoR ≈ 1 − e^(−T / E_S)
Risk of ruin over T rolls

When T is small compared with E_S, this is close to T / E_S. When T equals E_S it is about 63%, and by three times E_S it is about 95%. This is the formula behind the risk of ruin figure on the DiceSim calculator.

Why the older form understates it

Some calculators use RoR = 1 − (1 − q^N)^(T / E_S). That expression splits the horizon into blocks of E_S rolls and gives each block a q^N chance of ruin. A block of E_S rolls already contains one fatal streak on average, so multiplying by q^N counts the rarity of the streak a second time. The result is too small by roughly a factor of 1 / q^N, which for the example below is several orders of magnitude.

Worked example: martingale at 49.5%

Take the classic martingale: win chance 49.5% at a 1% house edge, which pays 2x. The starting balance is 0.01 and the base bet is 0.000001, so the bet doubles after every loss and resets after a win. The numbers below are computed by the same engine code as the calculator when this page is built.

  • Chance of losing one roll: q = 0.505.
  • Max survivable streak: N = 13. Those 13 losses cost 0.008191, leaving 0.001809, and the next bet would be 0.008192.
  • Chance that a given block of 13 rolls is all losses: q^N = 0.014%, about 1 in 7,198.
  • Expected rolls until the first run of 13 losses: E_S ≈ 14,539.
Risk of ruin for the martingale example at three horizons
Rolls (T)T / E_SRoR ≈ 1 − e^(−T/E_S)Older form
1,0000.0696.65%0.00096%
10,0000.68849.7%0.0096%
100,0006.87899.9%0.096%

Over 1,000 rolls the risk is 6.65%. Over 10,000 rolls it is 49.7%, close to a coin flip, and over 100,000 rolls it is 99.9%. The older form reports 0.0096% for 10,000 rolls.

Compare that with what the strategy earns while it survives. Each completed sequence nets one base bet, 0.000001. In 10,000 rolls you expect about 4,950 wins, so a run that dodges the streak gains roughly 0.00495. The run that hits it loses about 0.008191 in one sequence.

Limits of the model

The formula is an estimate. These are the assumptions it rests on:

  • Rolls are independent and the win chance is fixed. Provably fair dice rolls are independent, but a script that changes its win chance during a streak has a different q for each roll, and the single-q formula no longer applies directly.
  • The base bet is fixed and N is computed from the starting balance. If the base bet scales with the current balance, or the balance grows while the base stays fixed, N changes over the run. Profit made along the way slowly raises N, and losses lower it.
  • Only the full streak counts. A streak of N − 1 losses followed by a win is survived in the model. In practice it leaves the run briefly short of its peak, and a cap on the bet size (a max bet) can turn a recoverable streak into a permanent loss.
  • Nothing is vaulted. Funds moved out with vault() cannot be bet, so they lower the active balance and N, but they also cannot be lost. A vaulting script loses less in a wipeout and wipes out more often.

When a script breaks these assumptions, the simulator is the better tool. Running the script on many seeds counts the bankrupt runs directly. The guide on reading simulation results explains what to look for.

Try it

FAQ

What is risk of ruin in dice?

It is the probability that a strategy loses its whole bankroll, or can no longer place the next bet, within a given number of rolls. In DiceSim a run ends as bankrupt when the next bet is larger than the balance.

What is the risk of ruin formula?

For a progression that survives at most N losses in a row, RoR over T rolls is approximately 1 − e^(−T / E_S), where E_S = (1 − q^N) / ((1 − q) · q^N) is the expected number of rolls until the first run of N losses and q is the chance of losing one roll.

Does a bigger bankroll remove the risk of ruin?

No. A bigger bankroll relative to the base bet raises N, which makes the fatal streak rarer, so ruin takes longer on average. Over enough rolls the probability still approaches 100% for any progression that has a finite N.

Is risk of ruin the same as the chance of losing money?

No. Risk of ruin counts only the total wipeout. A run can avoid ruin and still finish below its starting balance, because the house edge takes a share of everything wagered.