Unit 11, lesson 73

Choosing Exact, Approximate or Simulated Answers

How to choose between an exact model probability, an approximation and a simulation, and how to report what approximation error, simulation error and uncertain model inputs each mean.

  • Video 73
  • Exact, Approximate and Simulated Answers

Twelve independent trials each succeed with probability 0.250.25. What is the probability of at least four successes? A binomial sum answers the question exactly, a normal curve answers it approximately and a simulation estimates it, and the three numbers differ. This lesson compares the three methods on one fixed model and event, explains what each kind of error means, and shows which answer to report and how to describe it.

Key terms

Exact model probability

Definition The exact model probability of an event is the value that the stated model assigns to it, written as an expression that follows from the model’s assumptions without approximation. A decimal shown for it is often rounded, with an error of at most half a unit in the last digit shown. Exactness refers to the model only. It does not show that the model describes the real process.

In plain words Within a model there is one correct number for each event, and an exact expression is that number. Whether the model’s assumptions, such as independent trials with a common success probability, hold for real trials is a separate question that no calculation inside the model can settle.

Example Let X∼Bin⁡(12,0.25)X \sim \operatorname{Bin}(12, 0.25) and p∗=P(X≥4)p_* = P(X \ge 4), where p∗p_* is the target probability and 0.250.25 is the success probability of each trial. The complement needs only the four masses

pX(k)=(12k)312−k412p_X(k) = \binom{12}{k} \frac{3^{12 - k}}{4^{12}}

for k=0,1,2,3k = 0, 1, 2, 3, and

p∗=1−∑k=03pX(k)=589251716777216≈0.351221.\begin{aligned} p_* &= 1 - \sum_{k=0}^{3} p_X(k) \\[0.4em] &= \frac{5892517}{16777216} \\[0.4em] &\approx 0.351221. \end{aligned}

Approximation error

Definition An approximation replaces the model’s distribution, or a step of the calculation, by something simpler, for example a normal law with the same mean and variance. If it gives the value aa for an event whose exact model probability is p∗p_*, its approximation error is a−p∗a - p_*. For a given model, event and method this error is one fixed number, not a random quantity. Its size depends on the parameters and on the event, and the limit theorem behind a method does not give its size at a fixed nn.

In plain words An approximation answers a nearby question about a simpler distribution. Repeating it gives the same number with the same error. Its size becomes known through a comparison with an exact value, and a theorem with an explicit error bound can limit it without giving it exactly.

Example For Bin⁡(12,0.25)\operatorname{Bin}(12, 0.25) the mean is 33, the variance is 12⋅0.25⋅0.75=2.2512 \cdot 0.25 \cdot 0.75 = 2.25 and the standard deviation is 1.51.5. With the continuity correction, X≥4X \ge 4 becomes Y>3.5Y > 3.5 for Y∼N(3,2.25)Y \sim N(3, 2.25), and (3.5−3)/1.5=13(3.5 - 3)/1.5 = \tfrac13, so

a=P(Y>3.5)=1−Φ(13)≈0.369441.\begin{aligned} a &= P(Y > 3.5) \\[0.4em] &= 1 - \Phi\bigl(\tfrac13\bigr) \\[0.4em] &\approx 0.369441. \end{aligned}

The approximation error is a−p∗≈0.018220a - p_* \approx 0.018220, about 1.821.82 percentage points or 5.25.2 percent of p∗p_*. The binomial law here is skewed to the right, with its mean 33 only two standard deviations above the smallest count 00, and a symmetric normal curve does not follow it closely.

Simulation error

Definition Let p^\hat{p} be the fraction of nn independent simulated replications in which the event occurs. Its simulation error is p^−p∗\hat{p} - p_*. This error is random. Across repeated runs it has mean 00 and standard deviation equal to the Monte Carlo standard error

SE⁡(p^)=p∗(1−p∗)n.\operatorname{SE}(\hat{p}) = \sqrt{\frac{p_*(1 - p_*)}{n}}.

The standard error describes the spread over possible runs. It does not give the error of the run actually performed.

In plain words A new seed generally gives a different estimate, and the standard error says how far a typical estimate falls from the model probability. More replications shrink this spread in proportion to 1/n1/\sqrt{n}, but when 0<p∗<10 < p_* < 1 no finite run removes it, and more replications do nothing about errors in the model itself.

Example One batch is twelve pseudorandom uniform numbers, each number below 0.250.25 counts as a success, and the batch is scored 11 when it has at least four successes. A recorded run of 20,00020{,}000 batches with Python’s random.Random generator and seed 8801288012 scored 70717071 batches, so p^=7071/20000=0.35355\hat{p} = 7071/20000 = 0.35355. The standard error is

p∗(1−p∗)20000≈0.003375,\sqrt{\frac{p_*(1 - p_*)}{20000}} \approx 0.003375,

and the error of this run, p^−p∗≈0.002329\hat{p} - p_* \approx 0.002329, is about 0.690.69 standard errors.

Uncertain model inputs

Definition A model input such as a success probability, a rate or a number of trials is often known only approximately. Changing an input can change the exact model probability itself, so input uncertainty is a different kind of error from approximation error and simulation error. One way to show its effect is to compute the target over the range of plausible input values.

In plain words A calculation is exact only for the inputs it was given. If the success probability is uncertain, no amount of simulation at one value of it can tell which value is right, since every run answers a question about the input that was used.

Example Suppose the success probability of each trial is known only to lie between 0.20.2 and 0.30.3. The probability of at least four successes in twelve independent trials increases with the success probability, from about 0.2054310.205431 at 0.20.2 to about 0.5074840.507484 at 0.30.3, with 0.3512210.351221 at 0.250.25. That spread of about 0.300.30 is far larger than the approximation error 0.0180.018 and the simulation standard error 0.00340.0034.

Error interpretation

Definition Error interpretation means stating, for each reported number, which kind of error it carries and what the error statement means. Rounding error is at most half a unit in the last digit shown. Approximation error is a fixed amount for the given model and event, known when it has been checked against an exact value and limited when an error bound applies. Simulation error is random, and its standard error describes its spread over repeated runs. Model error, including uncertain inputs, lies outside all three and is addressed by examining the assumptions and inputs, not by a more precise calculation with the same inputs.

In plain words A useful report names the model, its parameters, the event, the method and the meaning of its error. For a simulation it also gives the number of independent replications, the number of occurrences, and the generator and seed. Answers from different methods are not averaged together. Each carries its own kind of error, and an average of them would carry a mixture that none of the error statements describes.

Example For P(X≥4)P(X \ge 4) with X∼Bin⁡(12,0.25)X \sim \operatorname{Bin}(12, 0.25), a clear report reads as follows. The exact model probability is 5892517/16777216≈0.3512215892517/16777216 \approx 0.351221, rounded to six decimals. The corrected normal approximation 0.3694410.369441 is 0.0182200.018220 too high, a fixed error for this event. A recorded simulation of 20,00020{,}000 independent batches with Python’s random.Random generator and seed 8801288012 had 70717071 occurrences, an estimate of 0.353550.35355 with standard error about 0.0033750.003375. All three numbers assume independent trials with success probability 0.250.25. Since the exact value is cheap here, it is the answer to report, and the other two serve as checks.

Check yourself

  1. Let X∼Bin⁡(5,0.5)X \sim \operatorname{Bin}(5, 0.5). Choose a method for P(X≥1)P(X \ge 1) and find the probability.
Show the answer

The complement gives an exact answer at once. No successes has probability 0.55=1320.5^5 = \tfrac{1}{32}, so

P(X≥1)=1−132=3132=0.96875.\begin{aligned} P(X \ge 1) &= 1 - \frac{1}{32} \\[0.4em] &= \frac{31}{32} = 0.96875. \end{aligned}

A corrected normal approximation with Y∼N(2.5,1.25)Y \sim N(2.5, 1.25) would give P(Y>0.5)≈0.963181P(Y > 0.5) \approx 0.963181, adding an avoidable error of about 0.0055690.005569, and a simulation would give only a random estimate of the same number.

  1. Someone simulates 100100 independent batches of five trials, each trial a success with probability 0.50.5, sees at least one success in every batch and concludes that P(X≥1)=1P(X \ge 1) = 1. How likely is such a run, and what can a simulation add here?
Show the answer

Each batch has at least one success with probability 3132\tfrac{31}{32}, and the batches are independent, so all 100100 batches do with probability

(3132)100≈0.0418,\Bigl(\frac{31}{32}\Bigr)^{100} \approx 0.0418,

about one run in 2424. The observed fraction 100/100100/100 is a relative frequency in a finite simulation, and the model probability is still 3132\tfrac{31}{32}. With 100100 batches the standard error is about (31/32)(1/32)/100≈0.0174\sqrt{(31/32)(1/32)/100} \approx 0.0174, and the observed fraction exceeds 3132\tfrac{31}{32} by 132≈0.031\tfrac{1}{32} \approx 0.031, about 1.81.8 standard errors. Such a run is uncommon, but it is no reason to change the exact model answer. A simulation can check a program against the exact value 3132\tfrac{31}{32} or show how frequencies vary between runs, but it cannot improve an exact answer.

  1. For P(X≥4)P(X \ge 4) with X∼Bin⁡(12,0.25)X \sim \operatorname{Bin}(12, 0.25), would a second simulation of 20,00020{,}000 batches with a different seed have the same error as the recorded run? Would the error of the normal approximation change? What standard error would 80,00080{,}000 batches have?
Show the answer

A run with a different seed generally gives a different estimate, and so an error other than 0.0023290.002329. Its error is random, with mean 00 and standard deviation about 0.0033750.003375. The normal approximation involves no randomness, so its error stays 0.0182200.018220 every time it is computed. Four times as many batches halve the standard error, so 80,00080{,}000 batches give about 0.003375/2≈0.0016880.003375/2 \approx 0.001688. Neither more batches nor a better approximation would change the target itself, which depends on the inputs 1212 and 0.250.25.

How this lesson connects