Stochastic algorithms for biochemical processes