Linear inequalities

4 frogs sit in a row. Every 5 seconds, two neighboring frogs switch places. Sometime after 80 seconds, but before 100 seconds, the frogs are seen to be in their original order. Is it possible to determine how many swaps were made?

The first thing I notice, is that 5, 80, and 100 are all divisible by 5. Instead of thinking in terms of 5 second increments, I want to think in terms of jumps. Dividing all numbers by 5 allows me to do that. Now we know we're looking for a jump \(j,\) such that \(16 \lt j \lt 20.\) We know that every jump will move a frog 1 position, because only adjacent frogs may swap. Because of this, every swap that moves a frog 1 unit away from his position, requires another swap to get 1 unit closer. This tells us the number of swaps must be even. But the only even number satisfying the inequality \(16 \lt j \lt 20,\) is \(j = 18.\) Thus, the number of jumps is 18.

Source: This problem comes from "The Inquisitive Problem Solver." I rewrote the solution.