Laboratory · Number theory
Hourglasses, Diophantine equations and Bézout
From minutes to the GCD: a mathematical proof and a physical protocol, one event at a time.
Read the collection of 12 problemsTry a problem from the collection
1. Find the GCD using Euclid
Initially a = 1a + 0b and b = 0a + 1b. For each new remainder subtract q times the divisor row from the dividend row: its coefficients become (u₀ − qu₁, v₀ − qv₁). The last nonzero remainder is the GCD.
| Division with remainder | The remainder as a combination of A and B |
|---|
2. Check divisibility
3. Bézout and a first solution
Multiply both coefficients by d/GCD:
4. All integer solutions
A negative coefficient means subtracting durations, not negative elapsed time or turning a glass “backwards”. Equation solutions alone are not instructions for operating the glasses.
5. Watch a verified protocol
If a glass of duration a has r minutes remaining, turning it leaves a − r minutes: the sand that already fell returns to the top.
A · min
Minutes remaining after the move
B · min
Minutes remaining after the move
Playback advances one event per second, not one real minute. Sand and remaining times show the state immediately after the move. You can also select table rows.
All events
| t (min) | Observed event | Move | Remaining A / B | Measurement |
|---|