# How to know if people ever meet when they are walking two different routes at the same time which intersect.

So there are two people, person A and person B, walking their own route at the same time. These routes take an arbitrary amount of time to walk and they start at an arbitrary point along this route. So if we take an intersection point p, I would like to know if they ever meet on that point.

So I thought of the problem like this:

There is a certain intersection time in a round $I_A$ at which person A is at the intersection point. So if $r_A$ is the time it takes for A to finish one route then $I_A \equiv t \mod r_A$ (where $t$ is the time, with $t = 0$ being at the start of the hike).

For B this would be the same, so: $I_B \equiv t \mod r_B$. I have also rewritten this expression to $t = r_B \cdot k + I_B = r_A \cdot l + I_A$ where $k, l \in \mathbb{N}$

However, I couldn't really find any solutions. (Or the infinite set of solutions that should be there or not).

In general there does not need to be a solution. Assume that person A walks on the real line between 0 and 1 back and forth with speed 1 and person B walks between 1 and $1+\pi$ back and forth with speed 1. Now depending on the starting point of person A and B they will meet either never or once. Assume that they meet a second time, then person B has walked a distance $2n\pi$ with some $n\in \mathbb{N}\setminus \{0\}$ and person A has traveled a distance $m\in \mathbb{N}\setminus\{0\}$. As both are moving with the same speed the two distances have to be equal, but this implies $\pi=\frac{m}{2n}\in \mathbb{Q}$, which is a contradiction. Hence, they can meet at most once. Meeting once is easy, just let them both start at the intersection point. If on the other hand person A starts at 0 and person B starts at $1+\pi$ then they will never meet (by essentially the same argunent like before that they can meet at most once).
Added: If you want to attack this problem in full generality, you will realise that it is not so easy. If $I_A=I_B$ then you are asking whether $r_A$ and $r_B$ are linearly independent over $\mathbb{Q}$. It is for example not so easy to prove that $\pi$ and $\ln(2)$ are not linearly independent over $\mathbb{Q}$ (check Are $\pi$ and $\ln(2)$ linearly independent over rational numbers?).