It was recalled that, in the simplest one-dimensional Monte Carlo implementation, a particle was stepped to left or right with equal probability by a distance, √2DΔt, where D was the diffusion coefficient and Δt was the time step. This gave accurate results if D was constant but, in the case where D was spatially dependent, a systematic error occurred; as shown by comparing Monte Carlo averages with deterministic solutions. This error did not decrease when the time step was reduced. It was shown that the results could be reconciled by altering both the Monte Carlo step size and the stepping probability, and simple formulas were given for correction terms that were also applicable in higher dimensions.

Monte Carlo Simulation of Diffusion in a Spatially Nonhomogeneous Medium: a Biased Random Walk on an Asymmetrical Lattice. L.Farnell, W.G.Gibson: Journal of Computational Physics, 2005, 208[1], 253-65