Greedy Pig VS
How this works
- Add 1–6 players. Each slot is a human (you choose a name and press a key to decide each roll) or a bot with a fixed personality.
- Each human's number key toggles their stance between STAND (in the game, at risk) and SIT (safe, score locked).
- Press SPACE or click ROLL to roll for everybody.
- Highest score after 15 rolls wins.
Greedy Pig
The goal
Have the highest score after 15 rolls of one die.
Each roll
- Before each roll, every player is either STANDING or SITTING.
- Standing means you are in the game and at risk. Sitting means your score is safe.
- If the die shows 2, 3, 4, 5, or 6: every standing player adds that number to their score. Sitting players do not change.
- If the die shows 1: every standing player's score resets to ZERO. Sitting players are safe.
- Between any two rolls you may change your mind: stand up to chase more points, or sit down to lock in what you have.
Winning
After the 15th roll, the highest score wins. Ties are possible.
The bots in this version
Mathematician
Plays the expected-value-optimal strategy: stands until score reaches 20, then sits. This is the strategy the math view derives.
Cautious
Sits as soon as score reaches 12. Rarely busts, but usually leaves points on the table.
Daredevil
Pushes on until score reaches 28 before sitting. Often busts. Occasionally wins big.
Coin-flip
Flips a fresh coin every roll: 50% chance to stand, 50% to sit. A control case showing what "no strategy" looks like.
The Math Behind Greedy Pig
What happens on one roll?
Imagine you are standing, and your score right now is S. The die is about to be rolled. Two things can happen:
The expected value of one more roll
Expected value means: if you made this exact decision many, many times, what would happen on average?
The expected value of standing for one more roll is (20 − S) divided by 6. Whether that is a good idea depends entirely on your score S.
The magic number: 20
If your score is below 20, the expected value is positive. On average, standing for one more roll pays off. If your score is above 20, the expected value is negative. At exactly 20, it is a perfect break-even.
So the math gives a clear guideline: climb to about 20, then sit and stay seated. That is exactly what the Mathematician bot does.
How risky is it to keep standing?
| Rolls standing in a row | Chance of surviving them all |
|---|---|
| 1 | 83% |
| 2 | 69% |
| 3 | 58% |
| 4 | 48% |
| 5 | 40% |
Across all 15 rolls of a game, expect roughly 2 or 3 ones to come up.
The twist: when a bad bet is the smart play
Expected value tells you the best move on average. But you are not trying to score well on average, you are trying to win. If it is the final few rolls and you are in last place, sitting guarantees you lose. So you have to stand, even past 20. The bots in this version do not know that — if you can read the scoreboard near the end, you can outplay even the Mathematician.