Random Walk Along A Line
A Simulation
Number of Trials   
Start At   
Path Length
Steps in this walk:
After walks the average number of steps is Ex2 is
   Theoretical Average number of steps is

This is a Javascript simulation of a particle moving along a straight line with absorbing states at either end.
When the particle hits either of the ends of the line - it blows up in which case you see a big BOOM in the walk field.
The Path Length Field contains the length of the line.
The Start At Field contains the starting position of the particle.
The Number of Trials is initially 10, but you can change this to whatever value you like.
If you change the number of trials, then the program will automatically execute that number of walks and then stop.
The field above the GO button contains the theoretical expected length of a walk with these parameters. The actual Average number of steps taken over all the walks performed so far is shown in the field above that.
Until you change the starting position or path length, the program retains the average length of a walk thus far. Pressing STOP aborts the current walk but will pick up from there when you next press GO. To really start over and clear all variables, press RESET.