Coordinates reachable from $(x, y) = (2,5)$

94 Views Asked by At

If we are on coordinate $(m,n)$ then we can either go to coordinate $(m + n, n)$ or $(m, m + n)$. If we start at $(2,5)$ then what all coordinates we can reach in finitely many moves?

In our case we have: From coordinate $(2,5)$ we can go to $(7,5)$ or $(2,7)$, now if you choose to go to $(7,5)$ then from $(7, 5)$ you can go to $(12,5)$ or $(7,12)$ and so on we keep on iterating this process and we need to find all such reachable coordinates. Any help would be highly appreciated. Thanks.

2

There are 2 best solutions below

1
On

Given $(x,y)$, can it be reached? Clearly (or formally: by induction), $x,y$ must be integers and $x\ge 2$, $y\ge 5$. Also, we see (again formally: by induction) that $x\ne y$ because the allowed steps can only produce different coordinates $m+1\ne n$ or $m\ne m+n$ from positive $n,m$. Thus $(x,y)\ne(2,5)$ can be reached only via $(x-y,y)$ if $x>y$ and only via $(x,y-x)$ if $y>x$ and not at all if $x=y$.

Thus to check if $(x,y)$ can be reached, we only have to repeatedly go backwards and subtract the smaller from the larger coordinate and have won iff the last position before making $x<2$ or $y<5$ is $(2,5)$. Note that these steps are really just Euclid's algorithm in disguise, except that we stop a few steps before one coordinate becomes $0$ and the other the gcd. In particular, necessarily $\gcd(x,y)=\gcd(2,5)=1$. But this is not sufficient as many such pairs will rather go via points like $(3,7)$ for example.

0
On

First, note that the map $(m, n) \mapsto (m+n, n)$ corresponds to the matrix $E_1 = \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix}$ and the map $(m, n) \mapsto (m, m+n)$ corresponds to the matrix $E_2 = \begin{bmatrix} 1 & 0 \\ 1 & 1 \end{bmatrix}$. Therefore, it will be useful to study what matrices can be formed as products of these two matrices.

Lemma: A matrix in $M_{2\times 2}(\mathbb{Z})$ can be expressed as a product of $E_1$ and $E_2$ (for example $E_1^5 E_2^2 E_1^7 E_2^3 E_1$) if and only if it has determinant 1 and every entry is a nonnegative integer.

Proof: The forward direction is easy to see. For the reverse direction, we will prove that any such matrix $\begin{bmatrix} a & b \\ c & d \end{bmatrix}$ with $ad - bc = 1$ and $a,b,c,d \in \mathbb{N}$ is a product of $E_1$ and $E_2$ by strong induction on $a + c$.

First, if any of $a,b,c$ or $d$ is zero, it certainly cannot be either $a$ or $d$, and $a = d = 1$. Then if $b = 0$, we have $$\begin{bmatrix} 1 & 0 \\ c & 1 \end{bmatrix} = E_2^c.$$ Similarly, if $c = 0$, we have $$\begin{bmatrix} 1 & b \\ 0 & 1 \end{bmatrix} = E_1^b.$$

It now remains to show the case where all of $a,b,c,d > 0$. Then if $a = c$, we must have the common value is $a = c = 1$, and the matrix is of the form $$\begin{bmatrix} 1 & b \\ 1 & b+1 \end{bmatrix} = E_2 \begin{bmatrix} 1 & b \\ 0 & 1 \end{bmatrix} = E_2 E_1^b.$$

If $a > c$, then $ad - bc = 1$ implies that $\frac{a}{c} - \frac{b}{d} = \frac{1}{cd}$. Therefore, $\frac{b}{d} = \frac{a}{c} - \frac{1}{cd} \ge \frac{a}{c} - \frac{1}{c} \ge \frac{c}{c} = 1$, so $b \ge d$. We now see that $$\begin{bmatrix} a & b \\ c & d \end{bmatrix} = E_1 \begin{bmatrix} a - c & b - d \\ c & d \end{bmatrix}.$$ However, by inductive hypothesis since $(a-c) + c < a+c$, we have $\begin{bmatrix} a-c & b-d \\ c & d \end{bmatrix}$ is a product of $E_1$ and $E_2$, so $\begin{bmatrix} a & b \\ c & d \end{bmatrix}$ is also a product of $E_1$ and $E_2$.

If $a < c$, then a similar argument shows that $b \le d$, and $\begin{bmatrix} a & b \\ c & d \end{bmatrix} = E_2 \begin{bmatrix} a & b \\ c - a & d - b \end{bmatrix}$ where the second factor can be expressed as a product of $E_1$ and $E_2$ by inductive hypothesis. $\square$

Therefore, the points reachable from $(2, 5)$ via the operations $E_1$ and $E_2$ are precisely the points which can be expressed as $(2a + 5b, 2c + 5d)$ where $a,b,c,d \in \mathbb{N}$ and $ad - bc = 1$.

(I'm unsure of exactly what kind of characterization the original problem is asking for. This does provide a straightforward way of generating reachable points - for example by choosing random natural numbers $b,c$, factoring $bc + 1$ and assigning a random factorization to $a,d$. On the other hand, if you're given a pair and you want to determine whether it's reachable, it's probably easier to use the procedure described by Hagen von Eitzen's answer rather than trying to solve for $a,b,c,d$ in this description.)