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!
=== Extended Euclidean algorithm === {{Main|Extended Euclidean algorithm}} The integers {{math|''s''}} and {{math|''t''}} of BΓ©zout's identity can be computed efficiently using the [[extended Euclidean algorithm]]. This extension adds two recursive equations to Euclid's algorithm<ref>{{Harvnb|Rosen|2000|pp=90β93}}</ref> : {{math|1=''s''<sub>''k''</sub> = ''s''<sub>''k''β2</sub> β ''q''<sub>''k''</sub>''s''<sub>''k''β1</sub>}} : {{math|1=''t''<sub>''k''</sub> = ''t''<sub>''k''β2</sub> β ''q''<sub>''k''</sub>''t''<sub>''k''β1</sub>}} with the starting values : {{math|1=''s''<sub>β2</sub> = 1, ''t''<sub>β2</sub> = 0}} : {{math|1=''s''<sub>β1</sub> = 0, ''t''<sub>β1</sub> = 1}}. Using this recursion, BΓ©zout's integers {{math|''s''}} and {{math|''t''}} are given by {{math|1=''s'' = ''s''<sub>''N''</sub>}} and {{math|1=''t'' = ''t''<sub>''N''</sub>}}, where {{math|''N'' + 1}} is the step on which the algorithm terminates with {{math|1=''r''<sub>''N''+1</sub> = 0}}. The validity of this approach can be shown by induction. Assume that the recursion formula is correct up to step {{math|''k'' β 1}} of the algorithm; in other words, assume that : {{math|1=''r''<sub>''j''</sub> = ''s''<sub>''j''</sub> ''a'' + ''t''<sub>''j''</sub> ''b''}} for all {{math|''j''}} less than {{math|''k''}}. The {{math|''k''}}th step of the algorithm gives the equation : {{math|1=''r''<sub>''k''</sub> = ''r''<sub>''k''β2</sub> β ''q''<sub>''k''</sub>''r''<sub>''k''β1</sub>}}. Since the recursion formula has been assumed to be correct for {{math|''r''<sub>''k''β2</sub>}} and {{math|''r''<sub>''k''β1</sub>}}, they may be expressed in terms of the corresponding {{math|''s''}} and {{math|''t''}} variables : {{math|1=''r''<sub>''k''</sub> = (''s''<sub>''k''β2</sub> ''a'' + ''t''<sub>''k''β2</sub> ''b'') β ''q''<sub>''k''</sub>(''s''<sub>''k''β1</sub> ''a'' + ''t''<sub>''k''β1</sub> ''b'')}}. Rearranging this equation yields the recursion formula for step {{math|''k''}}, as required : {{math|1=''r''<sub>''k''</sub> = ''s''<sub>''k''</sub> ''a'' + ''t''<sub>''k''</sub> ''b'' = (''s''<sub>''k''β2</sub> β ''q''<sub>''k''</sub>''s''<sub>''k''β1</sub>) ''a'' + (''t''<sub>''k''β2</sub> β ''q''<sub>''k''</sub>''t''<sub>''k''β1</sub>) ''b''}}.
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)