Modular arithmetic
Finding the modulus
The modulus is the remainder when one number is divided by another.
It’s using represented using the modulus operator, often written as
Evaluate 7 \mod 4
To find
7 \div 4 = 1 with a remainder of3 .- Answer:
7 \mod 4 = 3 .
Expressing modular binary operators
- We can write the modular arithmetic form of a binary operator using a subscript.
- For example, mod-5 addition would look like this:
a +_5 b
Modular addition
To find the modular addition of two numbers:
Evaluate (5 + 9) \mod 6
5 + 9 = 14 .14 \mod 6 = 2 (since14 \div 6 = 2 with a remainder of2 ).- Answer:
2
Evaluate (12 + 8) \mod 7
12 + 8 = 20 .20 \mod 7 = 6 (since20 \div 7 = 2 with a remainder of6 ).- Answer:
6
Evaluate 15 +_4 10
15 + 10 = 25 .25 \mod 4 = 1 (since25 \div 4 = 6 with a remainder of1 ).- Answer:
1
flashcards
| Question | Answer |
|---|---|
| What is the modulus in modular arithmetic? | The remainder when one number is divided by another. |
| How is the modulus operator commonly represented? | |
| Evaluate | |
| How can we express a modular binary operator like mod-5 addition? | |
| Describe the steps for modular addition. | 1. Add the two numbers together. 2. Find the modulus of the sum with respect to a given modulus. |
| Evaluate | |
| Evaluate | |
| Evaluate |