Simple Python script that implements the Gillespie algorithm for simulation of stochastic systems. Follows / is based on the original 1977 paper.
D. T. Gillespie, “Exact stochastic simulation of coupled chemical reactions,” The Journal of Physical Chemistry, vol. 81, no. 25, pp. 2340–2361, Dec. 1977. doi:10.1021/j100540a008