I've written a simulation in matlab of a 2-D random walk that, at any point, has an equal probability of going to any of the adjacent points. The simulation was run for 10,000 steps on a grid with dimensions 5×5, with the 'walker' starting at point (0,0). The number of times a specific point was reached is divided by he number of steps to determine the probability that the random walk is in that state. I noticed that this probability, for any point, is approximately the same. The probability for any point only changes depending on the size of the grid. Why?
Probability of random walk in a specific point – 2D Random Walk –
MATLABprobabilityrandom walk
Related Solutions
Let me solve a related but slightly different problem. Consider a discrete random walk in 2D with $1/4$ probability of moving in each of the four directions for each step. We are given a destination vector $\vec{D}=Xe_1+Ye_2$ and we start at the origin. The question is: Given $n$, what is the probability $P_n$ of ending up at $X$ after $n$ steps.
By an $n$-path, I mean a sequence $\vec{r}_1, \cdots, \vec{r}_n$ with each $\vec{r}=xe_1+ye_2$ being such that either $x=\pm 1$ and $y=0$ or $x=0$ and $y=\pm 1$. There are exactly $4^n$ different $n$-paths. Let $N_n(X,Y)$ be the number of $n$-paths that end at $\vec{D}$. Then $P_n=N_n(X,Y)/4^n$. So we need to find $N_n(X,Y)$.
Take an $n$-path. Let $N^x_{\pm}$ be the number of horizontal steps in $\pm$ directionrespectively. Similarly define $N_\pm^y$. Clearly, $$ N_+^x-N_-^x=X, \qquad N_+^y-N_-^y=Y, \qquad N_+^x+N_-^x+N_+^y+N_-^y=n $$ We furthermore say an $n$-path is $m$-horizontal if $N_+^x+N_-^y=m$. Forgetting for the moment that we only care about non-negative integer solutions, one can solve these four equations $$ \begin{pmatrix} N_+^x\\ N_-^x\\ N_+^y\\ N_-^y \end{pmatrix}=\frac{1}{2}\begin{pmatrix} m+X\\ m-X\\ n-m+Y\\ n-m-Y \end{pmatrix} $$ Which obiously requires $m\geq |X|$, $n-m\geq |Y|$ and that $X+m$ and $n-m+Y$ are even. We say $m$ is $(n,X,Y)$-admissible if given $n,X,Y$, the number $m$ is such that all these conditions are satisfied. Then the number of $m$-horizontal $n$-paths ending at $\vec{D}$ are $$ \nu_m=\binom{n}{m}\binom{m}{N_+^x}\binom{n-m}{N_+^y}= \binom{n}{m}\binom{m}{\frac{m+X}{2}}\binom{n-m}{\frac{n-m+Y}{2}} $$ and the total number of $n$-paths ending at $\vec{D}$ are $$ \boxed{ N_n(X,Y)=\sum_{m\text{ is }(n,X,Y)\text{-admissible}} \binom{n}{m}\binom{m}{\frac{m+X}{2}}\binom{n-m}{\frac{n-m+Y}{2}}} $$ Note that it is not hard at all to find all $m$ that are $(n,X,Y)$-admissible once you know specifically what $n,X,Y$ are. For example, say $X=-10, Y=30$ and $n=1000$. Since $X$ is even, $m$ has to be even. The condition $n-m+Y$ even is automatically satisfied then. So you need $m\geq 10$ and $1000-m\geq 30$. So the set of $(1000, -10, 30)$-admissible $m$'s are all even numbers satisfiying $10\leq m\leq 970$.
The probability of a particular path of length $n$ is indeed $6^{-n}$, however this is not the probability starting from $x$, you will be at point $y$ after $n$ steps; in fact, the latter probability is of order $n^{-3/2}$ (for fixed $x$ and $y$). As a result, by the Borel-Cantelli lemma the probability of hitting a particular site infinitely often is zero a.s. $0.34$ is the probability that a R.W. starting from $(0,0,0)$ returns (ever) to this point.
Best Answer
Let $L_d = \{1, ..., d\}^2$ be the domain of the random walk. I assume that when OP says
they mean that at the boundaries, any "accessible" point is selected with equal probability. Thus, at the point $x = (1, 3)$ and $d = 5$, the points $(1, 2), (1, 4), (2, 3)$ exhaust all the next possible states, each with probability 1/3.
This Markov chain is irreducible and aperiodic on a finite state space, hence ergodic with unique stationary distribution $\pi$. In general, the transition kernel of a finite-state Markov chain can be encoded via a matrix $P$ called the transition matrix. The stationary distribution is then the row vector which satisfies $\pi^T P = \pi^T$ (here the superscript $T$ denotes a transpose). In this case, $P$ would be a $d^2\times d^2$ matrix. You can read more about stationary distributions of Markov chains anywhere you like with Google.
Owing to the asymmetry of the proposal distribution of the Markov chain at the boundary, the stationary distribution will not be uniform. You can see this by running more samples. I ran with $10^6$. Below is a heat map of the probabilities.
Finally, you ask "why" would this be so. If you started from a random location on the grid and ran 1000 steps of the random walk, do you think you could identify with high confidence where you started? No. Each state that's not on the boundary eventually experiences similar "inflow" and "outflow", regardless of where the chain started, so the eventual frequency of visits should be equal for all such states.