Gambler's Ruin javascript program, by Jeffrey Rosenthal, related to this book. Description at the bottom.

This program simulates a Gambler's Ruin Markov chain. The current value is shown in black, the possible jumps in yellow, and the actual move in green for up, or red for down. Keyboard shortcuts (you might need to click on the canvas first): '0-9' to change the simulation speed ('1' for one-step-at-a-time), or '>' or '<' to increase/decrease the up probability, or '+' or '-' to increase/decrease the number of states shown (or 't' for 20 or 'h' for 200 or 'f' for 1000), or 'p' or 'm' to increase/decrease the current state, or 'r' to restart.


This program is written by Jeffrey Rosenthal. See also my other JavaScript, my Stochastic Processes book, and my Java Applets.