Each unstable nucleus has a random decay time. A population of many independent nuclei, however, has a predictable average survival curve. A good simulation shows both facts at once: one run is repeatable when seeded, while its count can differ from the analytic expectation because randomness is part of the model.
For equal time steps with decay probability p, the expected number of survivors after n steps is
This is an expectation, not a promise for one small run. If p is derived from a half-life and time interval, document that conversion and use a step small enough for the discrete model to be a useful approximation.
Change the ensemble size, per-step decay chance, and number of steps. The same seed always reproduces the same individual decay run.
After 8 steps, 27 of 64 nuclei remain. The ensemble expectation is 23.0.
const survivors = simulateDecay({ initialCount: 64, decayProbability: 0.12, steps: 8, seed: 42 });
expect(survivors.every((count, i) => i === 0 || count <= survivors[i - 1])).toBe(true);
The test checks an invariant of the chosen simulation: once a nucleus decays, the model never marks it alive again. It does not claim that every real decay process has a single constant probability per coarse time step.
Prediction: A larger ensemble usually tracks the analytic expectation more closely in relative terms than a smaller ensemble.
Run the same decay chance and steps with 16 and 160 initial nuclei. Predict which run has the smaller fractional difference from its expectation, then compare the displayed counts. Repeat with a different seed.Seeded decay runs make individual randomness inspectable and repeatable. Compare them with an exponential expectation, test monotonic survival, and state exactly which statistical and physical effects are omitted.
Treat the lesson as a small function before treating it as a fact to memorize. Give every value a unit, keep only the state needed for the next step, and make the output easy to inspect.
\[\text{observable output} = f(\text{inputs},\,\text{state})\]For Radioactive Decay Simulation, write down the quantities you can control, the values your program must retain, and the result a reader could inspect. In Nuclear and Particle Physics, the useful program is not the drawing: it is the smallest explicit model that makes a prediction you can test.
Prediction: changing one declared input while holding the others fixed should change only the outputs that the model connects to that input. Choose one input, predict the direction of change, then check a limiting case such as zero, a symmetric arrangement, or a familiar low-speed or small-change approximation.
This lesson is a teaching model, not a complete simulator. Before using it outside the stated question, check which interactions, scales, uncertainties, boundary conditions, and measurement limits it leaves out.
Treat Radioactive Decay Simulation as a contract: named inputs and units enter a rule, the rule produces an observable result, and a known limit or invariant checks whether the implementation deserves trust.
Run reproducible stochastic decay ensembles and compare survival data with exponential expectation.