An implementation of a random walk on a regular 1D lattice can be found in the RandomWalker.py program.
At each step in time (amount_time_stamps) the location of n particles (n_particles) jumps to another site according to some probability distribution (probability_threshold). The output of this process creates the following figure:
Furthermore, the program also shows the behaviour of the variance which is computed as follows: The output of this computation can be seen in the following figure:
The program 2D_RandomWalker pushes the simulation one step further by computing the random walk phenomenon in a 2 dimensional space. In this case the amount of walkers can decide at each time step to walk either left/right or up/down. The output of the simulation has very interesting geometric properties. In fact, it corresponds to a discrete fractal which is plotted by the program and looks like the following figure: