4

Introduction (1)

Lets have a 2D plane, and place a Walker in the center $(X,Y)=(0,0)$

Lets take a example where we use all of the possible moves, $(m = 9)$.

We have one such case, where the Walker can make one of the $9$ moves each turn: Up, Down, Left, Right, Up-right, Down-right, Up-left, Down-left or Stay where it is.

The following grids represent number of possible paths leading to each square after $n$ turns where the middle value is always the center:

$$(n=1)$$ $$ \begin{matrix} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & 1 \\ \end{matrix} $$

$$(n=2)$$ $$ \begin{matrix} 1 & 2 & 3 & 2 & 1\\ 2 & 4 & 6 & 4 & 2\\ 3 & 6 & 9 & 6 & 3\\ 2 & 4 & 6 & 4 & 2\\ 1 & 2 & 3 & 2 & 1\\ \end{matrix} $$

$$(n=3)$$ $$ \begin{matrix} 1 & 3 & 6 & 7 & 6 & 3 & 1\\ 3 & 9 & 18 & 21 & 18 & 9 & 3\\ 6 & 18 & 36 & 42 & 36 & 18 & 6\\ 7 & 21 & 42 & 49 & 42 & 21 & 7\\ 6 & 18 & 36 & 42 & 36 & 18 & 6\\ 3 & 9 & 18 & 21 & 18 & 9 & 3\\ 1 & 3 & 6 & 7 & 6 & 3 & 1\\ \end{matrix} $$

And by observing the values we can conclude that in this case, the Number of possible paths ($P$) leading to a certain $(X,Y)$ coordinates is:

$$ P_{(x,y)}= \binom{n}{x}_2 \times \binom{n}{y}_2 $$

Where $\binom{a}{b}_2$ represents numbers in the Trinomial triangle.


Introduction (2)

Or lets say we allow only $4$ moves, $(m=4)$

We can observe a case with the set of moves: Left, Right, Up and Down :

$$(n=1)$$ $$ \begin{matrix} - & 1 & - \\ 1 & 0 & 1 \\ - & 1 & - \\ \end{matrix} $$

$$(n=2)$$ $$ \begin{matrix} - & - & 1 & - & -\\ - & 2 & 0 & 2 & -\\ 1 & 0 & 4 & 0 & 1\\ - & 2 & 0 & 2 & -\\ - & - & 1 & - & -\\ \end{matrix} $$

$$(n=3)$$ $$ \begin{matrix} - & - & - & 1 & - & - & -\\ - & - & 3 & 0 & 3 & - & -\\ - & 3 & 0 & 9 & 0 & 3 & -\\ 1 & 0 & 9 & 0 & 9 & 0 & 1\\ - & 3 & 0 & 9 & 0 & 3 & -\\ - & - & 3 & 0 & 3 & - & -\\ - & - & - & 1 & - & - & -\\ \end{matrix} $$

$$(n=4)$$ $$ \begin{matrix} - & - & - & - & 1 & - & - & - & -\\ - & - & - & 4 & 0 & 4 & - & - & -\\ - & - & 6 & 0 & 16 & 0 & 6 & - & -\\ - & 4 & 0 & 24 & 0 & 24 & 0 & 4 & -\\ 1 & 0 & 16 & 0 & 36 & 0 & 16 & 0 & 1\\ - & 4 & 0 & 24 & 0 & 24 & 0 & 4 & -\\ - & - & 6 & 0 & 16 & 0 & 6 & - & -\\ - & - & - & 4 & 0 & 4 & - & - & -\\ - & - & - & - & 1 & - & - & - & -\\ \end{matrix} $$

By rotating this 4-move case, where ($n=4$) for example, and removing the zero zones, we get a new grid:

$$ \begin{matrix} 1 & 4 & 6 & 4 & 1\\ 4 & 16 &24 & 16 & 4\\ 6 & 24 & 36 & 24 & 6\\ 4 & 16 & 24 & 16 & 4\\ 1 & 4 & 6 & 4 & 1\\ \end{matrix} $$

Where the rotated $P'$ can be then easily calculated, assuming that the rotated center is at the bottom left corner $(X',Y')=(0,0)$ for the purposes of using the binomial coefficients (the starting center is still in the center of the square):

$$P'_{(x,y)}= \binom{n}{x} \times \binom{n}{y}$$

The $4$ move case with moves Up-right, Down-right, Up-left, Down-left is the same thing but doesn't even need a rotation, we need to just remove the zero zones to get the same grid as above.


Introduction (3)

But then, lets look at the example of $(m=8)$ where the only move missing is Stay, then it would look like this:

$$(n=1)$$ $$ \begin{matrix} 1 & 1 & 1 \\ 1 & 0 & 1 \\ 1 & 1 & 1 \\ \end{matrix} $$

$$(n=2)$$ $$ \begin{matrix} 1 & 2 & 3 & 2 & 1\\ 2 & 2 & 4 & 2 & 2\\ 3 & 4 & 8 & 4 & 3\\ 2 & 2 & 4 & 2 & 2\\ 1 & 2 & 3 & 2 & 1\\ \end{matrix} $$

$$(n=3)$$ $$ \begin{matrix} 1 & 3 & 6 & 7 & 6 & 3 & 1\\ 3 & 6 & 12 & 12 & 12 & 6 & 3\\ 6 & 12 & 27 & 27 & 27 & 12 & 6\\ 7 & 12 & 27 & 24 & 27 & 12 & 7\\ 6 & 12 & 27 & 27 & 27 & 12 & 6\\ 3 & 6 & 12 & 12 & 12 & 6 & 3\\ 1 & 3 & 6 & 7 & 6 & 3 & 1\\ \end{matrix} $$

How would now $P_{(x,y)}$ for $n$ moves be calculated?


Question

How could one solve and find $P(n,x,y)$ for a specific configuration of allowed moves?

I'm mainly interested in the symmetrical ones. Although $9$ move and $4$ move ones were not that hard to figure out, the $5$ move ones ($4$ sides and stay moves / $4$ corners and stay moves) and $8$ move one (corners and sides) remain unsolved, even though they look very similar to the solved ones.


If this is also true in $1$ dimension where right+left moves produce the binomial triangle, and right+left+stay the trinomial triangle, supposedly then there should be a generalized method for higher dimensions too.

Vepir
  • 12,516
  • 1
    For the $4$-move case, turn the grid by $\pi/4$ to make the directions independent (see e.g. this answer). – joriki Mar 14 '16 at 10:13
  • 1
    @joriki thanks, turns out it can be then easily calculated using a rotated version of the grid with binomial coefficients. – Vepir Mar 14 '16 at 19:40
  • 1
    You may be interested in the adjacency matrix of a graph, which has the property that the $(i,j)$ entry of $A^\ell$ counts the number of walks from $i$ to $j$ in $\ell$ steps. Of course, you now have to compute the $(i,j)$ entry of $A^\ell$; doesn't seem much easier. But since $A$ is symmetric and real, it is diagonalizable: $A=S^{-1}DS$. Therefore, $A^\ell = S^{-1}D^\ell S$, and it is easy to take powers of a diagonal matrix. I don't know if this helps; I will sleep on it :) – Eric Stucky Apr 09 '16 at 14:07

0 Answers0