Skip to main content

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:

a(modn)a \pmod{n}

Read as: "a mod n" or "a congruent to n"

This means:

"Take number a, divide by n, keep the remainder"

The Clock Equation

For our 12-hour clock:

result=a+b(mod12)\text{result} = a + b \pmod{12}

Or more generally:

result=ab(modn)\text{result} = a \bigstar b \pmod{n}

Where bigstar could be addition, multiplication, subtraction, etc.

Different "Clock Sizes"

We can have different sized clocks!

Clock SizeNumbersWhat It Means
mod 121, 2, ..., 12Regular clock
mod 100, 1, ..., 9Number keypad (0-9)
mod 170, 1, ..., 16ML-KEM uses mod 3329 (but 17 is easier to think about)
mod 2560, 1, ..., 255Computer 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:
  1. Draw a circle
  2. Write numbers 1-12 around it (like a clock)
  3. Pick a starting number (like 8)
  4. Draw an arrow "jumping" around the circle
  5. 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