Skip to content

Commit 6b07748

Browse files
committed
Edited Random Horse Post and Added A Vid
1 parent c8ffc24 commit 6b07748

2 files changed

Lines changed: 27 additions & 21 deletions

File tree

content/posts/Random-Horse(Paths).md

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ tags = ['Random', 'Recursion']
1010
# ]
1111
+++
1212

13-
For each index $m\in{0,\dots,20}$ define a discrete planar random walk $f_m:{0,1,\dots,1000}\to\mathbb{Z}^2$ by the recurrence
13+
If you want to see the graph evolving for $n$ ranging from $0$ to $1000$ for each of the 21 paths see this [video](#fig-4).
14+
15+
For each index $m\in\set{0,\dots,20}$ define a discrete planar random walk $f_m:\set{0,1,\dots,1000}\to\mathbb{Z}^2$ by the recurrence
1416

1517
$$
1618
f_m(0) = (0,0),
@@ -22,10 +24,10 @@ $$
2224
f_m(n) = f_m(n-1) + \big(X_{m,n},Y_{m,n}\big),
2325
$$
2426

25-
where $X_{m,n}$ and $Y_{m,n}$ are independent random variables taking values in ${-1, +1}$ (each with equal probability). In words: at each step the walker moves one unit horizontally and one unit vertically, each independently chosen to be +1 or −1.
27+
where $X_{m,n}$ and $Y_{m,n}$ are independent random variables taking values in $\set{-1, +1}$ (each with probability $\frac12$). In other words: at each step the walker moves one unit horizontally and one unit vertically, each independently chosen to be +1 or −1.
2628

27-
So, the next step is a diagonal step. From $f_k$, there are four equally likely choices, each with probability $\frac{1}{4}$:
28-
$$f_{k+1} \in \set{ f_k + (\pm 1,\, \pm 1) \}$$
29+
So, the next step is a diagonal step. From $f(k)$, there are four equally likely choices, each with probability $\frac{1}{4}$:
30+
$$f(k+1) \in \set{ f(k) + (\pm 1, \pm 1) \}$$
2931
which looks like the following [graph](#fig-1).
3032
{{< tikz >}}
3133
\begin{tikzpicture}[transform shape, scale=2]
@@ -55,7 +57,7 @@ which looks like the following [graph](#fig-1).
5557

5658
\end{tikzpicture}
5759
{{< /tikz >}}
58-
Graphing all possible branches of $f_{k-1} \to f_k \to f_{k+1}$, we notice that exactly one of the four possible steps from $f_k$ leads back to $f_{k-1}$, giving a probability of $\frac{1}{4}$ of returning, which explains the isolated spikes observed in the [graph](#fig-2).
60+
When we graph all possible branches of $f(k-1) \to f(k) \to f(k+1)$, we notice that exactly one of the four possible steps from $f(k)$ leads back to $f(k-1)$, giving a probability of $\frac{1}{4}$ of returning, which explains the isolated spikes observed in the [graph](#fig-2).
5961
{{< tikz >}}
6062
\begin{tikzpicture}[>=stealth,thick, transform shape, scale=2]
6163

@@ -71,17 +73,17 @@ ab/.style={->,teal!60!black, thick, shorten >=7pt, shorten <=3pt},
7173
\draw[teal!60!black, line width=1.6pt] (0,0) circle (9pt);
7274

7375
\node[n0] (r) at (0,0) {};
74-
\node[font=\scriptsize, orange!70!black] at (0,0.75) {$f_{k-1}$};
76+
\node[font=\scriptsize, orange!70!black] at (0,0.75) {$f(k-1)$};
7577

7678
\node[n1] (k1) at ( 2.2, 2.2) {};
7779
\node[n1] (k2) at ( 2.2,-2.2) {};
7880
\node[n1] (k3) at (-2.2, 2.2) {};
7981
\node[n1] (k4) at (-2.2,-2.2) {};
8082

81-
\node[font=\scriptsize,blue!60!black] at ( 2.3, 2.8) {$f_k^{(1)}$};
82-
\node[font=\scriptsize,blue!60!black] at ( 2.3,-1.6) {$f_k^{(2)}$};
83-
\node[font=\scriptsize,blue!60!black] at (-2.1, 2.8) {$f_k^{(3)}$};
84-
\node[font=\scriptsize,blue!60!black] at (-2.1,-1.6) {$f_k^{(4)}$};
83+
\node[font=\scriptsize,blue!60!black] at ( 2.3, 2.8) {$f(k)^{(1)}$};
84+
\node[font=\scriptsize,blue!60!black] at ( 2.3,-1.6) {$f(k)^{(2)}$};
85+
\node[font=\scriptsize,blue!60!black] at (-2.1, 2.8) {$f(k)^{(3)}$};
86+
\node[font=\scriptsize,blue!60!black] at (-2.1,-1.6) {$f(k)^{(4)}$};
8587

8688
\draw[a0](r)--(k1); \draw[a0](r)--(k2);
8789
\draw[a0](r)--(k3); \draw[a0](r)--(k4);
@@ -119,18 +121,19 @@ ab/.style={->,teal!60!black, thick, shorten >=7pt, shorten <=3pt},
119121
\fill[orange!80!red] (5.8, 0.6) circle (3.5pt);
120122
\fill[blue!60!black] (5.8, 0.0) circle (2.8pt);
121123
\fill[teal!60!black] (5.8,-0.6) circle (2.0pt);
122-
\node[font=\scriptsize,orange!70!black] at (7.2, 0.6) {$f_{k-1}$};
123-
\node[font=\scriptsize,blue!60!black] at (7.2, 0.0) {$f_{k}$};
124-
\node[font=\scriptsize,teal!60!black] at (7.2,-0.6) {$f_{k+1}$};
124+
\node[font=\scriptsize,orange!70!black] at (7.2, 0.6) {$f(k-1)$};
125+
\node[font=\scriptsize,blue!60!black] at (7.2, 0.0) {$f(k)$};
126+
\node[font=\scriptsize,teal!60!black] at (7.2,-0.6) {$f(k+1)$};
125127
\draw[ab,shorten >=0pt,shorten <=0pt]
126128
(6.6,-1.2)--(5.6,-1.2);
127129
\node[font=\scriptsize,teal!60!black] at (6.5,-1.5) {returns to $f_{k-1}$};
128130

129131
\end{tikzpicture}
130132
{{< /tikz >}}
131133
The simplest closed loop occurs along the path
132-
$$f_k \to f_{k+1} \to f_{k+2} \to f_{k+3} \to f_{k+4}$$
133-
where $f_{k+4} = f_k$, yet $f_k \neq f_{k+2}$ and $f_{k+1} \neq f_{k+3}$, tracing a tilted square, as shown in the [figure below](#fig-3).
134+
135+
$$f(k) \to f(k+1) \to f(k+2) \to f(k+3) \to f(k+4)$$
136+
where $f(k+4) = f(k)$, yet $f(k) \neq f(k+2)$ and $f(k+1) \neq f(k+3)$, tracing a tilted square, as shown in the [figure below](#fig-3).
134137
{{< tikz >}}
135138
\begin{tikzpicture}[>=stealth,thick, transform shape, scale=2]
136139

@@ -169,15 +172,18 @@ arr/.style={->, thick, shorten >=4pt, shorten <=4pt},
169172
\fill[blue!60!black] (2,-2) circle (3.0pt);
170173

171174
% labels
172-
\node[font=\scriptsize, orange!70!black] at (-0.75, 0.25) {$f_k$};
173-
\node[font=\scriptsize, teal!60!black] at (-0.75, -0.35) {$=f_{k+4}$};
174-
\node[font=\scriptsize, blue!60!black] at ( 2.0, 2.6) {$f_{k+1}$};
175-
\node[font=\scriptsize, blue!60!black] at ( 4.75, 0.0) {$f_{k+2}$};
176-
\node[font=\scriptsize, blue!60!black] at ( 2.0, -2.6) {$f_{k+3}$};
175+
\node[font=\scriptsize, orange!70!black] at (-0.75, 0.25) {$f(k)$};
176+
\node[font=\scriptsize, teal!60!black] at (-0.75, -0.35) {$=f(k+4)$};
177+
\node[font=\scriptsize, blue!60!black] at ( 2.0, 2.6) {$f(k+1)$};
178+
\node[font=\scriptsize, blue!60!black] at ( 4.75, 0.0) {$f(k+2)$};
179+
\node[font=\scriptsize, blue!60!black] at ( 2.0, -2.6) {$f(k+3)$};
177180

178181
% caption
179182
\node[font=\scriptsize] at (2.0, -3.6)
180-
{4 diagonal steps close a square: $f_{k+4}=f_k$};
183+
{4 diagonal steps close a square: $f(k+4)=f(k)$};
181184

182185
\end{tikzpicture}
183186
{{< /tikz >}}
187+
188+
Here is the graph evolving.
189+
{{< video src="/videos/randomhorse.mp4" width="75" >}}

static/videos/randomhorse.mp4

710 KB
Binary file not shown.

0 commit comments

Comments
 (0)