This preview shows pages 1–2. Sign up to view the full content.
Introduction
Modular Arithmetic
Discrete Mathematics
Andrei Bulatov
Discrete Mathematics – Modular Arithmetic II
332
Previous Lecture
Relatively prime, Euler’s totient function
Congruences
Residues
Residues and arithmetic operations
Discrete Mathematics – Modular Arithmetic II
333
Residues
(cntd)
The
residue
of an integer
a
modulo
m
is such a number
b
that
a
≡
b (mod m)
and
0
≤
b < m
In other words the residue of
a
modulo
m
is the remainder of
a
when divided by
m
Let
denote the set
{0,1,2,…,n – 1}.
This is the set of all
possible remainders of integers when divided by
n
It is called the
set of residues
,
and its members are called
residues
n
Z
Discrete Mathematics – Modular Arithmetic II
334
Modular Arithmetic
We define addition, subtraction, and multiplication of residues:
Let
a,b
∈
.
Then
a + b (mod n)
is the element
c
∈
such that
c
≡
a + b (mod n)
a – b (mod n)
is the element
c
∈
such that
c
≡
a – b (mod n)
a
⋅
b (mod n)
is the element
c
∈
such that
c
≡
a
⋅
b (mod n)
Example.
Construct operation tables for
n
Z
n
Z
n
Z
n
Z
5
Z
+
0
1
2
3
4
0
1
2
3
4
⋅
0
1
2
3
4
0
1
2
3
4
0
1
2
3
4
1
2
3
4
0
2
3
4
0
1
3
4
0
1
2
4
0
1
2
3
0
0
0
0
0
0
1
2
3
4
0
2
4
1
3
0
3
1
4
2
0
4
3
2
1
Discrete Mathematics – Modular Arithmetic II
335
Applications:
Criptography
One of the oldest cryptosystems is the Caesar cipher.
He made messages secret by shifting each letter
three letters forward.
Thus
B
becomes
E,
and
X
is sent to
A
To express this process mathematically we first
replace letters by integers from
0
to
25. For example,
A
is replaced by
0,
K
by 10.
Next, to encrypt a message we add 3 modulo 25 to every letter.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview. Sign up
to
access the rest of the document.
 Spring '10
 AndreiBulatov

Click to edit the document details