Next: Project
Up: Problem: Spontaneous Decay Simulation
Previous: Problem: Spontaneous Decay Simulation

Method Numeric

Instead of looking at the limit for many particles, we can simulate radiactive decay with random numbers following the simple algorithm below.

Simulation Scheme
  1. Assume a value for the decay constant (this sets the time scale, and each run through the do loop corresponds to an additional ).
  2. Start with Nnuc = total number of nuclei at t=0.
  3. Generate a random number for each nucleus, which has not decayed yet.
  4. Use as the basic algorithm for each nucleus:
    if , the nucleus decays and Nnuc=Nnuc-1
    else it remains.
  5. When done sampling all nuclei, print number of remaining nuclei.
  6. Repeat process for remaining nuclei.


Next: Project
Up: Problem: Spontaneous Decay Simulation
Previous: Problem: Spontaneous Decay Simulation