1. The Euclidean Algorithm 2. The Fundamental Theorem of Arithmetic's
-
Upload
cocheta-green -
Category
Documents
-
view
23 -
download
2
description
Transcript of 1. The Euclidean Algorithm 2. The Fundamental Theorem of Arithmetic's
1MelikyanElem Numb Theory/Fall05
1. The Euclidean Algorithm
2. The Fundamental Theorem of Arithmetic's
Instructor: Hayk [email protected]
2MelikyanElem Numb Theory/Fall05
3MelikyanElem Numb Theory/Fall05
Proof:
4MelikyanElem Numb Theory/Fall05
Example: (963, 657)
So, (963, 657) = 9
5MelikyanElem Numb Theory/Fall05
Example: (450, 198)= ?
450 = 2*198 + 54
198 = 3*54 + 36
54 = 1*36 + 18
36 = 2*18
j rj rj+1 qj+1 rj+2
0 450 198 2 54 1 198 54 3 36 2 54 36 1 18 3 36 18 2 0
6MelikyanElem Numb Theory/Fall05
As a Linear Combination
18 = 54 - 1*36 = 1*54 – 1*(198 – 3*54) = 4*54 -1*198 = 4*(450 – 2 *198) – 1*(198) = 4*450 + (-9)*178So 18 = 450*x0 + 198*y0
Where x0 = 4 and y0 = -9
7MelikyanElem Numb Theory/Fall05
Extended Euclidean AlgorithmIn general to see how d = (a, b) may be expressed as a linear
combinationof a and b we traverse the EA backward.
rn = (a, b) = rn-2 - rn-1 qn-1
If we substitute rn-1 from the second ( bottom) equation, we will find that
rn-1 = rn-3 - rn-2 qn-2
therefore
(a, b) =( 1 – qn-1qn-2) rn-2 - qn-1 rn-3
If we continue working backward trough the steps of EA we will express(a, b) as a linear combination of a (r0) and b (r1)
8MelikyanElem Numb Theory/Fall05
If at some step we have (a, b) = srj + trj -1
Then, since rj = rj-2 - rj-1 qj-1
After substitution
(a, b) = s(rj-2 - rj-1 qj-1 ) + trj -1
= (t – sqj-1)rj-1 + srj-2
9MelikyanElem Numb Theory/Fall05
Theorem 13*. Let a, b Z+. Then
(a, b) = sna + tnb
for some n Z+, where sn, tn are the nth terms of the sequence recursively defined by
s0 = 1, t0 = 0, s1 = 0, t1 = 1and
sj = sj-2 – qj-1sj-1, tj = tj-2 – qj-1tj-1
for j = 2, 3, …, n where qj are the quotients in the DA
when it is used for a and b
10MelikyanElem Numb Theory/Fall05
Example: gcd (450, 198)
j rj rj+1 qj+1 rj+2 sj tj
0 450 198 2 54 10
1 198 54 3 36 01
2 54 36 1 18 1 -2
3 36 18 2 0 3 7
4 -9
sj = sj-2 – qj-1sj-1, tj = tj-2 – qj-1tj-1
11MelikyanElem Numb Theory/Fall05
Extended Euclidean Algorithm(second version)
12MelikyanElem Numb Theory/Fall05
Example
13MelikyanElem Numb Theory/Fall05
14MelikyanElem Numb Theory/Fall05
15MelikyanElem Numb Theory/Fall05