Tutorials › Introduction to Statistics › Estimating Probabilities With Monte Carlo Proportions

Simulation and Probability Models · Tutorial 380 of 996

Estimating Probabilities With Monte Carlo Proportions

Use simulated trials to estimate an event’s probability, calculate the Monte Carlo proportion, and explain what that proportion says about the chance model.

Beginner 9 min read

What You'll Learn

  • Define a simulated trial so it matches the chance question.
  • Estimate an event probability as its count divided by the number of simulated trials.
  • Use an indicator variable to explain why the Monte Carlo proportion targets the model probability.
  • Interpret simulated proportions in context without treating them as exact probabilities.
  • Identify model and coding choices that can make a simulation estimate misleading.

From Simulated Outcomes to a Probability Estimate

A probability model describes how chance outcomes behave, but a probability for a complicated event may not be easy to calculate directly. Simulation offers another route: repeat a chance experiment many times, record whether the event happens on each trial, and calculate the fraction of trials on which it occurs. This fraction is called a Monte Carlo proportion, and it serves as an estimate of the event probability in the model.

The key is to make each simulated trial a faithful version of the chance process in the question. If the question is about ten tosses of a fair coin, one trial must contain ten tosses, not one. The event must also be stated precisely before counting. Simulation does not repair a poorly defined trial or an incorrectly represented chance mechanism.

Definition: Suppose a specified probability model assigns probability \(p\) to an event \(A\). Run \(n\) simulated trials that follow this model, and let \(X\) be the number of simulated trials in which \(A\) occurs. The Monte Carlo estimate of \(p\) is the simulated proportion $$ \hat{p}=\frac{X}{n}. $$ It is the fraction of simulated trials with the event, expressed as a number between 0 and 1. Multiplying \(\hat{p}\) by 100% expresses the same estimate as a percentage.

The symbol \(p\) refers to the probability assigned by the target model; \(\hat{p}\) is the estimate calculated from one set of simulated trials. They are different quantities. The model probability is fixed when the model is specified, whereas the Monte Carlo proportion can vary from run to run because the simulated outcomes vary.

A simulation should have a clear event rule. For example, “at least seven heads in ten tosses” includes outcomes with exactly seven, eight, nine, or ten heads. A trial that produces six heads does not count as a success for this event, even though it contains many heads. The numerator \(X\) counts trials satisfying the whole event, not the number of individual outcomes within those trials.

Why the Proportion Estimates the Probability

The justification can be expressed using an indicator variable. For simulated trial \(i\), let \(I_i=1\) if event \(A\) occurs and \(I_i=0\) otherwise. Each \(I_i\) is a Bernoulli random variable: it takes the value 1 with probability \(p\) and 0 with probability \(1-p\). The count of event occurrences is the sum of these indicators, so the simulated proportion is their average.

$$ X=\sum_{i=1}^{n} I_i \qquad\text{and}\qquad \hat{p}=\frac{1}{n}\sum_{i=1}^{n} I_i $$

For one indicator, its expected value is found by multiplying each possible value by its probability. Therefore, \(E(I_i)=1\cdot p+0\cdot(1-p)=p\). By linearity of expected value, the expected value of the average of the indicators is also \(p\):

$$ E(\hat{p}) = E\left(\frac{1}{n}\sum_{i=1}^{n}I_i\right) = \frac{1}{n}\sum_{i=1}^{n}E(I_i) = \frac{1}{n}(np) = p $$

Thus, under the stated model, the Monte Carlo proportion is an unbiased estimator of the event probability: across repeated runs of the same simulation, its average equals \(p\). This does not mean that the result of any one finite run must equal \(p\). With more valid repeated trials, the proportion tends to settle near the model probability, but a particular run can still land above or below it.

The calculation relies on matching the simulation to the target model. In particular, simulated trials must be generated according to the stated chance process, the event must be coded correctly, and repeated trials should have the same probability model as the intended repetitions. When the target calls for independent repetitions, the simulation must preserve that independence. Otherwise, the resulting proportion may estimate the probability of the simulated process rather than the probability being asked about.

Estimating a Coin-Toss Probability

Worked Example: At Least Seven Heads in Ten Tosses

Suppose a fair coin is tossed ten times, and the event of interest is getting at least seven heads. A computer simulation repeats the ten-toss experiment 2,000 times. In a hypothetical run, 224 of the 2,000 simulated sequences have seven or more heads. Estimate the event probability.

Define one trial. One trial is a sequence of ten tosses of a fair coin. Within each sequence, tosses are generated independently, with heads and tails each having probability 0.5. This reproduces the chance process in the question.

Define the event. A sequence is counted if its total number of heads is 7, 8, 9, or 10. The simulation records one yes-or-no result for each complete sequence.

Calculate the proportion. Here \(X=224\) event occurrences and \(n=2{,}000\) simulated sequences:

$$ \hat{p}=\frac{X}{n} =\frac{224}{2{,}000} =0.112 $$

The Monte Carlo estimate is 0.112, or 11.2%. In context, about 11.2% of the simulated ten-toss sequences had at least seven heads. This result estimates the probability of that event for ten independent tosses of a fair coin; it is not a claim that exactly 11.2% of every possible collection of 2,000 sequences must qualify.

The numerical estimate comes from the hypothetical simulation count, not from a claim that the software produced a particular result in a real investigation. A different valid run could produce a different count and therefore a different proportion.

Estimating the Chance of Winning a Game

For a game, it is useful to define success from the player’s point of view before simulating. The Monte Carlo estimate then answers a direct question: what fraction of simulated plays result in a win? A single trial should represent one complete play, with all random outcomes needed to determine whether that play wins.

Worked Example: Winning With a Sum of Ten or More

Consider a hypothetical game in which a player rolls two fair, six-sided dice and wins if their sum is at least 10. A simulation represents each die roll with an equally likely result from 1 through 6, and the two rolls are generated independently. In 500 simulated plays, 83 are wins. Estimate the probability that one play is a win.

Check the trial and event. One trial consists of rolling both dice once and adding the results. A simulated play counts as a win if the sum is 10, 11, or 12. The simulation uses fair dice and independent rolls, as specified in the game model.

Calculate the estimate. There are \(X=83\) wins among \(n=500\) plays:

$$ \hat{p}=\frac{83}{500}=0.166 $$

The estimated win probability is 0.166, or 16.6%. In this run, 16.6% of simulated plays met the game’s winning rule. The result estimates a player’s chance of winning one play under the stated fair-dice model. It does not mean that a player who completes exactly 500 real plays is guaranteed to win 83 times.

The definition of a trial matters to the interpretation. If a program instead counted each individual die as a separate trial, it would not be estimating the chance that a complete play wins. The unit counted in the denominator must match the event whose probability is being estimated.

A Second Event and a Full Trial Count

Worked Example: At Least One Six in Four Rolls

A player rolls a fair six-sided die four times. The event \(A\) is getting at least one six during those four rolls. A hypothetical simulation runs 3,000 four-roll trials and records 1,518 trials with one or more sixes. Estimate the event probability.

Specify what is simulated. Each trial consists of four independent rolls of a fair die. The trial is marked as an event occurrence if any of the four results is 6; it is marked as a non-occurrence if all four results are among 1 through 5. The random outcomes and the event rule both match the question.

Calculate the proportion. The count is \(X=1{,}518\) out of \(n=3{,}000\) complete four-roll trials:

$$ \hat{p}=\frac{1{,}518}{3{,}000}=0.506 $$

The estimated probability is 0.506, or 50.6%. In context, 50.6% of the simulated four-roll trials contained at least one six. It would be incorrect to divide 1,518 by 12,000, the total number of individual rolls: the event was defined for a set of four rolls, so the relevant denominator is the number of four-roll trials.

What Makes a Monte Carlo Estimate Trustworthy?

The proportion is easy to compute, but its interpretation depends on a sound simulation design. Before running a simulation, state the target model, define one trial, specify the event, and decide how each random outcome will be generated. After the run, verify that the numerator counts event occurrences and the denominator counts complete trials.

A simulation may be large and still answer the wrong question if it has a model or coding error. For example, making the two dice have a shared result by mistake would not represent two independent fair rolls. Or a program might mark a sum of exactly 10 as a win while the rule says “at least 10,” which would omit winning outcomes of 11 and 12. Either error changes what probability is being estimated; merely repeating the flawed procedure cannot correct it.

Key takeaway: A Monte Carlo probability estimate is the number of simulated trials in which the event occurs divided by the total number of simulated trials. Its meaning depends on the trial matching the target chance process and the event being counted exactly as defined.

Common Mistakes

  • Using the wrong denominator. The denominator is the number of complete simulated trials, not the number of individual tosses, rolls, or random numbers used inside those trials.
  • Counting outcomes instead of event occurrences. For an event such as “at least seven heads,” count each qualifying sequence once, rather than adding up all heads across every sequence.
  • Calling the estimate the exact probability. The computed proportion is based on one simulation run. It estimates the model probability and may differ from it.
  • Ignoring the chance model. A proportion generated with biased coin outcomes does not estimate the probability for a fair coin. The random outcomes must follow the model named in the question.

Check Your Understanding

Answer each question using the distinction between a model probability and a simulated proportion.

  1. A simulation of 800 trials records 196 occurrences of event \(A\). What is the Monte Carlo estimate, as a proportion and as a percentage?
  2. For a question about the chance of at least one head in five coin tosses, what should count as one simulated trial?
  3. A game is won when the total from three rolls is at least 15. Explain why counting individual rolls as successes would not estimate the probability of winning one game.
  4. In your own words, distinguish \(p\) from \(\hat{p}\) in a Monte Carlo simulation.
  5. A program simulates independent fair-die rolls but mistakenly records a win only when the total is exactly 10, although the game rule says “at least 10.” What is wrong with the estimate’s interpretation?