PlayNook

Dice Game · Dice Game

Play Pig Dice Game Online — Free and Solved

Roll one die and keep adding. Roll a 1 and the whole turn is gone. Stop whenever you like — and knowing when is the entire game.

Roll one die and keep adding. Roll a 1 and the whole turn is gone. Stop whenever you like — and knowing when is the entire game.

  • 53.06 % — how often the first player wins, both sides perfect
  • 21 the right stopping point at level scores, not 20
  • 49 the right stopping point eighty points behind
  • 4 points is all that perfect play is worth over the folk rule

How do you play Pig?

  1. Roll one die and add it to your turn total. Keep rolling as long as you like.
  2. Roll a 1 and you lose everything from this turn, and the die passes over.
  3. Stop whenever you want and your turn total goes on your score.
  4. First to 100 wins.

That is the complete rulebook. One die, no board, and a decision on every single roll: the pot grows, and so does the chance of losing it.

When should you stop rolling?

A position is your score, their score, and the points riding on this turn — about a million of them, which is small enough to evaluate every one exactly rather than argue about it.

Grid of the optimal stopping point in Pig for every combination of scores from 0 to 80. At level scores it sits around 21. Along the right-hand side, where the opponent is far ahead, it rises to 39, 44 and 49. Along the bottom left, where you are ahead, it drops to 10 to 16.
Read down for your score, across for theirs. The diagonal is the game people think they are playing.

At level scores the answer is 21. So the folk rule is close enough that nobody should feel foolish for using it.

The game will simply tell you, if you want it to. Switch on Show the solved answer and every turn comes with the right call for that exact score.

What is thinking worth at Pig?

Bar chart of what skill is worth at Pig over 200,000 games each. Perfect play beats stopping at 20 in 54.2 per cent of games, stopping at 20 beats stopping at 15 in 55.6 per cent, and perfect play beats stopping at 15 in 58.9 per cent.
Fifty per cent is a coin toss. Nothing here gets far from it.

Four percentage points. Playing the exact solution against someone who always stops at 20 wins 54 games in 100. Against a nervous player who stops at 15 it is 59.

That is the honest ceiling, and it is worth stating plainly: Pig is a game you can play perfectly and still lose, often. The die has the rest — which is exactly why it survives as a family game while stronger games of skill do not.

Who has the advantage — first or second?

The first player, 53.06 %, with both sides playing perfectly. It is not nothing: over a long evening it is worth about one game in twenty.

That number is also how we know the arithmetic here is right. It matches the published solution of Pig exactly, and a computation that lands on somebody else's answer to two decimal places is a computation you can trust.

How strong is the computer?

LevelHow it playsAgainst the next one down
Easystops at 15
Mediumstops at 20, the table rule55.6 %
Hardthe exact stopping point for every score54.2 %

The hard level is not better because it stops one point later. It is better because it stops at a different point depending on the score — pushing when behind, banking early when ahead. A fixed number cannot do that, and that single difference is the whole four points.

Where does "stop at 20" come from?

It is not folklore. It is the exactly correct answer — to a different question.

Ask "which fixed stopping point banks the most points per turn?" and the answer is 20, worth 8.14 points a turn. Stop at 15 and you average 7.85; stop at 25 and you average 8.00. Twenty is the peak, and it is a real peak: the rule is arithmetic, not superstition.

Stop at151820222530
Points a turn7.858.098.148.138.007.58

But points per turn is not what you are trying to win. You are trying to reach 100 before somebody else does, and those two goals only agree while the scores are level and the finish is far away. As soon as one player is close to home, collecting points efficiently stops being the point — the question becomes whether you can get there first, and the answer to that changes every turn.

That is the whole gap between the folk rule and the solved one, and it is why the map above is not flat.

Where does Pig come from?

Nobody knows, which is normal for a folk dice game: it needs one die and no equipment, so it has almost certainly been played in some form for as long as dice have existed. It appears in print in twentieth-century collections of family games, usually with the same rules and occasionally under a different name.

What is documented is its second life. Pig became the standard worked example for teaching expected value and dynamic programming, and the complete solution was published in that context — which is why a children's dice game has a peer-reviewed optimal strategy at all.

Why is Pig in every programming course?

Because the rules fit in four lines and the interesting question does not.

A first-year student can write the game in an afternoon. Working out when to stop needs expected value, then a recursion over a million states that refers to itself, then the realisation that the answer depends on the opponent's score as well as your own. It is the shortest path from a toy to a real problem, and that is why it turns up in lectures far more often than it turns up on kitchen tables.

More dice here

Farkle asks the same question with six dice and a scoring table, Shut the Box asks a different one, and dice games for two players compares seven of them by how much skill is actually in each. If you want to keep score for a table with real dice, the dice score sheet is here too.

Frequently asked questions

+ How do you play Pig?

Roll one die and add it to your turn total. Keep rolling as long as you like. Roll a 1 and you lose everything from this turn and hand the die over. Stop whenever you want and the turn total is added to your score. First to 100 wins. That is the whole rulebook.

+ When should you stop rolling in Pig?

At level scores, 21 — near enough the 'stop at 20' everybody says. But the right answer moves with the score, and that is the part nobody knows: eighty points behind you should push to 49, and with a solid lead you should stop as early as 11. Switch on 'Show the solved answer' and the game tells you, from the complete solution.

+ Is stopping at 20 a good rule?

It is a good approximation and a poor rule. Across all ten thousand score combinations it is exactly right in 5.6 % of them — too low in 55.5 % and too high in 39.0 %. It is close enough at level scores that nobody at a kitchen table is losing sleep, and badly wrong the moment somebody is well ahead or well behind.

+ How much is skill worth at Pig?

About four percentage points. Playing the exact solution against a player who always stops at 20 wins 54.2 % of games. Against someone who stops at 15 it is 58.9 %. That is the honest ceiling — the die has the rest, which is why the game stays worth playing.

+ Who wins Pig with perfect play?

The first player, 53.06 % of the time, with both sides playing perfectly. That figure comes out of the complete solution of all million positions and matches the published result exactly, which is a useful independent check on the arithmetic.

+ How do the three computer levels differ?

Easy stops at 15 — cautious in a way that feels safe and loses slowly, because it banks before the pot is worth having. Medium stops at 20, the rule everybody repeats. Hard holds the exact stopping point for every score and changes it as the game moves, which is the thing a fixed rule cannot do. Over 200,000 games hard beats medium 54.2 % and easy 58.9 %.

+ Why is Pig used to teach programming?

Because the rules fit in four lines and the interesting question does not. A first-year student can write the game in an afternoon; working out when to stop needs the whole apparatus of expected value and dynamic programming. It is the shortest path from a toy to a real problem, which is why it turns up in courses everywhere.

+ Can I play Pig with a friend online?

Yes. Choose 'With a friend online', press Open a table and send the four-letter code. No account and no sign-up. The server throws the die rather than either browser, so you both see exactly the same roll, and there is a chat window.

+ Is it free?

Yes, free and with no sign-up. Nothing is saved; close the tab and start fresh.

More games like this

Farkle — screenshot of the browser gameDice Game
Dice Game2 Players

Farkle

Six dice, and one question asked over and over: bank what you have, or roll the rest and risk the lot. Roll nothing that scores and the whole turn is gone.

  • Play a friend over the internet — a four-letter code, no sign-up
  • The bank-or-roll decision solved exactly, and the answer is not 300
  • Three computer levels; the strongest holds the whole value table
Play Farkle
Shut the Box — screenshot of the browser gameDice Game
Dice Game2 Players

Shut the Box

Roll two dice, close any open numbers adding up to the total, and keep going until nothing covers your roll. What is left standing is your score, and low wins.

  • Nine, ten or twelve numbers — the count changes the game completely
  • Every position solved exactly, so the odds on this page are computed, not guessed
  • Play a friend over the internet — a four-letter code, no sign-up
Play Shut the Box
Yatzy — screenshot of the browser gameDice Game
Dice Game2 Players

Yatzy

Five dice, three rolls a turn, fifteen categories to fill. Two extra rows Yahtzee doesn't have, and several categories that score differently even where the names match.

  • The real Scandinavian scorecard — fifteen categories, not Yahtzee's thirteen
  • One Pair, Two Pairs, and a Full House that scores nothing for five of a kind
  • Against the computer, a friend online, or two players on one device
Play Yatzy
Nim — screenshot of the browser gameMath & Logic
Binary1-2 Players

Nim

Take as many marks as you like from one row. Whoever takes the last one wins — or loses, if you agree that first. One line of binary decides every position, and the table on this page shows it live.

  • Play a friend online with a table code, or the computer
  • The nim-sum table runs live beside the board
  • Normal and misère rules, with the ending that catches everyone
Play Nim