Modular Arithmetic
In this section we will learn more about modular arithmetic, including how it interacts with addition, subtraction, multiplication and division. These are mostly straightforward, except for division. We’ll leave that one for later.
Watch the video and then answer the questions below.
Twelve-minute video
You can also view this video on YouTube
Key Points
- Modlar arithmatic applies to integers. For example, arithmatic modulo 4 just uses the numbers
{0, 1, 2, 3}
- Moduar arithmetic introduces the congruance relation. It is written using a triple equals symbol
≡
. - Numbers are congruant modulo
n
, if after finding their modulus withn
, you get the same answer. For example1
and7
are congruant modulo 6, and13
and23
are congruant modulo 10.
Properties of Relations
- A relation
R
is reflexive if it is always true thata R a
, no matter whata
is. - A relation
R
is symmetric if froma R b
you can inferb R a
. - Given a relation
R
, say you know thata R b
andb R c
are both true. IfR
is transitive, then you can infera R c
.
Additivity and Multiplicativity
- Both equality
=
and the congruance relation≡
are additive and multiplicative. - Additivity means you can add the same value to both sides of an equation.
- Multiplicativity means that you can multiply both sides of an equation by the same value.
- With modular arithmatic, because you can add or multiply values that are not equal, so long as they are congruant.
- If you know
a ≡ b
andc ≡ d
, you can infer thata + c ≡ b + d
- If you know
a ≡ b
andc ≡ d
, you can infer thata * c ≡ b * d
Simplifying modular expressions
You can simplify modular expressions in the following way, if the modulus is the same:
(a mod n) + (b mod n) = (a+b) mod n
(a mod n) - (b mod n) = (a+b) mod n
(a mod n) x (b mod n) = (a+b) mod n
.
Questions
1. Check your understanding
1. Simplifying modular expressions
Rewrite the following into the form: a mod b
2. Relations
Check all those properties that hold of the given relation.
Relation | Reflexive | Symmetric | Transitive |
---|---|---|---|
> (greater than) |
|||
≥ (greater or equal to) |
|||
≡ (congruant modulo n) |
|||
= (equals) |
|||
“is standing next to” | |||
“is twice as tall as” |
Summary
In this section we have learned about various properties of arithmatic and modular arithmetic.
- You should understand and be able to classify relations as reflexive, symmetric, and transitive
- You should be able to work with addition, subtraction and multiplication in modular arithmetic.
In the next section we will learn about modular division, using the modular inverse
- Previous
- Next