L5 (Extended Euclid and Mod Division) Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

How do we verify that a number ‘d’ is the GCD of ‘a’ and ‘b’?

A

We use the following property:

if d divides both a and b (with no remainder), and
d = ax + by

for some integers x and y, then

d = GCD(a, b)

note: x or y can be negative

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Write out the Extended Euclid algorithm.

Input should be two integers a and b

Output should be (x,y,d) such that:
d = GCD(a, b)
and
d = ax + by

A

Base case is b = 0
Recurse on Extended-Euclid of b and a mod b

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the condition for the extended-euclid algorithm to be correct?

A

For any positive integers a, and b, the extended-euclid algorithm is correct

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the 3 steps in mathematical induction?

We want to show that a statement S(k) holds for all integers k >= 0

A

Step 1 (base case): Show that S(0) holds

Step 2: Assume that S(k’) holds

Step 3 (inductive step):
Show that if S(k’) holds, then S(k’+1) must also hold

By going this, the S(k) statement must hold by induction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Define what it means for an integer x to be multiplicative inverse of a modulo N?

A

x is the multiplicative inverse of a modulo N if:

a*x ≡ 1 (mod N)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Integer a has a multiplicative inverse modulo N

What does this imply?

A

This implies that the greatest common denominator of a and N is 1:

GCD(N, a) = 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does it mean for two numbers for be co-prime?

A

Two numbers are co-prime (or relatively prime) if their greatest common divisor is 1

gcd(a, b) = 1

They do not have any common factors other than 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the exponential property of modular exponentiation?

A

(a^b) mod N = (a mod N)^b

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the modular division theorem?

A

For any integer a in {0, 1, … N-1}, or (a < N). a has a multiplicative inverse mod N if an only if GCD(N, a) =1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

If a multiplicative inverse exists for N and a, how would it be found?

How long would it take?

A

To find the inverse, run the extended-euclid algorithm on N and a:

(x, y, d) = extended-euclid(N, a)

and then y mod N would be the multiplicative inverse of a and N

it would take O(n^3) time where n is the number of bits in a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly