โฐ Clock Faces
How Numbers Can Circle Backโ
๐ฏ The Simple Storyโ
Imagine you're playing a game of tag on a circle of chairs. 12 numbered chairs in a ring.
When you count, you go: 1, 2, 3, ... 10, 11, 12 and then...
What's next?
12
/ \
11 1
| |
10 2
| |
9 3
\ /
8 4
\ /
7
|
6
/
5
If you're on chair 12 and need 2 more steps, you don't go to chair 13 or 14!
You land on: chair 2 (wrap back around!)
That's clock math - numbers that circle back around!
๐ง Mental Modelโ
Hold this picture in your head:
Clock Numbers Always Stay Inside 1-12
โโ 13 becomes 1
โโ 14 becomes 2
โโ 15 becomes 3
โโ 25 becomes 1 (25 = 12ร2 + 1)
โโ 37 becomes 1 (37 = 12ร3 + 1)
โโ 50 becomes 2 (50 = 12ร4 + 2)
Think of it like this:
๐ข Merry-Go-Round: No matter how many times around, you always land on one of the same 12 horses
๐ Circular track: After 1 lap, you're back where you started (but going faster!)
๐ See It Happenโ
Let's watch someone counting:
๐ฎ Try It Yourselfโ
Question 1: It's 11 o'clock. What time will it be after 4 hours?
Show Answer
11 + 4 = 15 steps
On a clock:
11 โ 12 (step 1)
12 โ 1 (step 2)
1 โ 2 (step 3)
2 โ 3 (step 4)
Answer: 3 o'clock
Math notation: 11 + 4 โก 3 (mod 12)
Question 2: What's 20 + 10 on a 12-hour clock?
Show Answer
20 + 10 = 30 total steps
How many full circles?
30 รท 12 = 2 full circles + 6 left over
After 2 full circles, you've visited every chair twice. Now just count the 6 leftovers from the start.
Answer: 6 (chair 6)
Math notation: 20 + 10 = 30 โก 6 (mod 12)
Question 3: It's 7 o'clock. Your friend says "I'll meet you in 25 hours." What time?
Show Answer
25 hours = ?
Divide: 25 รท 12 = 2 circles + 1 leftover
Or think:
Hour 0: 7
Hour 1: 8
Hour 2: 9
...
Hour 12: 7 (back to start!)
Hour 13: 8
Hour 24: 7 (full circle)
Hour 25: 8 (one more)
Answer: 8 o'clock
๐ข The Mathโ
What Is "Modular Arithmetic"?โ
Mathematicians write it like this:
Read as: "a mod n" or "a congruent to n"
This means:
"Take number
a, divide byn, keep the remainder"
The Clock Equationโ
For our 12-hour clock:
Or more generally:
Where bigstar could be addition, multiplication, subtraction, etc.
Different "Clock Sizes"โ
We can have different sized clocks!
| Clock Size | Numbers | What It Means |
|---|---|---|
| mod 12 | 1, 2, ..., 12 | Regular clock |
| mod 10 | 0, 1, ..., 9 | Number keypad (0-9) |
| mod 17 | 0, 1, ..., 16 | ML-KEM uses mod 3329 (but 17 is easier to think about) |
| mod 256 | 0, 1, ..., 255 | Computer bytes |
Why Different Sizes Matterโ
Small clock (mod 5):
0 โ 1 โ 2 โ 3 โ 4 โ 0 โ 1 โ ...
Wraps quickly! More collisions
Large clock (mod 3329):
0 โ 1 โ 2 โ ... โ 3328 โ 0 โ 1 โ ...
Wraps slowly! Fewer collisions
ML-KEM uses mod 3329 because:
- Large enough to keep numbers unique
- Small enough to be fast
- Special property:
3329 = 2^12 + 1(magic for optimization!)
๐ก Why We Careโ
Problem: How Do Computers Store Big Numbers?โ
Imagine someone tells you:
"I'm thinking of a number. It has 500 digits."
1234567890... (keep going 500 times!)
This is way too big to remember, right?
Solution: Clock Math Shrinks Numbersโ
With clock math (mod 3329):
That 500-digit number? โ
โ Divide by 3329, keep remainder
โ Result: 0 to 3328 (12 digits max!)
Result: Even crazy-big numbers become tiny (0-3328)!
Why This Helps ML-KEM Securityโ
This is the magic:
Different big numbers โ Same tiny number
Example mod 10:
10 โ 0 (after wrapping)
20 โ 0 (after wrapping)
30 โ 0 (after wrapping)
100 โ 0 (after wrapping)
1000 โ 0 (after wrapping)
Attackers see "0" but can't tell which input!
Many secrets map to same result โ Impossible to reverse!
โ Quick Checkโ
Can you explain this to a 5-year-old?
Try saying this out loud:
"Imagine you're running around a circular track with 12 marked spots. No matter how many steps you take, you always end up on one of those same 12 spots. You might take 10 steps, or 100 steps, or 1000 steps โ you'll still land on one of the 12 spots. It's like the numbers keep going in a big circle instead of a straight line!"
Can you draw a picture?
Draw this:
- Draw a circle
- Write numbers 1-12 around it (like a clock)
- Pick a starting number (like 8)
- Draw an arrow "jumping" around the circle
- Show where you land after different step counts
๐ Key Takeawaysโ
โ Clock math = Numbers that circle back around โ "Mod n" = Divide by n, keep the remainder โ Clock size 12 โ Numbers wrap every 12 steps โ Clock size 3329 โ Numbers wrap every 3329 steps (ML-KEM uses this!) โ Security benefit = Many inputs produce same output (confuses attackers) โ Mental model = Merry-go-round or circular track
๐ What You'll Learn Nextโ
Now you understand clock math! Next, we'll learn about:
Dots on Graph Paper โ Lattice Basics
How grid points form the foundation of ML-KEM's security!