C Derivation of Event Selection Probabilities

Consider two competing events with rate constants \(k_1\) and \(k_2\). We want to find the probability that event 1 happens first. This equals the probability that event 1 occurs at some time \(t\) AND event 2 hasn’t occurred by that time, integrated over all possible times \(t\):

\[\begin{eqnarray} P(\text{Event 1 occurs first}) &=& \int_0^{\infty} P(\text{Event 1 occurs at time }t) \times P(\text{Event 2 hasn't occurred by time }t) \, \mathrm{d}t \\ &=& \int_0^{\infty} k_1 \exp(-k_1 t) \times \exp(-k_2 t) \, \mathrm{d}t \\ &=& k_1 \int_0^{\infty} \exp(-(k_1 + k_2)t) \, \mathrm{d}t \\ &=& k_1 \times \frac{1}{k_1 + k_2} \\ &=& \frac{k_1}{k_1 + k_2} \end{eqnarray}\]

Similarly, for event 2:

\[\begin{eqnarray} P(\text{Event 2 occurs first}) &=& \int_0^{\infty} P(\text{Event 2 occurs at time }t) \times P(\text{Event 1 hasn't occurred by time }t) \, \mathrm{d}t \\ &=& \int_0^{\infty} k_2 \exp(-k_2 t) \times \exp(-k_1 t) \, \mathrm{d}t \\ &=& k_2 \int_0^{\infty} \exp(-(k_1 + k_2)t) \, \mathrm{d}t \\ &=& k_2 \times \frac{1}{k_1 + k_2} \\ &=& \frac{k_2}{k_1 + k_2} \end{eqnarray}\]

This confirms our earlier result that the probability of a particular event being the first to occur is proportional to its rate constant divided by the sum of all rate constants.

The same approach generalises to any number of competing events. For \(N\) events with rate constants \(k_1, k_2, ..., k_N\), the probability that event \(j\) occurs first is:

\[P(\text{Event j occurs first}) = \frac{k_j}{\sum_{i=1}^{N} k_i}\]

This result forms the basis for event selection in the KMC algorithm, where we use a random number to select events with probabilities proportional to their rates.