Why do these days of the week line up?

I go to the gym every Mon/Wed/Fri while a friend of mine goes every 3 days regardless of the day. A typical two weeks could look like:

     Su | M | T | W | R | F | Sa | Su | M | T | W | R | F | Sa
 ME:      X       X       X             X       X       X
HIM:          X           X             X           X

To my surprise, I've observed that I see him exactly once a week. I decided to look at it from a math perspective.

It's clear the number of times a week I see him has an upper bound of 1. If I see him Mon, he'll come in Thurs and I won't see him Wed/Fri. The same logic can be used for if I see him Wed/Fri.

However, I'm not sure why the lower bound here is 1. My intuition tells me it has something to do with modulus 7, since the days he comes to the gym are cyclical (this would also make some kind of sense since I'm coming to the gym every two days 3 times while he comes every 3 days and his cycle repeats every 3 weeks) but I can't make the mathematical leap.

I also tried to generalize. What if I come in for 3 days that are each 1 apart? Then it's obvious I'll see him exactly once. But what if I come in 3 days that are each 4 days apart?

I can bruteforce this to find that I'm right, but intuitively, why are our days lining up exactly once a week?


Solution 1:

Let's think of numbers $0, 1, \ldots, 6, \ldots$ as the days starting from some Sunday.

Then every Monday, Wednesday, and Friday, means $\{7n + 1, 7n + 3, 7n + 5\}$.

"Every three days" is all days of the form $3n + k$, where $k \in \{0, 1, 2\}$. Equivalently, these are all days that are $\equiv k \pmod 3$.

Taking $\{\rm M, W, F\}$ modulo $3$, we get $\{n+1, n, n+2\}$, which is the same as $\{0,1,2\}$, thus one of Monday, Wednesday, Friday is $k \pmod{3}$. Thus for any $k$, there is a day that matches both sets.

Solution 2:

Take any three numbers of the form $n,n+2,n+4$ for some $n\in\Bbb N$. Then one of them, and exactly one, is a multiple of $3$.

This is because $2$ is a generator of the cyclic group of order $3$, $\Bbb Z/3\Bbb Z$.

Solution 3:

It's clear the number of times a week I see him has an upper bound of 1. If I see him Mon, he'll come in Thurs and I won't see him Wed/Fri. The same logic can be used for if I see him Wed/Fri.

Similar logic works the other way around. Since he comes every three days, he'll have to be there on Monday, Tuesday or Wednesday:

  • If he comes in on Monday, you'll see him on Monday.
  • If he comes in on Tuesday, he'll also come on Friday, and you'll see him on Friday.
  • If he comes in on Wednesday, you'll see him on Wednesday.

So there's also a lower bound of 1.

If you go on three days that are four days apart, they can be numbered as $n$, $n+4$, and $n+8$. Modulo 3, these are $n$, $n+1$ and $n+2$. All remainders modulo 3 are covered, so exactly one of these days coincides with the every-three-days cycle of the other person.

On the other hand, if you went on days that are three apart (or any multiple of three), then your partial cycle would be locked with the other person's cycle, and you'd see him either every time, or never.