How this calculator works
This tool lets you simulate many coin flips or dice rolls and then shows the counts and
relative frequencies for each outcome. It is meant to give an intuitive feeling for how
experimental results compare with the “ideal” probabilities.
Inputs you control
-
Simulation type – choose between:
- Coin flips – outcomes are Heads (H) and Tails (T).
- Dice rolls – outcomes are the faces 1 to 6 of a fair die.
-
Number of trials – how many flips or rolls to simulate (for example 10, 50, or 200).
Larger numbers produce smoother frequency estimates but take longer and are harder to read in detail.
-
Show animation – when checked, the last flip or roll is shown with a short
animation:
- for the coin: a small spin before it lands on Heads or Tails;
- for the die: a quick “shake” before showing the final face.
The animation is just a visual aid; the actual random result is determined by the simulation, not by the animation itself.
What happens when you click “Calculate”
-
The calculator checks that the number of trials is a positive whole number and not too large
(to keep the simulation responsive).
-
It runs the chosen experiment:
- for a coin, it generates Heads or Tails for each trial;
- for a die, it generates one of the faces 1–6 for each trial.
Internally, it uses a random number generator to pick each outcome.
-
It counts how many times each outcome appears and divides by the total number of trials to get
the relative frequency (count ÷ total).
-
It shows:
- a short summary (how many trials, what the last outcome was);
- a table with counts and relative frequencies for each possible result;
- a quick comparison with the “ideal” probabilities (½ and ½ for the coin,
1⁄6 for each face of the die).
-
If animation is enabled, the last flip or roll is visualized: the coin spins once and
then shows H or T, or the die “rolls” and then shows one of the faces.
You can run the simulation multiple times with the same settings to see how the results
vary from trial to trial, or increase the number of trials to watch how the relative
frequencies move closer to the expected values. Use Reset to clear the form,
and Fill example to quickly set up a sample experiment.