Pseudocode of algorithm to compute exact isotope distributions. The inputs are the relevant characteristics of each atom. For example, nO is the number of O atoms, Δ17O and Δ18O are the mass shifts of 17O and 18O isotopes (relative to 16O isotope), respectively, and p17O and p18O are the corresponding (normalized) abundances. M0 is the monoisotopic mass. Binom and Multinom stand for binomial and multinomial distributions, respectively.