A Galton board (or bean machine, or quincunx) to illustrate a random walk.
Edit and compile if you like:
% Author: Izaak Neutelings (March 2019)\documentclass[border=3pt,tikz]{standalone}\tikzset{>=latex} % for LaTeX arrow head\tikzstyle{block}=[inner xsep=8,inner ysep=9,fill=red!60!black]\tikzstyle{bin}=[inner xsep=8,inner ysep=3,fill=white,above=1]\tikzstyle{arrow}=[->,thick,thick,blue!50!black,shorten <=1,shorten >=4]\begin{document}% RANDOM WALK\begin{tikzpicture}\def\w{1}\def\h{.8}\def\bin{++ (\w/2,.3*\h) |-++ (-\w,-.4*\h) --++ (0,.4*\h)}\node[block] (S1-1) at (0,0) {};\node[block] (S2-1) at (-\w,-\h) {};\node[block] (S2-2) at (\w,-\h) {};\node[block] (S3-1) at (-2*\w,-2*\h) {};\node[block] (S3-2) at (0,-2*\h) {};\node[block] (S3-3) at (2*\w,-2*\h) {};\node[bin] (S4-1) at (-3*\w,-3*\h) {0};\node[bin] (S4-2) at (-\w,-3*\h) {1};\node[bin] (S4-3) at (\w,-3*\h) {2};\node[bin] (S4-4) at (3*\w,-3*\h) {3};%\coordinate (S4-1) at (-3*\w,-2.5*\h);%\coordinate (S4-2) at (-\w,-2.5*\h);%\coordinate (S4-3) at (\w,-2.5*\h);%\coordinate (S4-4) at (3*\w,-2.5*\h);\fill[blue!40!black] (90:0.6*\h) circle (2pt);% ROW 1\draw[arrow] (S1-1.110) to[out=110,in= 80,looseness=1.5] (S2-1.85)node[midway,above left=15,blue!40!black] {L};\draw[arrow] (S1-1. 70) to[out= 70,in=100,looseness=1.5] (S2-2.95)node[midway,above right=15,blue!40!black] {R};
Click to download: random_walk.tex • random_walk.pdf
Open in Overleaf: random_walk.tex