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=aโ˜…b(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


๐ŸŽ‰ 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!