Professional Documents
Culture Documents
Untitled Document
Untitled Document
Untitled Document
19 october 2022
SIT192
Euclidean Algorithm
We can compute the gcd between two numbers a and b using the Euclidean algorithm. If b > a,
then the algorithm is rem(b ÷ a) = r1
rem(a ÷ r1) = r2
rem(r1 ÷ r2) = r3
⋮⋮
until we reach ri+1 = 0. Then ri is the gcd.
Theorem- If a ≡ c (mod p) and b ≡ d (mod p), then:
a + b ≡ c + d (mod p)
a ⋅ b ≡ c ⋅ d (mod p).
Bézout’s lemma
The Euclidean algorithm and Bézout’s lemma are the building blocks of our
theory. For any integers a and b, if gcd(a,b) = c, there exist numbers m and
n such that m ⋅ a + n ⋅ b = c.
In particular, a and b are relatively prime if (and only if) there are numbers
m and n such that m ⋅ a + n ⋅ b = 1.
Extended Euclidean Algorithm
The extended Euclidean algorithm is a version of the Euclidean algorithm,
which can be used to find Bézout’s coefficients. We do that by keeping
track of the substitution as we progress.
Modular Inverse
Fermat’s little Theorem- For a prime number p, and a number a not divisible by
p, a^p ≡ a (mod p)
For example-
ANS.
1. 3 = 3 (mod 13)
2. 3 = 6 (mod 13)
PROOF:-
1. rk cannot be 0. Otherwise, k ⋅ a is a multiple of p. Since p is prime, either k
or a is a multiple of p. But a was chosen to not be one, and k is too small!
2. If k ≠ j, rk − rj cannot be 0. Otherwise, (k− j)⋅ a is a multiple of p. For the
same reason as before, this is not possible.
3. So, we have p − 1 numbers, all different, and all between 1 and p − 1. So,
each number appears once.
4. In other words, the sets are equal: {rk ∶ k = 1...p−1} = {k ∶ k = 1...p−1}.
Then, a^p = a (mod p)
3. So, we have all φ(p) numbers from S, each number appearing once.
rem(4042 ÷ 40) = 2.
≡ 20 mod 41
Calculating powers.
Suppose that gcd(a,p) = 1. Then, to calculate a^m mod p (typically when m
1. Divide m by p m = φ(p) × k + r.
The most significant lesson I took away from this module. (Euler's
theorem, Fermat's theorem) Theorems. Additionally, the modular
inverse and Bezout's lemma caught my attention .
The Euclidean algorithm, gcd, and lcm are topics that we are
acquainted with; nevertheless, one new concept to me is the modular
inverse.
3. Why do you think your course team wants you to learn the
content of this module?
REFERENCES-
1. Class notes
2. Discrete Mathematics by Oscar Levin.
3. Notes on Discrete Mathematics by
James Aspnes.
2) learning evidences as follows-