Run-count precision
Standard error falls approximately with the square root of runs. Four times as many runs roughly halves Monte Carlo error, subject to the draw cap.
Probability
Run a reproducible seeded Monte Carlo model of independent defect counts and compare simulated rejection risk with the exact binomial benchmark.
SEEDED DEFECT-COUNT EXPERIMENT
The page generates a reproducible sequence of independent unit outcomes, builds a defect-count histogram, and separates simulation uncertainty from the assumed process rate.
LIVE DECISION RECORD
Observed run count, simulated share, exact binomial mass, and simulation-minus-exact difference for every material count.
| Defects | Simulated lots | Simulated mass | Exact mass | Difference |
|---|
CURRENT CALCULATION PROCESS
X_j = sum Bernoulli(p); qHat = count(X_j >= r)/R; SE(qHat) = sqrt(qHat(1-qHat)/R)
| Symbol | Meaning and unit | Current value |
|---|---|---|
| n | Units per simulated lot | 50 |
| p | Assumed defect rate, percent | 4 |
| R | Simulation runs | 10000 |
| r | Rejection defect count | 5 |
| seed | Pseudo-random initial state | 20260804 |
Waiting for valid inputs.
FIVE-STEP SIMULATION
FIVE SIMULATION FUNDAMENTALS
DEFAULT SUBSTITUTION
The seeded engine makes 500,000 unit draws. It reports `qHat` from the simulated rejection count, compares it with the exact upper tail, and gives `sqrt(qHat(1-qHat)/10000)` as the simulation-only standard error.
THREE DEEPER MODULES
Standard error falls approximately with the square root of runs. Four times as many runs roughly halves Monte Carlo error, subject to the draw cap.
A zero simulated count does not prove zero exact risk. When the event is rare relative to R, the exact comparator is essential.
Changing seeds should move results within ordinary simulation error. Large systematic differences suggest too few runs or a problem in scenario framing.
TWO SIMULATION CASES
A production lead uses the histogram to explain why identical-rate lots can produce different observed counts, then uses the exact tail for the policy estimate.
At p=0, every simulated lot has zero defects. A positive rejection threshold has zero simulated and exact risk; a threshold of zero rejects every lot by definition.
SIMULATION GLOSSARY
LIMITS AND EVIDENCE
Retain: inputs, seed, code/version date, run count, exact comparator, histogram, sampling basis for p, and threshold authority.
RELIABLE SOURCES
DEFECT SIMULATION FAQ
The seed makes the pseudo-random sequence reproducible so another reviewer can rerun the same scenario and obtain the same histogram.
A finite number of runs introduces random estimation noise. The reported tail standard error quantifies that noise for the simulated rejection fraction.
This scenario has a known binomial benchmark. Comparing simulation with exact probability distinguishes sampling noise from a coding or interpretation problem.
Not on this page. Every unit uses one stable probability. Drift, clustering, and batch-to-batch random effects require a different simulation design.
The live page executes one Bernoulli draw per unit per run. The cap keeps keyboard interaction and mobile recalculation responsive.
No. More runs reduce Monte Carlo noise around the assumed model; they cannot make an unsupported input probability representative.
IMPORTANT SIMULATION NOTE
A precise simulation of an unrepresentative defect rate is still unrepresentative. Validate the model inputs before increasing run count.