# The Cali Garmo

does Math

## Modulo

By Cali G , Published on Mon 14 December 2009
Category: blog / number theory

Modulo! Mod you who? Modulo: A complicated way to say the remainder when you divide two numbers!

So what is modulo exactly and how does it work? The easiest way to break it down is to look at an equation: $a \equiv \emph{b mod m}$

What this means is that basically if you take a and divide m then you get a remainder of b. Let's try a few examples to understand it better. Say $a = 10$ and $m = 7$. Then $\frac{10}{7} = 1 \cdot 7 + 3$ So $b = 3$. Therefore we have the modulo equation: $10 \equiv \emph{3 mod 7}$ We can do the same with negative numbers! Let $a = -5$ and let $m = 7$ again. So now we have: $\frac{-5}{7} = -1 \cdot 7 + 2$. So we have $b = 2$ and $-5 \equiv \emph{2 mod 7}$

Well, that was simple you may be thinking, but when would I use stuff like this in real life?! We actually use it DAILY without even knowing it! Want a quick example? Just look at a clock. What happens after you hit 12:59 (or 23:59 for some of you)? It goes straight to 1:00 (or 0:00). We use modulo to keep track of time! If its 3:00 right now and we go 30 hours in the future, then what time is it? Well we have $a = 30 + 3$ and $m = 12$ Then $\frac{33}{12} = 2 \cdot 12 + 9$ (or) $\frac{33}{24} = 1 \cdot 24 + 9$ and we have that the time is b which is 9!

What else can we do with modulo in the world of mathematics? Well it turns out that with such a simple concept we can actually compose a whole lot of theorems! Here are some theorems to keep you entertained. If you dare, try and prove them! (Note for those who try and attempt these, proofs require additional knowledge in division and how certain numbers divide other numbers.)

Theorem 1: Let a, b, l and m be integers and let l and m be greater than 0. Now let $a \equiv \emph{b mod m}$. With this information we can show that $a^{l} \equiv b^{l} \emph{ mod m}$

Theorem 2 (By John Wilson): Let p be prime. Then $(p - 1)! \equiv \emph{-1 mod p}$

Theorem 3 (By Fermat): Let p be prime and a be a whole number that is not divisible by p. Then $a^{p - 1} \equiv \emph{1 mod p}$

These theorems go on and on and there are hundreds that span from the concept of modulo. In the real world we also use modulo when it comes to creating/breaking codes, ISBN numbers, computer programming languages, and a ton of other places you probably never thought of!

For a good introduction to these types of numbers look to the following book: Elementary Number Theory and its applications by Kenneth H. Rosen (AT&T, 2005)