Pig — the Dice Game
Everyone is taught to hold at 20. Solved properly, that is optimal in 557 of 10,000 positions — five per cent — and it gives away four points.
"Hold at 20" is right in five per cent of positions
Pig is the simplest press-your-luck game there is, and everybody is taught the same rule. Solving it properly — the state is your score, their score and the turn total, and the value is the probability the player to move wins — the optimal threshold is exactly twenty in 557 of the 10,000 score pairs. Five and a half per cent.
| You ↓ / them → | 0 | 20 | 40 | 60 | 80 | 95 |
|---|---|---|---|---|---|---|
| 0 | 21 | 23 | 26 | 32 | 49 | 100 |
| 20 | 19 | 21 | 24 | 30 | 39 | 80 |
| 40 | 18 | 19 | 21 | 24 | 60 | 60 |
| 60 | 16 | 18 | 16 | 18 | 40 | 40 |
| 80 | 20 | 20 | 20 | 20 | 20 | 20 |
| 95 | 5 | 5 | 5 | 5 | 5 | 5 |
Two places it breaks badly. At 95 points the threshold is five, because five is all you need. And at 40 against an opponent on 80 it is sixty — holding a normal turn loses anyway, so the right play is to keep rolling far past the point that feels reckless. Chasing is not tilt; it is the correct policy.
What the simple rule costs, and what the table costs
Played head to head against the exact policy and averaged across both sides to remove the first-player advantage, hold-at-20 wins about 46%. It gives away four points.
And Pig is not a fair game to begin with: under optimal play from nothing, the player who moves first wins 53.06% of the time. You go first here, so the computer is spotting you that.
The opponent above plays from a table sampled every five points — 400 entries and about a kilobyte, rather than the 10,000 entries and 28 KB of the exact policy. That coarse table scores 49% against perfect play. A table one twenty-fifth of the size gives away one point, while the rule everybody is taught gives away four. The test rebuilds the exact policy from scratch by value iteration on every deploy and checks all 400 entries match.
Notes
- The policy is not smooth. 76 of the 100 rows contain a local dip, because the right play steps at the boundaries where the opponent can or cannot finish next turn. It looks like noise and it is not.
- Never hold short of a win. If banking takes you to 100 the game is over — no threshold applies. It is the one case a fixed rule always gets wrong.
- The expected value of a roll is positive until it is not. Five faces add an average of four and one loses everything, so a roll is worth it while the turn total is under about twenty — which is where the folk rule comes from and why it is nearly right in the middle of the game.
- Turn the hint off for a fair fight. With it on you are playing the same policy as the computer, and the game becomes a coin flip decided by the dice.
How to use
- Roll to build a turn total, but a 1 wipes it out.
- Hold to bank what you have and pass the dice.
- Watch the hint — it shows the genuinely optimal play, not the folk rule.
- First to 100 wins; you go first, which is worth about three points.
Frequently asked questions
What are the rules of Pig?
Roll a die and add it to your turn total. Roll a one and you lose the whole turn total and your turn. Hold at any point to bank the total into your score. First player to 100 wins. That is the entire game, which is what makes it worth solving exactly.
Is "hold at 20" the best strategy in Pig?
Almost never. Solving the game by value iteration, the optimal threshold is exactly twenty in 557 of the 10,000 score pairs — five and a half per cent. The commonest thresholds are 21, 20, 19, 22, 18 and 23, so twenty is a fair summary of the middle of a game and rarely the right answer to the position in front of you.
How much does holding at 20 actually cost?
About four percentage points. Played head to head against the exact policy over hundreds of thousands of games, and averaged across both sides to remove the first-player advantage, hold-at-20 wins roughly 46%.
When should I keep rolling past 20?
When holding a normal turn loses anyway. At 40 points against an opponent on 80, the optimal threshold is sixty — you have to chase, and stopping at twenty just hands them the game a turn later. Chasing in Pig is not tilt, it is the correct policy.
When should I hold well before 20?
Near the end. At 95 points the threshold is five, because five is all you need — you should never roll past a win. That is the one case a fixed threshold always gets wrong.
Does the first player have an advantage in Pig?
Yes, and a real one. Under optimal play from nothing, the player who moves first wins 53.06% of the time. Pig is not a fair game, which is worth knowing before agreeing to a single deciding round.
Why is the optimal strategy so jagged?
Because the right play steps at the boundaries where the opponent can or cannot finish next turn. 76 of the 100 rows in the policy contain a local dip. It looks like noise in the table and it is not — smoothing it out would make the play worse.
How good is the computer opponent?
It plays from a table sampled every five points — 400 entries, about a kilobyte — which scores around 49% against the exact 10,000-entry policy. A table one twenty-fifth of the size gives away one point, where the rule everybody is taught gives away four.
Does this send anything anywhere?
No. Everything runs in your browser and nothing is stored or uploaded.
🔒 This tool runs entirely in your browser. Nothing you enter is uploaded, logged, or stored.