Skip to content
DiceSim

Learn · Math

Expected value and variance in dice

Expected value and variance are the two numbers that describe a dice bet. Expected value (EV) is the average result per bet over the long run, and in dice it is set by the house edge. Variance measures how far single results swing around that average. This page gives the formulas for both, works them out at 49.5% and 3.35%, and shows how many rolls it takes before the expected loss outweighs luck.

Expected value of one bet

Take a stake of 1 unit at win chance p (as a fraction) and payout multiplier m. A win returns m, so the profit is m − 1. A loss costs the stake, −1. Weighting each outcome by its probability:

EV = p · (m − 1) − (1 − p) = p · m − 1
EV per unit staked

With the dice payout m = (100 − edge) / chance and p = chance / 100, the product p · m is (100 − edge) / 100. So EV is −edge / 100 per unit, the same at every chance. At a 1% edge every bet loses 0.01 units on average. The house edge guide covers this in more detail.

Variance of one bet

Variance is the expected squared distance from the mean. For a two-outcome bet whose results differ by m (a win at m − 1, a loss at −1), it reduces to a short formula. The standard deviation σ is its square root and is in the same units as the stake.

σ² = p · (1 − p) · m²
Variance per unit staked
EV and variance per unit staked at 49.5% and 3.35%, 1% house edge
Win chancePayoutEV per betVariance σ²Std dev σ
49.5%2x−0.010.99990.9999
3.35%29.5522x−0.0128.27665.3176

Both chances have the same EV. The 3.35% bet has about 28.3 times the variance of the 49.5% bet, because it loses most of the time and pays 29.5522x when it wins. One unit staked at 3.35% swings by about 5.32 units per bet, compared with about 1 at 49.5%.

How variance scales with rolls

Dice rolls are independent, so over n flat bets of 1 unit the means add and the variances add. The expected profit is n · EV and its standard deviation is σ · √n.

mean = n · EV, std dev = σ · √n
Flat betting, n bets of 1 unit

The expected loss grows in proportion to n, while the spread grows only with its square root. Early on the spread dominates. Later the drift does. A useful marker is the number of rolls at which the expected loss equals one standard deviation:

n* = (σ / |EV|)²
Rolls where expected loss = one standard deviation

At 49.5% that is about 9,999 rolls. At 3.35% it is about 282,766 rolls. Before those points, a run that is one standard deviation lucky still shows a profit.

Expected profit and standard deviation for flat 1-unit bets
Rolls49.5%: expected49.5%: std dev3.35%: expected3.35%: std dev
100−110−153.2
1,000−1031.6−10168.2
10,000−100100−100531.8
100,000−1,000316.2−1,0001,681.6

Why a short run can look profitable

The table below gives the exact probability that a flat bettor is strictly ahead after n bets. It is computed from the binomial distribution: with k wins the profit is k · m − n, so the run is ahead when k > n / m.

Probability of being ahead after n flat bets at a 1% house edge
RollsAhead at 49.5%Ahead at 3.35%
10042.1%43.2%
1,00036.4%48.9%
10,00015.6%42.0%
100,0000.077%27.7%

After 10,000 bets at 49.5%, about 15.6% of players are still ahead. After 100,000 it is 0.077%. At 3.35% the variance is so large that 42.0% are ahead after 10,000 bets and 27.7% after 100,000.

At 3.35% the share rises between 100 and 1,000 rolls before it falls. With few bets, the number of wins needed to get ahead moves in whole steps, and at 3.35% one extra win is worth about 29.6 units. The trend is still clear: the longer the run, the smaller the share of players who are ahead.

This is why a strategy that made a profit over a few thousand rolls says little about its quality. Many players with a strategy that has the same negative EV will report the same thing over the same number of rolls.

Progressions and skew

The formulas above are for flat betting. A progression changes the bet size from roll to roll, so the variance of a session depends on the bets it places. EV still adds up bet by bet: the session's expected result is −edge / 100 times the total wagered.

What changes is the shape of the outcome. A martingale wins small amounts in most sessions and loses a large amount in a few, which gives a distribution with a long left tail. The median session can be positive while the mean is negative. The risk of ruin guide computes how often the large loss arrives.

Median versus mean

For skewed results, look at both. The mean tells you the long-run cost. The median tells you what a typical session looks like. A strategy can have a pleasant median and a poor mean, and the gap between them is the size and frequency of the rare loss.

Seeing variance in the simulator

The Stress Test tab in the simulator runs the current script on 5 workers with different random seeds and the same code and settings. The overlaid balance lines show the spread directly, and the summary lists the best, worst, mean and median profit and how many runs went bankrupt.

Try a flat script at 49.5% for 10,000 rolls, then the same at 3.35%. The 3.35% lines fan out much further, which is the variance table above in chart form. The guide on reading simulation results explains each statistic.

Try it

FAQ

What is the expected value of a dice bet?

For a stake of 1 at win chance p and payout multiplier m, EV = p · m − 1. With payout (100 − edge) / chance this equals −edge / 100, so every bet at a 1% edge has EV −0.01 per unit staked.

What is the variance of a dice bet?

For a stake of 1, the variance is σ² = p · (1 − p) · m². Low win chances pay more, so their variance is much larger even though the EV is the same.

Why can a negative EV strategy show a profit?

Over n bets the expected loss grows with n while the standard deviation grows with √n. For a small n the spread is much larger than the expected loss, so many runs finish ahead by chance.

How many rolls does it take for the house edge to show?

A rough guide is the point where the expected loss equals one standard deviation, n = (σ / |EV|)². It depends on the win chance: higher variance bets need far more rolls.