Math & ModelingBeginnerExperiment simulation~12 min

Probability and Random Experiments

Flip a coin and you cannot know how it will land. Flip it ten thousand times and the results become remarkably predictable. Probability is the mathematics of that predictability. Run your own experiments — far faster than you could by hand — and see how chance behaves in the long run.

0 trials
Experiment
0.5

0.5 is a fair coin. Change it to make a biased (unfair) coin.

20
Trials
0
Tracked outcome
—
Experimental probability
—
Theoretical probability
—
Difference
—
Expected count
—

Running proportion of the tracked outcome

The fraction of trials that gave the tracked outcome, plotted against the number of trials, with the theoretical probability shown as a dashed line.

    How to use this simulator

    1. Choose an experiment: a coin, one die, or two dice.
    2. Press +1, +10, +100 or +1000 to run that many trials, or press Start to run continuously.
    3. The bars show how often each outcome happened; the dashed purple marks show the theoretical probability.
    4. Pick an outcome to track. The graph shows how its proportion changes as trials pile up.
    5. Make the coin biased and see whether you could detect it from 10 flips — or from 1,000. Reset clears all results.

    What is probability?

    Probability measures how likely an event is, on a scale from 0 (impossible) to 1 (certain). A probability of 0.5 means the event is expected half the time. When all outcomes are equally likely, the probability of an event is the number of favourable outcomes divided by the total number of outcomes.

    Theoretical vs. experimental probability

    • Theoretical probability is worked out by reasoning: a fair die has 6 equally likely faces, so P(6) = 1/6.
    • Experimental probability (or relative frequency) is measured: if you roll 600 times and get 94 sixes, the experimental probability is 94/600 ≈ 0.157.

    The two are rarely exactly equal, especially for small numbers of trials. The difference is not a mistake — it is natural random variation.

    The law of large numbers

    As the number of trials increases, the experimental probability tends to get closer and closer to the theoretical probability. In the graph, the line jumps around wildly at first and then settles near the dashed line. Note that the count can still drift away from the expected count — only the proportion becomes stable. Roughly speaking, quadrupling the number of trials halves the typical size of the random error in the proportion.

    Combining events: two dice

    Two dice have 6 × 6 = 36 equally likely combinations, but the sums are not equally likely. A sum of 7 can be made in six ways, while a sum of 2 can only be made as 1 + 1. That is why the bar chart for two dice forms a triangle peaking at 7. Because the two dice do not affect each other, they are independent, and the probability of a specific pair (such as a 3 then a 5) is 1/6 × 1/6 = 1/36.

    Formulas

    P(event) = favourable outcomes / total equally likely outcomesExperimental probability = number of times the event occurred / number of trialsExpected count = P(event) × number of trialsIndependent events: P(A and B) = P(A) × P(B)

    Key terms

    Trial
    One repetition of an experiment, such as one flip or one roll.
    Outcome and event
    An outcome is a single result; an event is a set of outcomes we are interested in (for example “rolling an even number”).
    Sample space
    The set of all possible outcomes.
    Independent events
    Events where one does not change the probability of the other.
    Biased
    Not fair — some outcomes are more likely than they should be.

    Real-world applications

    • Genetics: Punnett squares give the probability that offspring inherit a trait, such as a 1 in 4 chance for a recessive condition when both parents are carriers.
    • Medicine: clinical trials use large samples so that random variation does not hide or fake a treatment’s effect.
    • Weather forecasts: a “70% chance of rain” means that in similar conditions it rained about 70% of the time.
    • Insurance and engineering: companies use probabilities of rare events, such as floods or component failures, to plan and set prices.
    • Simulation: scientists run millions of random trials on computers (Monte Carlo methods) to study systems too complex to calculate directly.

    Common misconceptions

    • The gambler’s fallacy: “After five heads, tails is due.” Each flip is independent.
    • “Results should match theory exactly.” Small samples vary a lot; that variation is expected.
    • “All sums of two dice are equally likely.” Sums near 7 have more combinations.

    Key takeaways

    • Probability ranges from 0 to 1 and can be calculated or measured.
    • Experimental results vary, especially with few trials.
    • With many trials, experimental probability approaches the theoretical value.
    • Independent events have no memory: past results do not change future chances.

    Model note: the simulator uses your browser’s pseudo-random number generator, which is suitable for teaching but not for cryptography.

    Knowledge check

    Probability and Random Experiments: test your understanding

    Answer each question to get instant feedback and an explanation. Use the simulator to check your thinking.

    7 questions3 basic2 intermediate2 advanced

    0 of 7 answered

    1. Q1BasicWhat is the theoretical probability of rolling a 4 on a fair six-sided die?
      Show answer

      Answer: B. 1/6

      There are 6 equally likely outcomes and only one of them is a 4, so P(4) = 1/6 ≈ 0.167.

    2. Q2BasicYou flip a fair coin 10 times and get 7 heads. What does this tell you?
      Show answer

      Answer: B. Small samples often differ from the theoretical probability; 7 heads in 10 is not unusual

      With only 10 trials, results vary a lot. Getting 7 or more heads happens about 17% of the time with a fair coin. Run many more trials and the proportion settles close to 0.5.

    3. Q3BasicWhat does the law of large numbers say?
      Show answer

      Answer: B. As the number of trials grows, the experimental probability tends to get closer to the theoretical probability

      Over many trials, the running proportion settles toward the true probability — watch the graph flatten out near the dashed line. It does not mean outcomes “balance out” in the short run.

    4. Q4IntermediateA fair coin lands heads five times in a row. What is the probability that the next flip is heads?
      Show answer

      Answer: B. Exactly 1/2

      Each flip is independent: the coin has no memory. The probability is still 1/2. Believing tails is “due” is called the gambler’s fallacy.

    5. Q5IntermediateWhen rolling two dice, which sum is most likely?
      Show answer

      Answer: C. 7

      There are 6 ways to make 7 (1+6, 2+5, 3+4, 4+3, 5+2, 6+1) out of 36 equally likely combinations, so P(7) = 6/36 = 1/6. Sums of 2 and 12 each have only one way.

    6. Q6AdvancedWhat is the probability of a sum of 4 with two fair dice?
      Show answer

      Answer: A. 1/12

      The combinations are (1,3), (2,2) and (3,1): 3 out of 36, which simplifies to 1/12 ≈ 0.083.

    7. Q7AdvancedA coin is biased so that P(heads) = 0.7. In 1,000 flips, about how many heads would you expect?
      Show answer

      Answer: C. 700

      Expected count = probability × number of trials = 0.7 × 1,000 = 700. Actual results will vary a little around this value — typically within about ±30.

    References and further reading

    1. Illowsky, B., & Dean, S. (2022). Introductory Statistics 2e, Section 3.1: Terminology. OpenStax. openstax.org (opens in a new tab)
    2. Illowsky, B., & Dean, S. (2022). Introductory Statistics 2e, Section 3.2: Independent and Mutually Exclusive Events. OpenStax. openstax.org (opens in a new tab)
    3. Tversky, A., & Kahneman, D. (1971). Belief in the law of small numbers. Psychological Bulletin, 76(2), 105–110.

    This simulator is a simplified educational model. Found an error? Let us know. See our educational disclaimer.