Screen sharing while coding under pressure is a different beast from just talking through math.
First, clarify the decay model (e.g., each particle has a fixed per-trial decay probability). Then implement a Monte Carlo simulation that runs many trials, tracks the number of surviving particles per trial, and computes the empirical survival probability. Finally, compare the simulated survival probability to the theoretical value (e.g., (1-p)^n) and discuss any discrepancies due to sampling variability.
Pro tip: Use vectorized operations (e.g., NumPy) to efficiently simulate many trials, and always set a random seed for reproducibility. Also, report confidence intervals for your estimate to show statistical rigor.
Define the decay process: each particle independently survives each trial with probability p (or decays with probability 1-p). Confirm the number of particles (100) and the number of trials.
Write code that, for each trial, simulates the survival of each particle (e.g., using Bernoulli trials) and counts how many survive. Repeat for many trials to build a distribution.
Compute the empirical survival probability as the total number of surviving particles across all trials divided by the total number of particles simulated (100 * number of trials).
Calculate the theoretical survival probability (e.g., p^100 if all must survive, or the expected fraction surviving). Compare the simulated and theoretical values, and discuss the law of large numbers.
Check for convergence by increasing the number of trials, and provide a confidence interval for the estimate. Explain any observed differences and the implications for the problem.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.