Course 3.1Lesson 4 of 5
In radioactive decay, each atom decays at a random moment, with a probability p in each second. A simulation follows the number of atoms that are left: in each second, rng.binomial of the atoms and p gives how many decay. The result follows the expected curve n0 times one minus p to the power t, but it fluctuates, and the fluctuation of a count is about the square root of the count, so a small sample is rough and a large sample is smooth. With p equal to 0.05 the expected half-life is ln 2 over minus ln of 1 minus p, which is 13.5 seconds, and a simulation that counts whole seconds finds 14. The exponential law of decay is not a rule for single atoms, whose decay is unpredictable, but the result of the average over a huge number of atoms.
Try the code and the simulations beside the lesson.
After this lesson you can
In chapters 2 and 3, you drew the decay of a sample as a smooth curve, , and fitted it. But what happens to one atom? Nobody can say when an atom will decay. Each atom has only a probability to decay in the next second. The smooth law is what you see when many atoms, each with its own chance, are counted together. A simulation shows how a smooth law grows out of chance.
The model: each second, each atom that is left decays with the probability , independently of the others. In a sample of atoms, how many decay in one second? It is a binomial random number, and NumPy has it: rng.binomial(n, p) is the number of "successes" in trials, each with the probability .
Predict first. Each second, 5 percent of the atoms decay. How many are left after 10 seconds, on average? (Each second, the number is multiplied by 0.95.)
The output compares the two: at 10 s, 6023 atoms in the simulation and 5987.4 expected; at 30 s, 2176 and 2146.4; at 60 s, 466 and 460.7. The simulation follows the exponential law, with small differences that come from chance. This is a way to see why a law of decay is exponential: each second, the same share of the atoms decays, so the number is multiplied by the same number again and again.
Predict first. The expected number after 30 seconds is 21.5 for 100 atoms, 2146 for 10 000, and 214 639 for a million. Which sample will give the most regular result?
A bigger sample is smoother. The picture shows the same story: the orange curve for 200 atoms is rough and wanders around the theory, and the blue curve for 10 000 atoms lies on it.
There is a rule behind this. The scatter of a count is about the square root of the count, so the relative scatter is . For 21 survivors, it is , which is exactly the number that the program found. This is the same law as in the Monte Carlo method, and it explains why a Geiger counter that counts only 100 particles is accurate to about 10 percent.
The dots are the expected counts. The code's simulated counts scatter around them by about the square root of the count.
rng.binomial for the whole sample.Start with two quick questions. Each New numbers gives you a fresh one, so you can practise as long as you like.
Then the labs and the problems:
rng.binomial(n, p) is the number of decays among atoms in one step.Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
Every lesson is open to read. Enrolling also lets you:
Log in to join the discussion.
Loading…
This lesson is free to read. Enroll free to keep your place and take the tests.