Modular arithmetic facts for kids
Modular arithmetic is a special way of doing math with whole numbers. It's often called clock arithmetic because it works just like the hours on a clock. When the numbers reach a certain value, called the modulus, they "wrap around" and start over from zero.
Imagine a 12-hour clock. After 12 o'clock, the next hour is 1 o'clock, not 13 o'clock. This is modular arithmetic in action, with a modulus of 12.
People have used ideas similar to modular arithmetic for a very long time. Ancient cultures, like those who developed the Chinese remainder theorem, used these concepts centuries ago. The modern way we write and define modular arithmetic was first clearly explained by a famous mathematician named Carl Friedrich Gauss.
Contents
What is Congruence?
Modular arithmetic helps us understand the idea of congruence. Two whole numbers, let's call them a and b, are congruent modulo n if they have the same remainder when you divide them by a positive whole number n.
We write this idea like this:
Here, the number n is called the modulus.
Another way to think about congruence is this: a and b are congruent modulo n if their difference (a - b) can be divided exactly by n. This means n is a factor of (a - b).
An Example of Congruence
Let's look at an example to make it clearer:
- Failed to parse (Missing <code>texvc</code> executable. Please see math/README to configure.): 32 \equiv 11 \pmod 7\,
To check this, we divide 32 by 7. The remainder is 4 (because 32 = 4 × 7 + 4). Then, we divide 11 by 7. The remainder is also 4 (because 11 = 1 × 7 + 4). Since both numbers have the same remainder (4) when divided by 7, they are congruent modulo 7.
Using the other definition, we find the difference between 32 and 11: 32 - 11 = 21. Since 21 can be divided exactly by 7 (21 = 3 × 7), this also shows that 32 and 11 are congruent modulo 7.
How Modular Arithmetic is Used
Modular arithmetic is very useful in many different areas.
- Computer Science: It's used in RSA algorithm for secret codes and security. It also helps in testing if a number is prime.
- Everyday Life: It's often used to calculate checksums and check digits. These are special numbers that help make sure data, like numbers on a credit card or a book's ISBN, are correct.
- Music: Musicians even use it to understand 12-tone music.
Related pages
See also
In Spanish: Aritmética modular para niños