Past exam of the mathematics course of the University of Cambridge 2007 iii Paper 74 2 c Solution Created 2026-10-03 Updated 2026-10-14
For the Gillespie algorithm, start from and an integer molecular copy number . At each step use the current state, without the mean approximation in parts (a)–(b). The reaction propensity functions are and , and their sum is . Draw two independent uniform random variables on and setThe waiting time has an exponential distribution with rate . Keep the sample path constant on , advance , and choose the reaction byRecord the post-jump state, recompute both reaction propensity functions, and repeat with fresh independent uniforms. At the death propensity is zero, so only a birth is selected and the trajectory remains nonnegative. For a prescribed terminal time , if the next event would occur after , keep the current state to and stop. This produces exact piecewise constant sample paths of the specified continuous-time Markov chain.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 207 3 f Solution Created 2026-10-03 Updated 2026-10-06
For the stochastic SIR model, the state is a continuous-time Markov chain on nonnegative integer triples summing to , initially . Its only transitions areRates vanish when a proposed transition would leave the state space. Equivalently, with independent unit-rate Poisson processes , the Poisson time-change representation of a Markov chain isThe left limits describe the state immediately before each jump. In the Gillespie algorithm, wait an exponential distribution time with rate , then choose infection or recovery in proportion to these two rates.
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 356 2 e Solution 2026-09-28
An exact Gillespie algorithm for one particle is:
For , simulate particle identities independently and maintain a priority queue of their next event times. For , store occupation numbers and use aggregate event rates and for each well; one population-level Gillespie event then decrements one and increments its neighbor. This replaces work proportional to particle number by work proportional to the number of occupied wells.
Past exam of the mathematics course of the University of Cambridge 2023 iii Paper 356 3 e Solution 2026-09-28
1. At the current integer , compute and the averaged rates and .
2. Draw a waiting time .
3. Set with probability ; otherwise set .
4. Advance time by and repeat.
2. Draw a waiting time .
3. Set with probability ; otherwise set .
4. Advance time by and repeat.
This is a Gillespie algorithm for the averaged slow master equation. It samples the fast conditional equilibrium analytically through its factorial moment and never simulates individual fast births or deaths.
Past exam of the mathematics course of the University of Cambridge 2024 iii Paper 356 1 a Solution 2026-09-28
Write the molecular copy numbers as and use the power-law reaction propensity convention of the paper. The seven propensities and stoichiometric vectors areA channel is assigned zero propensity whenever its update would leave the nonnegative integer lattice.
The Gillespie algorithm starts from and . At the current state compute . If , terminate the path. Otherwise draw independent random variables from the uniform distribution on , set the next waiting time toand choose the least index satisfyingThen update and , and repeat. The minimum of the seven competing reaction clocks has an exponential distribution of rate , while reaction wins with probability .