Random Walk, Normal Distribution, Rayleigh, Maxwell Boltzmann, Diffusion Equation.
Bernoulli distriution rvs = np.random.binomial(1, 0.5, size=(N,M)) rvs[rvs==0] = -1 # traces of tracks for M particles by cumulative summation traces = np.cumsum(rvs, axis=0)/1000 # minimum step: 1/1000 plt.plot(range(N), traces,'b', lw=0.01) plt.xlabel('number of steps') plt.ylabel('displacement