A Byte of PhysicsLogo

Radioactive decay simulation

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.

Think like a programmer

Keep the random generator as an explicit input. Store alive/dead state or an equivalent survivor count, per-step decay probability, elapsed steps, and the seed. Test that nuclei never resurrect and that identical inputs reproduce the run exactly.

Model checklist

Inputs
Initial number of nuclei, decay probability per equal time step, step count, and random seed.
State
Alive/dead state for each simulated nucleus or the survivor count after each step.
Rule
Each alive nucleus independently decays with the declared probability during a step.
Output
Survivor history, final count, and analytic ensemble expectation.
Check
Survivors are monotonic; an unchanged seed reproduces the complete history; step zero returns the initial count.

For equal time steps with decay probability p, the expected number of survivors after n steps is

\[\mathbb{E}[N_n]=N_0(1-p)^n\]

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.

Seeded radioactive-decay experiment

Change the ensemble size, per-step decay chance, and number of steps. The same seed always reproduces the same individual decay run.

Surviving nuclei in this seeded run
Empty positions represent decayed nuclei

After 8 steps, 27 of 64 nuclei remain. The ensemble expectation is 23.0.

The visual grid is unavailable. The survivor count and analytic expectation above report the same seeded model.
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.

Try this experiment

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.

Where this model breaks

The model treats nuclei as independent, uses one constant probability, omits decay chains and detection efficiency, and does not predict radiation dose or safety. It is a probability teaching model, not a radiological tool.

Summary

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.

Glossary

Self-check

  1. Why can a seeded run differ from its expectation without being a bug?
  2. What state transition must never occur after decay?
  3. Why is this model not a radiation-safety calculator?

Sources

Model contract

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})\]
Inputs
Quantities you set or measure, with units and useful bounds.
State
Values the program must retain to reproduce the next result.
Rule
The relationship or update that turns inputs and state into a result.
Check
A known limit, unit check, invariant, or measured result that can expose a bad model.

Implement the idea as a model

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.

Guided experiment

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.

Where this model breaks

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.

Summary

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.

Glossary

  • Input: a measured value or chosen parameter supplied to a model.
  • State: the smallest set of values needed to continue or reproduce a model.
  • Validation: comparing an output with a known result, limit, invariant, or measurement.

Self-check

  1. Which values are inputs, and which values must remain state?
  2. What observable result would tell you the model is behaving as expected?
  3. Which assumption would you test first before applying the model to a real system?

Model review: turn Radioactive Decay Simulation into a test

Run reproducible stochastic decay ensembles and compare survival data with exponential expectation.

  1. Name the inputs and units that the nuclear and particle physics model needs.
  2. Separate the state you must keep from values you can calculate when needed.
  3. Write one rule that maps the current state and inputs to an observable result.
  4. Choose a limiting case, unit check, invariant, or known result before trusting an output.
  5. State one assumption you would change before using this simplified model for a real decision.

Share to: