Probability Basics

Simulating Chance at Home With Coins and Spreadsheets

A hands-on guide to simple chance simulations with coins, dice and spreadsheet formulas, so you can see averages and swings for yourself.

On this page
  1. Why simulate
  2. Experiment 1: real coins
  3. Experiment 2: coin flips in a spreadsheet
  4. Experiment 3: a die
  5. Experiment 4: a hypothetical wager
  6. What to look for
  7. Limits of home simulations
  8. Using simulations to teach others
  9. Quick checklist

Why simulate

Reading about probability is one thing; watching it happen is another. A simulation lets you repeat a chance process hundreds or thousands of times in a few seconds, so you can see the averages and the swings that formulas describe.

A caution before starting: slots are games of chance with a built-in house edge, and a simulation cannot reveal a way to beat them. Most players lose money over time, and nobody should gamble money they cannot afford to lose. Simulations help you understand chance, and they are best used for exactly that.

Experiment 1: real coins

Start with something physical. Flip a coin 20 times and write down each result, then calculate the share of heads.

  • You will probably not get exactly 10 heads. Getting somewhere from 7 to 13 would be unsurprising.
  • Repeat the 20-flip set three or four times. Each set will usually give a different share.

Even this tiny experiment shows how small samples vary. If you have no coin, use a die and record whether each roll is a 6.

Experiment 2: coin flips in a spreadsheet

Most spreadsheet programs, including common free ones, have a function that returns a random whole number. In many of them it is called RANDBETWEEN.

  1. In cell A1 type =RANDBETWEEN(0,1). Treat 1 as heads and 0 as tails.
  2. Copy the formula down to row 100.
  3. In B1 type =AVERAGE($A$1:A1) and copy it down to row 100. Each cell is the running share of heads so far.
  4. Make a line chart of column B.

The chart will bounce early on and then flatten toward 0.5. After 100 flips it will probably be within a few points of 0.5 but not exactly there. Recalculate the sheet (often there is a recalculate shortcut, or any edit will do it) and you will see a new chart each time.

To go further, extend to 1,000 rows. The line will usually hug 0.5 more tightly. This is the law of large numbers in action: the share settles as the number of trials grows, even though no single flip is affected by the previous one.

Experiment 3: a die

Use =RANDBETWEEN(1,6) for a die. To count sixes, use =IF(RANDBETWEEN(1,6)=6,1,0) and take the running average as above. Over many rows it should drift toward 1/6, about 0.167, with plenty of noise early on.

Experiment 4: a hypothetical wager

Now model a made-up game in the same way as the expected value example. You pay $1 per round. A die is rolled; on a 6 you win $4 profit, otherwise you lose the $1.

  1. In A1, type =IF(RANDBETWEEN(1,6)=6,4,-1) and copy it down 1,000 rows.
  2. In B1, type =SUM($A$1:A1) and copy down. This is your running net result.
  3. At the bottom, compute =AVERAGE(A1:A1000).

The calculated expected value is -1/6, about -$0.17 per round, so over 1,000 rounds the total tends to land somewhere near -$167. Individual runs will differ, and some will end well above or below that. Recalculate several times and note the range of final totals. The chart of the running total will show stretches where the line climbs, even though the long-run direction is downward.

That picture is a useful lesson. A negative expected value does not mean every stretch is a loss; it means the average drifts down. Short winning periods are normal, which is why short-term experience is a poor guide to true odds.

What to look for

  • Early noise: the first dozens of trials swing the most.
  • Settling: the running average narrows around the true value as trials accumulate.
  • Spread between runs: if you repeat the whole simulation, the ending numbers vary. Measuring that variation is the job of standard deviation.
  • Streaks: scan the raw column for runs of the same result. You will find them more often than you would expect, which relates to the clustering illusion.

A fun extension: change the wager so it pays a rare big win and a frequent small loss, then compare how bumpy the running total is. The bumpiness corresponds to what slot volatility describes in real games, though your toy example is far simpler.

Limits of home simulations

  • Spreadsheet random numbers are generated by a program, so they are pseudorandom. That is fine for learning, and it is the same general approach computers use everywhere; see the notes on how computer randomness works.
  • A simulation shows what a model does. It is only as good as the rules you gave it. The simple wager above is not a model of any real slot game, whose payouts and probabilities are far more complex.
  • Seeing a simulation win does not mean a real game can be won. If you run a simulation and a lucky run ends positive, that is exactly the kind of fluke short runs produce.
  • Do not use simulations to try to build a “system.” Because every trial is independent, no rule about when to start or stop alters the expected value of future bets.

Using simulations to teach others

Simulations work well for explaining chance to teens and adults alike, because people trust results they generated themselves. If you are helping a young person understand gambling risks, running a die game and charting the running total can make the idea of an unfair wager concrete without any money involved. Resources on teaching probability to children cover related approaches.

Quick checklist

  1. Start with a physical coin to get a feel for variation.
  2. Build the coin and die sheets and watch the running average settle.
  3. Model a hypothetical wager and compare the result with the calculated expected value.
  4. Repeat several times and look at how different the endings are.

If you find yourself thinking about real gambling as a way to recover money, pause. Set limits before you play, treat it as entertainment you pay for, and consider contacting a national problem-gambling helpline or local health service if gambling is becoming a worry.

The complete guide to probability basics

Probability Basics: How to Think About Chance
Read the guide

Keep exploring

Guides from other topics

All topics →