Back to problems

Implement decay simulation and trailing-zero counting

Algorithm · Upstart · Medium

Implement the following two utilities in Python. Part 1: Radioactive Decay Simulation Create a function simulate_decay(m, n) that models a radioactive sample. The half-life of the material is exactly 1 day, so each atom has probability $$0.5$$ of decaying during each full day. Atoms behave independently. Equivalently, you may sample an atom's survival time directly rather than stepping day by day. The function should accept: m: an integer number of elapsed days n: an integer…

Checking your access…