Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Euclidean algorithm
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Proof of validity === The validity of the Euclidean algorithm can be proven by a two-step argument.<ref>{{Harvnb|Stark|1978|pp=16β20}}</ref> In the first step, the final nonzero remainder {{math|''r''<sub>''N''β1</sub>}} is shown to divide both {{math|''a''}} and {{math|''b''}}. Since it is a common divisor, it must be less than or equal to the greatest common divisor {{math|''g''}}. In the second step, it is shown that any common divisor of {{math|''a''}} and {{math|''b''}}, including {{math|''g''}}, must divide {{math|''r''<sub>''N''β1</sub>}}; therefore, {{math|''g''}} must be less than or equal to {{math|''r''<sub>''N''β1</sub>}}. These two opposite inequalities imply {{math|1=''r''<sub>''N''β1</sub> = ''g''}}. To demonstrate that {{math|''r''<sub>''N''β1</sub>}} divides both {{math|''a''}} and {{math|''b''}} (the first step), {{math|''r''<sub>''N''β1</sub>}} divides its predecessor {{math|''r''<sub>''N''β2</sub>}} : {{math|1=''r''<sub>''N''β2</sub> = ''q''<sub>''N''</sub> ''r''<sub>''N''β1</sub>}} since the final remainder {{math|''r''<sub>''N''</sub>}} is zero. {{math|''r''<sub>''N''β1</sub>}} also divides its next predecessor {{math|''r''<sub>''N''β3</sub>}} : {{math|1=''r''<sub>''N''β3</sub> = ''q''<sub>''N''β1</sub> ''r''<sub>''N''β2</sub> + ''r''<sub>''N''β1</sub>}} because it divides both terms on the right-hand side of the equation. Iterating the same argument, {{math|''r''<sub>''N''β1</sub>}} divides all the preceding remainders, including {{math|''a''}} and {{math|''b''}}. None of the preceding remainders {{math|''r''<sub>''N''β2</sub>}}, {{math|''r''<sub>''N''β3</sub>}}, etc. divide {{math|''a''}} and {{math|''b''}}, since they leave a remainder. Since {{math|''r''<sub>''N''β1</sub>}} is a common divisor of {{math|''a''}} and {{math|''b''}}, {{math|''r''<sub>''N''β1</sub> β€ ''g''}}. In the second step, any natural number {{math|''c''}} that divides both {{math|''a''}} and {{math|''b''}} (in other words, any common divisor of {{math|''a''}} and {{math|''b''}}) divides the remainders {{math|''r''<sub>''k''</sub>}}. By definition, {{math|''a''}} and {{math|''b''}} can be written as multiples of {{math|''c''}}: {{math|1=''a'' = ''mc''}} and {{math|1=''b'' = ''nc''}}, where {{math|''m''}} and {{math|''n''}} are natural numbers. Therefore, {{math|''c''}} divides the initial remainder {{math|''r''<sub>0</sub>}}, since {{math|1=''r''<sub>0</sub> = ''a'' β ''q''<sub>0</sub>''b'' = ''mc'' β ''q''<sub>0</sub>''nc'' = (''m'' β ''q''<sub>0</sub>''n'')''c''}}. An analogous argument shows that {{math|''c''}} also divides the subsequent remainders {{math|''r''<sub>1</sub>}}, {{math|''r''<sub>2</sub>}}, etc. Therefore, the greatest common divisor {{math|''g''}} must divide {{math|''r''<sub>''N''β1</sub>}}, which implies that {{math|''g'' β€ ''r''<sub>''N''β1</sub>}}. Since the first part of the argument showed the reverse ({{math|''r''<sub>''N''β1</sub> β€ ''g''}}), it follows that {{math|1=''g'' = ''r''<sub>''N''β1</sub>}}. Thus, {{math|''g''}} is the greatest common divisor of all the succeeding pairs:<ref>{{harvnb|Knuth|1997|p=320}}</ref><ref name="Lovasz_2003">{{cite book | last1 = LovΓ‘sz |first1=L.|author1-link=LΓ‘szlΓ³ LovΓ‘sz|last2= PelikΓ‘n|first2=J.|last3=Vesztergombi|first3= K. |author3-link= Katalin Vesztergombi | year = 2003 | title = Discrete Mathematics: Elementary and Beyond | publisher = Springer-Verlag | location = New York | isbn = 0-387-95584-4 | pages = 100β101}}</ref> : {{math|1=''g'' = gcd(''a'', ''b'') = gcd(''b'', ''r''<sub>0</sub>) = gcd(''r''<sub>0</sub>, ''r''<sub>1</sub>) = ... = gcd(''r''<sub>''N''β2</sub>, ''r''<sub>''N''β1</sub>) = ''r''<sub>''N''β1</sub>}}.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)