# Modular Arithmetic and Riemann surfaces

I sometimes believe I am the only one who doesn’t know this stuff…

Modular Arithmetic and Primes - Some of this I almost knew but these visualizations made it me go “hmm cool”. Numbers are so weird.

Riemann surfaces. I’ve never really stuck my nose into imaginary numbers. Coloring, riemann surfaces, 4 dimensional graphs. So very pretty.

6 Likes

Robert, what are “modular” arithmetic?

2 Likes

watch the videos

2 Likes

Like a clock. Add 12 hours to the time on the clock and it does doesn’t change the time. That’s modulo 12 arithmetic.

4 Likes

Thanks @zvuv

But it is useful for mental calculation?

I think not.

1 Like

Yes it is indeed… Watchey the vidyo.
fermat’s little theorem is a thriller.

1 Like

I will watch this tomorrow in the library. Im with a neighboor’s Internet connection

1 Like

In calendar calculation you do mod 7 all the time. Say you want to know the weekday for:

Oct 9, 2047

• 0 for the century (20)
• 2 for the year (47)
• 6 for the month (Oct)
• 9 for the day

The sum is 17 but you only have 7 weekdays, so you do 17 mod 7 = 3 (Wednesday). It’s the same as saying 17 ÷ 7 = 2 remainder 3 if you prefer.

5 Likes

O.o

Amazing!

1 Like

Yes! Very.

In the video for example you learn that taking the modulo of a number multiplied by the modulo of another number is the same as the taking the modulo of the answer of the multiplication.

An example with modulo 9:
98 * 24 = 2352
98 module 9 = 8
24 modulo 9 = 6
8 * 6 = 48

48 modulo 9 = 3
2352 modulo 9 = 3

now with modulo 11:
98 * 24 = 2352
98 module 11 = 10
24 modulo 11 = 2
10 * 2 = 20

20 modulo 11 = 9
2352 modulo 11 = 9

Why is this useful? Because we can check the answer this way.
Because if our answer of a multiplication is correct, then the modulo of the answer is the same number as the modulo of the two numbers multiplied.
In general this is a quick procedure.

Also; doing the modulo 9 is very easy.
2352 mod 9 = 3 because 2+3+5+2 = 12 and 1+2 = 3
So just add the digits together and you are done. If the sum is bigger than 9, just keep adding the digits together, like I did above with ‘12’.

Doing the modulo 11 takes a bit more time. I just subtract multiples of 11 from the answer. There is a quicker way, but I personally don’t like that way.

2352 mod 11 = 9 because
2352 - 2200 = 152 and 152-110 = 42 and 42 - 33 = 9

4 Likes

Why all these skills aren’t taught in school is a mistery to me.

3 Likes

They used to be. I learned it from my father, who learned it in high school.

Back in the day, he used to calculate on paper. There were no computers to help.
Being able to check your work was extremely handy.

1 Like

It is odd how 1 + 1 + 1… turns into so many pretty things. Our selection of base 10 was fairly random and is its own kind of wheel. When you look at translating between bases interesting things happen. When the bases are prime more interesting things happen. I need to learn a lot more math but things like this give simple folk like me a great taste. Whether there are parallel ideas in the complex numbers is beyond me but given my ignorance, I suspect there might be.

2 Likes

Give me some time to write about the complex numbers.
you will then immediately understand the rainbow coloured graph from the video.

Now my mind is still at modulo calculation and logarithms

2 Likes

Let’s have some more fun with modulo calculation.

What is (5^{25} \mod 3)?

We can calculate 5^{25} and after that start casting out 3’s. A lot of work.

However; we can start by casting out a 3 before we start raising it to the 25th power. 5 - 3 = 2, so

(5^{25} \mod 3) = (2^{25} \mod 3)

Calculating 2^{25} is still a lot of work. Can we do better. Well, yes!
We can cast out another 3:
2 - 3 = -1

({2}^{25} \mod 3) = ({-1}^{25} \mod 3)

{-1}^{25} = -1 because -1 to any even power is 1 and -1 to any odd power is -1.

Let’s take a step back. What does {-1} \mod 3 mean?
The modulo of a number is the remainder after division.
The remainder of 11 / 3 is 2 because we can repeatedly subtract 3 from 11 and get: 11, 8, 5, 2.
If we continued the repetition we would get: 11, 8, 5, 2, -1, -4, -7, etc.

The modulo is the lowest, positive number below the number we divide by.
In the range 11, 8, 5, 2, -1, -4, -7, … the modulo 3 is 2.

In plain English, if we get a negative number, we have casted out too many 3’s. We have subtracted too many 3’s.
So put one 3 back: -1 + 3 = 2.

TLDR;
5^{25} \mod 3 = 2

5 Likes