Discrete Mathematics — Logic & Number Theory
Modular arithmetic & GCD
continues from lesson 2 — values defined earlier in the course stay live here
ELI5: modular arithmetic is clock math — after 12 it wraps to 1. "17 mod 5" is the remainder, 2. The greatest common divisor gcd(a, b) is the largest number dividing both. Both are engine built-ins.
= 15:00 plus 20 hours, on a 24-hour clock: 11:00
= largest tile that paves a 48×36 floor: 12
✓ pass the wrap-around and the common divisor
Real-world hook: modular arithmetic powers cryptography (RSA, hashing), check digits on credit cards & ISBNs, and anything cyclic — days of the week, clock faces, circular buffers.
Try it yourself: on a 24-hour clock, what time is it 20 hours after 15:00? (Use mod(15 + 20, 24).)
= ✏️ Your turn: wrap 15 + 20 around a 24-hour clock with mod(…, 24).
✓ pass green when your clock math wraps correctly