1. The Euclidean Algorithm 2. The Fundamental Theorem of Arithmetic's

15
MelikyanElem Numb Theory/Fall05 1. The Euclidean Algorithm 2. The Fundamental Theorem of Arithmetic's Instructor: Hayk Melikyan [email protected]

description

1. The Euclidean Algorithm 2. The Fundamental Theorem of Arithmetic's. Instructor: Hayk Melikyan [email protected]. Proof:. Example: (963, 657). So, (963, 657) = 9. Example: (450, 198)= ?. j r j r j+1 q j+1 r j+2 0 450 198 2 54 - PowerPoint PPT Presentation

Transcript of 1. The Euclidean Algorithm 2. The Fundamental Theorem of Arithmetic's

Page 1: 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]

Page 2: 1.  The  Euclidean Algorithm    2. The Fundamental Theorem of Arithmetic's

2MelikyanElem Numb Theory/Fall05

Page 3: 1.  The  Euclidean Algorithm    2. The Fundamental Theorem of Arithmetic's

3MelikyanElem Numb Theory/Fall05

Proof:

Page 4: 1.  The  Euclidean Algorithm    2. The Fundamental Theorem of Arithmetic's

4MelikyanElem Numb Theory/Fall05

Example: (963, 657)

So, (963, 657) = 9

Page 5: 1.  The  Euclidean Algorithm    2. The Fundamental Theorem of Arithmetic's

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

Page 6: 1.  The  Euclidean Algorithm    2. The Fundamental Theorem of Arithmetic's

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

Page 7: 1.  The  Euclidean Algorithm    2. The Fundamental Theorem of Arithmetic's

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)

Page 8: 1.  The  Euclidean Algorithm    2. The Fundamental Theorem of Arithmetic's

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

Page 9: 1.  The  Euclidean Algorithm    2. The Fundamental Theorem of Arithmetic's

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

Page 10: 1.  The  Euclidean Algorithm    2. The Fundamental Theorem of Arithmetic's

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

Page 11: 1.  The  Euclidean Algorithm    2. The Fundamental Theorem of Arithmetic's

11MelikyanElem Numb Theory/Fall05

Extended Euclidean Algorithm(second version)

Page 12: 1.  The  Euclidean Algorithm    2. The Fundamental Theorem of Arithmetic's

12MelikyanElem Numb Theory/Fall05

Example

Page 13: 1.  The  Euclidean Algorithm    2. The Fundamental Theorem of Arithmetic's

13MelikyanElem Numb Theory/Fall05

Page 14: 1.  The  Euclidean Algorithm    2. The Fundamental Theorem of Arithmetic's

14MelikyanElem Numb Theory/Fall05

Page 15: 1.  The  Euclidean Algorithm    2. The Fundamental Theorem of Arithmetic's

15MelikyanElem Numb Theory/Fall05