Three symmetric math riddles
March 19, 2025 · 9 mins · 1663 words
I like problems that are easy to pose, and that seem difficult to solve at first glance, but that a slight change of perspective makes them simple and easy to solve. In this post, I will expose my 3 favorite problems of this type.
For each riddle, I’ll first explain the problem, then solve it the hard way, and finally show the elegant and simple solution. These three problems are widely known, so I’m sorry if you already know them.
Two bikes and a fly
This is one of my favorite problems to ask at parties or social events. You can ask this question to anyone with basic math knowledge and they’ll understand the question and the easy solution. And -in my experience- the more math you know the more you enjoy the trick used in the simple solution.
Hard solution
The hard solution here involves summing the infinite sum. We'll calculate the distance the fly travels in each "leg" of its journey.- On the first trip:
- Cyclist and the fly will met after $10 t_1 = 30 - 5t_1 \implies t_1 = 2$. So in the first trip the fly travels $d_1 = 20km$
- Cyclists have traveled $10km$ each one, so now the distance between them is $10km$
- On the second trip:
- Now, the fly takes $10 t_2 = 10 - 5t_2 \implies t_2 = \frac{10}{15}$ and travels $d_2 = \frac{100}{15} km \approx 6.67 km$
- Cyclist traveled $\frac{50}{15}km$ and the distance between them is $10km - \frac{100}{15} \approx 3.33 km$
- On the third trip:
- Once again, $10 t_3 = \frac{10}{3} - 5t_3 \implies t_3 = \frac{10}{45}$ so the fly travels $d_3 = \frac{100}{45} km \approx 2.22km$
- ...
Here we notice the pattern that in each leg the distance that the fly moves is reduced by 3 (20, 6.67, 3.33, ...). Therefore, we have to solve for the infinite series $D = 20 + 20 / 3 + 20 / 3^2 + 20 / 3^3 + ...$ which can be solved by noticing that $D = 20 + D/3$ so $D = 30km$.
Easy solution
To solve the problem you just neeed to know how long would it take for the cyclists to meet and the multiply this time by the speed of the fly.- Time to meet = \frac{30 km}{10km/h} = 3h
- Distance traveled by the fly = $10 km/h \times 3h = 30km$
There’s a funny story about this problem involving John von Neumann. Someone once asked von Neumann this question, expecting it to be challenging. To their surprise, von Neumann solved it almost instantly. The person who asked the question was disappointed and said, “Oh, I guess you figured out the quick trick to solve it!”. Von Neumann, looking confused, replied, “What trick? I just added up the infinite series.”
Ants on a ruler
I don’t remember when I first heard about this problem, but it was a long time ago - maybe during my Physics degree. I remember it was the first time when I smiled in awe after a math proof 1.
Hard solution
In this case I wasn't able to get an analytics solution, so I decided to solve it with code. Here we'll simulate the ants for a couple of experiments and analyze the results.import random
def initialize_ants(n_ants=10, stick_length=1.0,):
ants = [(random.uniform(0, stick_length), random.choice([-1, 1]))
for _ in range(n_ants)]
return ants
def simulate_ants(ants, stick_length, ant_speed=1.0, dt=0.0001):
# Initialize ants as (position, direction) tuples
time = 0
while ants: # While there are ants still on the stick
# Move all ants
ants = [(pos + dir * ant_speed * dt, dir) for pos, dir in ants]
# Handle collisions
for i in range(len(ants)-1):
for j in range(i+1, len(ants)):
if abs(ants[i][0] - ants[j][0]) < 1e-7:
# Swap directions
ants[i] = (ants[i][0], -ants[i][1])
ants[j] = (ants[j][0], -ants[j][1])
# Remove ants that fell off
ants = [(pos, dir) for pos, dir in ants if 0 < pos < stick_length]
time += dt
if time > 1.:
print(ants)
break
return time

Easy solution
Here's the key insight: it doesn't matter if the ants bounce off each other when they collide. Since all ants look the same, we can pretend they just pass right through each other without changing direction. The only thing we care about is when the final ant drops off the ruler. And since each ant moves at 1 meter per second along a 1-meter ruler, we know that after exactly 1 minute, every ant must have reached one end or the other and fallen off.Boarding a plane
Hard solution
Let's solve this rigorously by calculating the probabilities. Let's denote by f(n) the probability that the last passenger gets their assigned seat in a plane with n seats.1. Initial Probabilities
When passenger 1 boards, they can:
- Sit in their own seat (seat 1) with probability $1/n$
- Sit in the last seat (seat n) with probability $1/n$
- Sit in any other seat $i$ ($2 \leq i \leq n-1$) with probability $(n-2)/n$
2. Case Analysis
Case A: Passenger 1 sits in seat 1
- Everyone else will get their assigned seat
- Contribution to $f(n)$ is $(1/n) \times 1 = 1/n$
Case B: Passenger 1 sits in seat n
- The last passenger can't sit in their seat
- Contribution to $f(n)$ is $(1/n) \times 0 = 0$
Case C: Passenger 1 sits in seat $i$ ($2 \leq i \leq n-1$)
- When passenger $i$ arrives, they'll choose randomly among remaining seats
- This creates the same scenario as with $n-1$ seats
- Contribution to $f(n)$ is $((n-2)/n) \times f(n-1)$
3. Mathematical Formulation
Putting it all together:
$$ f(n) = \frac{1}{n} + \frac{n-2}{n} f(n-1) $$4. Solving the Recurrence
- Base case: For $n = 2$, $f(2) = 1/2$ (trivial to verify)
- Assume $f(n-1) = 1/2$ for some $n \geq 3$
- Then: $f(n) = 1/n + (n-2)/n \times 1/2$
- Simplifying: $f(n) = 1/n + (n-2)/(2n) = (2 + n-2)/(2n) = n/(2n) = 1/2$
5. Conclusion
By induction, $f(n) = 1/2$ for all $n \geq 2$
Easy solution
The easy solution consists in making a slight change of perspective: when a new passenger arrives and finds their seat occupied, the passenger asks the occupier to move and choose another seat at random. Before we were following what happens to each passenger, but now we can focus only on the first passenger, who is the only one choosing seats randomly. This way we can see that the first passenger will keep being moved around until only two seats remain: seat 1 and seat 100. At this point, the first passenger will choose randomly between these two seats, giving a 50% probability that the last passenger gets their assigned seat.-
The second time was during Cantor’s diagonal proof. ↩