Presentation is loading. Please wait.

Presentation is loading. Please wait.

MAT 320 Spring 2008 Section 1.2.  Start with two integers for which you want to find the GCD. Apply the division algorithm, dividing the smaller number.

Similar presentations


Presentation on theme: "MAT 320 Spring 2008 Section 1.2.  Start with two integers for which you want to find the GCD. Apply the division algorithm, dividing the smaller number."— Presentation transcript:

1 MAT 320 Spring 2008 Section 1.2

2  Start with two integers for which you want to find the GCD. Apply the division algorithm, dividing the smaller number into the larger.  Example: a = 320, b = 296.  320 = 296 · 1 + 24  The first quotient is q 0 and the first remainder is r 0.

3  If you get a remainder of 0, stop. If not, the divisor from the previous step becomes the dividend of the next step. The remainder from the previous step becomes the divisor of the previous step.  320 = 296 · 1 + 24  296 = 24 · 12 + 8  Continue until you get a remainder of 0.

4  320 = 296 · 1 + 24  296 = 24 · 12 + 8  24 = 8 · 3 + 0  We get a remainder of 0, so we stop. The last nonzero remainder is the GCD, so (320, 296) is equal to 8.

5  Compute (346, 592).  592 = 346 · 1 + 246  346 = 246 · 1 + 100  246 = 100 · 2 + 46  100 = 46 · 2 + 8  46 = 8 · 5 + 6  8 = 6 · 1 + 2  6 = 2 · 3 + 0  So (346, 592) = 2.

6  We can use the Euclidean Algorithm to find the integers U and V from Bézout’s Theorem.  As an example, let’s use the Euclidean Algorithm to show that (324, 148) = 4.  324 = 148 · 2 + 28  148 = 28 · 5 + 8  28 = 8 · 3 + 4  8 = 4 · 2 + 0

7  We want to find integers U and V such that 4 = 324U + 148V.  Take all of the equations (except the last one) and solve for the remainder.  28 = 324 – 148 · 2  8 = 148 – 28 · 5  4 = 28 – 8 · 3

8  Notice that the last equation expresses 4 as a linear combination of 28 and 8.  4 = 28 · 1 + 8 · (-3)  This is not what we want, however. So we use the previous equation (which has been solved for 8) to substitute.

9  4 = 28 · 1 + (148 – 28 · 5) · (-3)  Now we want to rearrange this so that 4 is expressed as a linear combination of 28 and 148 (still not quite what we want, but getting closer)  We get 4 = 28 · 16 + 148 · (-3)

10  Now use the previous equation (which has been solved for 28) to substitute.  We get 4 = (324 – 148 · 2) · 16 + 148 · (-3)  Once again, multiply out and rearrange until we get 4 expressed as a linear combination of 324 and 148.  4 = 324 · 16 + 148 · (-35)

11  Use the Euclidean Algorithm to show that (15, 36) = 3.  Use back-substitution to find integers U and V so that 3 = 15U + 36V.


Download ppt "MAT 320 Spring 2008 Section 1.2.  Start with two integers for which you want to find the GCD. Apply the division algorithm, dividing the smaller number."

Similar presentations


Ads by Google