https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Extended_Euclidean_algorithm Extended Euclidean algorithm - Revision history 2025-05-30T06:58:17Z Revision history for this page on the wiki MediaWiki 1.45.0-wmf.3 https://en.wikipedia.org/w/index.php?title=Extended_Euclidean_algorithm&diff=1285730579&oldid=prev D.Lazard: /* Simplification of fractions */ fixing minus 2025-04-15T12:32:32Z <p><span class="autocomment">Simplification of fractions: </span> fixing minus</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 12:32, 15 April 2025</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 192:</td> <td colspan="2" class="diff-lineno">Line 192:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> '''if''' {{math|1=''s'' = 0}} '''then output''' "Division by zero"</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> '''if''' {{math|1=''s'' = 0}} '''then output''' "Division by zero"</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> '''if''' {{math|1=''s'' &lt; 0}} '''then''' {{math|1=''s'' := −''s''}}; {{math|1=''t'' := −''t''}} (''for avoiding negative denominators'')</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> '''if''' {{math|1=''s'' &lt; 0}} '''then''' {{math|1=''s'' := −''s''}}; {{math|1=''t'' := −''t''}} (''for avoiding negative denominators'')</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> '''if''' {{math|1=''s'' = 1}} '''then output''' {{math|<del style="font-weight: bold; text-decoration: none;">-</del>''t''}} (''for avoiding denominators equal to'' 1)</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> '''if''' {{math|1=''s'' = 1}} '''then output''' {{math|<ins style="font-weight: bold; text-decoration: none;">−</ins>''t''}} (''for avoiding denominators equal to'' 1)</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> '''output''' {{math|{{sfrac|<del style="font-weight: bold; text-decoration: none;">-</del>''t''|''s''}}}}</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> '''output''' {{math|{{sfrac|<ins style="font-weight: bold; text-decoration: none;">−</ins>''t''|''s''}}}}</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The proof of this algorithm relies on the fact that {{math|''s''}} and {{math|''t''}} are two coprime integers such that {{math|1=''as'' + ''bt'' = 0}}, and thus &lt;math&gt;\frac{a}{b} = -\frac{t}{s}&lt;/math&gt;. To get the canonical simplified form, it suffices to move the minus sign for having a positive denominator.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The proof of this algorithm relies on the fact that {{math|''s''}} and {{math|''t''}} are two coprime integers such that {{math|1=''as'' + ''bt'' = 0}}, and thus &lt;math&gt;\frac{a}{b} = -\frac{t}{s}&lt;/math&gt;. To get the canonical simplified form, it suffices to move the minus sign for having a positive denominator.</div></td> </tr> </table> D.Lazard https://en.wikipedia.org/w/index.php?title=Extended_Euclidean_algorithm&diff=1285730222&oldid=prev D.Lazard: Reverted 1 edit by Cedar101 (talk): Uneplained change from math format to row html 2025-04-15T12:28:58Z <p>Reverted 1 edit by <a href="/wiki/Special:Contributions/Cedar101" title="Special:Contributions/Cedar101">Cedar101</a> (<a href="/wiki/User_talk:Cedar101" title="User talk:Cedar101">talk</a>): Uneplained change from math format to row html</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 12:28, 15 April 2025</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 190:</td> <td colspan="2" class="diff-lineno">Line 190:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Simplification of fractions==</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Simplification of fractions==</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>A fraction {{math|{{sfrac|''a''|''b''}}}} is in canonical simplified form if {{math|''a''}} and {{math|''b''}} are [[coprime]] and {{math|''b''}} is positive. This canonical simplified form can be obtained by replacing the three output lines of the preceding pseudo code by </div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>A fraction {{math|{{sfrac|''a''|''b''}}}} is in canonical simplified form if {{math|''a''}} and {{math|''b''}} are [[coprime]] and {{math|''b''}} is positive. This canonical simplified form can be obtained by replacing the three output lines of the preceding pseudo code by </div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> '''if''' {{<del style="font-weight: bold; text-decoration: none;">nowrap</del>|1=''s'' = 0}} '''then output''' "Division by zero"</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> '''if''' {{<ins style="font-weight: bold; text-decoration: none;">math</ins>|1=''s'' = 0}} '''then output''' "Division by zero"</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> '''if''' {{<del style="font-weight: bold; text-decoration: none;">nowrap</del>|1=''s'' &lt; 0}} '''then''' {{<del style="font-weight: bold; text-decoration: none;">nowrap</del>|1=''s'' := −''s''}}; {{<del style="font-weight: bold; text-decoration: none;">nowrap</del>|1=''t'' := −''t''}} (''for avoiding negative denominators'')</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> '''if''' {{<ins style="font-weight: bold; text-decoration: none;">math</ins>|1=''s'' &lt; 0}} '''then''' {{<ins style="font-weight: bold; text-decoration: none;">math</ins>|1=''s'' := −''s''}}; {{<ins style="font-weight: bold; text-decoration: none;">math</ins>|1=''t'' := −''t''}} (''for avoiding negative denominators'')</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> '''if''' {{<del style="font-weight: bold; text-decoration: none;">nowrap</del>|1=''s'' = 1}} '''then output''' {{<del style="font-weight: bold; text-decoration: none;">nowrap</del>|<del style="font-weight: bold; text-decoration: none;">−</del>''t''}} (''for avoiding denominators equal to'' 1)</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> '''if''' {{<ins style="font-weight: bold; text-decoration: none;">math</ins>|1=''s'' = 1}} '''then output''' {{<ins style="font-weight: bold; text-decoration: none;">math</ins>|<ins style="font-weight: bold; text-decoration: none;">-</ins>''t''}} (''for avoiding denominators equal to'' 1)</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> '''output''' {{sfrac|-''t''|''s''}}</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> '''output''' <ins style="font-weight: bold; text-decoration: none;">{{math|</ins>{{sfrac|-''t''|''s''<ins style="font-weight: bold; text-decoration: none;">}}</ins>}}</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The proof of this algorithm relies on the fact that {{math|''s''}} and {{math|''t''}} are two coprime integers such that {{math|1=''as'' + ''bt'' = 0}}, and thus &lt;math&gt;\frac{a}{b} = -\frac{t}{s}&lt;/math&gt;. To get the canonical simplified form, it suffices to move the minus sign for having a positive denominator.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The proof of this algorithm relies on the fact that {{math|''s''}} and {{math|''t''}} are two coprime integers such that {{math|1=''as'' + ''bt'' = 0}}, and thus &lt;math&gt;\frac{a}{b} = -\frac{t}{s}&lt;/math&gt;. To get the canonical simplified form, it suffices to move the minus sign for having a positive denominator.</div></td> </tr> </table> D.Lazard https://en.wikipedia.org/w/index.php?title=Extended_Euclidean_algorithm&diff=1285729451&oldid=prev Cedar101: /* Simplification of fractions */ {{nowrap}} 2025-04-15T12:21:24Z <p><span class="autocomment">Simplification of fractions: </span> {{nowrap}}</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 12:21, 15 April 2025</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 190:</td> <td colspan="2" class="diff-lineno">Line 190:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Simplification of fractions==</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Simplification of fractions==</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>A fraction {{math|{{sfrac|''a''|''b''}}}} is in canonical simplified form if {{math|''a''}} and {{math|''b''}} are [[coprime]] and {{math|''b''}} is positive. This canonical simplified form can be obtained by replacing the three output lines of the preceding pseudo code by </div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>A fraction {{math|{{sfrac|''a''|''b''}}}} is in canonical simplified form if {{math|''a''}} and {{math|''b''}} are [[coprime]] and {{math|''b''}} is positive. This canonical simplified form can be obtained by replacing the three output lines of the preceding pseudo code by </div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> '''if''' {{<del style="font-weight: bold; text-decoration: none;">math</del>|1=''s'' = 0}} '''then output''' "Division by zero"</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> '''if''' {{<ins style="font-weight: bold; text-decoration: none;">nowrap</ins>|1=''s'' = 0}} '''then output''' "Division by zero"</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> '''if''' {{<del style="font-weight: bold; text-decoration: none;">math</del>|1=''s'' &lt; 0}} '''then''' {{<del style="font-weight: bold; text-decoration: none;">math</del>|1=''s'' := −''s''}}; {{<del style="font-weight: bold; text-decoration: none;">math</del>|1=''t'' := −''t''}} (''for avoiding negative denominators'')</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> '''if''' {{<ins style="font-weight: bold; text-decoration: none;">nowrap</ins>|1=''s'' &lt; 0}} '''then''' {{<ins style="font-weight: bold; text-decoration: none;">nowrap</ins>|1=''s'' := −''s''}}; {{<ins style="font-weight: bold; text-decoration: none;">nowrap</ins>|1=''t'' := −''t''}} (''for avoiding negative denominators'')</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> '''if''' {{<del style="font-weight: bold; text-decoration: none;">math</del>|1=''s'' = 1}} '''then output''' {{<del style="font-weight: bold; text-decoration: none;">math</del>|<del style="font-weight: bold; text-decoration: none;">-</del>''t''}} (''for avoiding denominators equal to'' 1)</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> '''if''' {{<ins style="font-weight: bold; text-decoration: none;">nowrap</ins>|1=''s'' = 1}} '''then output''' {{<ins style="font-weight: bold; text-decoration: none;">nowrap</ins>|<ins style="font-weight: bold; text-decoration: none;">−</ins>''t''}} (''for avoiding denominators equal to'' 1)</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> '''output''' <del style="font-weight: bold; text-decoration: none;">{{math|</del>{{sfrac|-''t''|''s''<del style="font-weight: bold; text-decoration: none;">}}</del>}}</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> '''output''' {{sfrac|-''t''|''s''}}</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The proof of this algorithm relies on the fact that {{math|''s''}} and {{math|''t''}} are two coprime integers such that {{math|1=''as'' + ''bt'' = 0}}, and thus &lt;math&gt;\frac{a}{b} = -\frac{t}{s}&lt;/math&gt;. To get the canonical simplified form, it suffices to move the minus sign for having a positive denominator.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The proof of this algorithm relies on the fact that {{math|''s''}} and {{math|''t''}} are two coprime integers such that {{math|1=''as'' + ''bt'' = 0}}, and thus &lt;math&gt;\frac{a}{b} = -\frac{t}{s}&lt;/math&gt;. To get the canonical simplified form, it suffices to move the minus sign for having a positive denominator.</div></td> </tr> </table> Cedar101 https://en.wikipedia.org/w/index.php?title=Extended_Euclidean_algorithm&diff=1285710354&oldid=prev D.Lazard: Reverted 1 edit by 2806:2F0:5001:DF1A:1476:DE1D:999B:A8BA (talk): Unexplained change 2025-04-15T08:55:07Z <p>Reverted 1 edit by <a href="/wiki/Special:Contributions/2806:2F0:5001:DF1A:1476:DE1D:999B:A8BA" title="Special:Contributions/2806:2F0:5001:DF1A:1476:DE1D:999B:A8BA">2806:2F0:5001:DF1A:1476:DE1D:999B:A8BA</a> (<a href="/w/index.php?title=User_talk:2806:2F0:5001:DF1A:1476:DE1D:999B:A8BA&amp;action=edit&amp;redlink=1" class="new" title="User talk:2806:2F0:5001:DF1A:1476:DE1D:999B:A8BA (page does not exist)">talk</a>): Unexplained change</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 08:55, 15 April 2025</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 32:</td> <td colspan="2" class="diff-lineno">Line 32:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>t_0 &amp; =0 &amp; t_1 &amp; =1 \\</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>t_0 &amp; =0 &amp; t_1 &amp; =1 \\</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>&amp; \,\,\,\vdots &amp; &amp; \,\,\,\vdots \\</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>&amp; \,\,\,\vdots &amp; &amp; \,\,\,\vdots \\</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>r_{i+1} &amp; =r_{i-1}-<del style="font-weight: bold; text-decoration: none;">q_{i+1}</del> r_i &amp; \text {and } 0 &amp; \le r_{i+1} &lt; |r_i| &amp; \text{(this defines } q_i \text{)}\\</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>r_{i+1} &amp; =r_{i-1}-<ins style="font-weight: bold; text-decoration: none;">q_i</ins> r_i &amp; \text {and } 0 &amp; \le r_{i+1} &lt; |r_i| &amp; \text{(this defines } q_i \text{)}\\</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>s_{i+1} &amp; =s_{i-1}-<del style="font-weight: bold; text-decoration: none;">q_{i+1}</del> s_i \\</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>s_{i+1} &amp; =s_{i-1}-<ins style="font-weight: bold; text-decoration: none;">q_i</ins> s_i \\</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>t_{i+1} &amp; =t_{i-1}-<del style="font-weight: bold; text-decoration: none;">q_{i+1}</del> t_i \\</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>t_{i+1} &amp; =t_{i-1}-<ins style="font-weight: bold; text-decoration: none;">q_i</ins> t_i \\</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>&amp; \,\,\, \vdots</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>&amp; \,\,\, \vdots</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>\end{align}</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>\end{align}</div></td> </tr> </table> D.Lazard https://en.wikipedia.org/w/index.php?title=Extended_Euclidean_algorithm&diff=1285665633&oldid=prev 2806:2F0:5001:DF1A:1476:DE1D:999B:A8BA: /* Description */ 2025-04-15T00:55:01Z <p><span class="autocomment">Description</span></p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 00:55, 15 April 2025</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 32:</td> <td colspan="2" class="diff-lineno">Line 32:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>t_0 &amp; =0 &amp; t_1 &amp; =1 \\</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>t_0 &amp; =0 &amp; t_1 &amp; =1 \\</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>&amp; \,\,\,\vdots &amp; &amp; \,\,\,\vdots \\</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>&amp; \,\,\,\vdots &amp; &amp; \,\,\,\vdots \\</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>r_{i+1} &amp; =r_{i-1}-<del style="font-weight: bold; text-decoration: none;">q_i</del> r_i &amp; \text {and } 0 &amp; \le r_{i+1} &lt; |r_i| &amp; \text{(this defines } q_i \text{)}\\</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>r_{i+1} &amp; =r_{i-1}-<ins style="font-weight: bold; text-decoration: none;">q_{i+1}</ins> r_i &amp; \text {and } 0 &amp; \le r_{i+1} &lt; |r_i| &amp; \text{(this defines } q_i \text{)}\\</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>s_{i+1} &amp; =s_{i-1}-<del style="font-weight: bold; text-decoration: none;">q_i</del> s_i \\</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>s_{i+1} &amp; =s_{i-1}-<ins style="font-weight: bold; text-decoration: none;">q_{i+1}</ins> s_i \\</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>t_{i+1} &amp; =t_{i-1}-<del style="font-weight: bold; text-decoration: none;">q_i</del> t_i \\</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>t_{i+1} &amp; =t_{i-1}-<ins style="font-weight: bold; text-decoration: none;">q_{i+1}</ins> t_i \\</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>&amp; \,\,\, \vdots</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>&amp; \,\,\, \vdots</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>\end{align}</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>\end{align}</div></td> </tr> </table> 2806:2F0:5001:DF1A:1476:DE1D:999B:A8BA https://en.wikipedia.org/w/index.php?title=Extended_Euclidean_algorithm&diff=1285600178&oldid=prev MrGumballs: /* growthexperiments-addlink-summary-summary:2|1|0 */ 2025-04-14T17:02:55Z <p>Link suggestions feature: 2 links added.</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 17:02, 14 April 2025</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 108:</td> <td colspan="2" class="diff-lineno">Line 108:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The matrix &lt;math&gt;A_1&lt;/math&gt; is the identity matrix and its determinant is one. The determinant of the rightmost matrix in the preceding formula is −1. It follows that the determinant of &lt;math&gt;A_i&lt;/math&gt; is &lt;math&gt;(-1)^{i-1}.&lt;/math&gt; In particular, for &lt;math&gt;i=k+1,&lt;/math&gt; we have &lt;math&gt;s_k t_{k+1} - t_k s_{k+1} = (-1)^k.&lt;/math&gt; Viewing this as a Bézout's identity, this shows that &lt;math&gt;s_{k+1}&lt;/math&gt; and &lt;math&gt;t_{k+1}&lt;/math&gt; are [[coprime]]. The relation &lt;math&gt;as_{k+1}+bt_{k+1}=0&lt;/math&gt; that has been proved above and [[Euclid's lemma]] show that &lt;math&gt;s_{k+1}&lt;/math&gt; divides {{mvar|b}}, that is that &lt;math&gt;b=ds_{k+1}&lt;/math&gt; for some integer {{mvar|d}}. Dividing by &lt;math&gt;s_{k+1}&lt;/math&gt; the relation &lt;math&gt;as_{k+1}+bt_{k+1}=0&lt;/math&gt; gives &lt;math&gt;a=-dt_{k+1}.&lt;/math&gt; So, &lt;math&gt;s_{k+1}&lt;/math&gt; and &lt;math&gt;-t_{k+1}&lt;/math&gt; are coprime integers that are the quotients of {{mvar|a}} and {{mvar|b}} by a common factor, which is thus their greatest common divisor or its [[additive inverse|opposite]].</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The matrix &lt;math&gt;A_1&lt;/math&gt; is the identity matrix and its determinant is one. The determinant of the rightmost matrix in the preceding formula is −1. It follows that the determinant of &lt;math&gt;A_i&lt;/math&gt; is &lt;math&gt;(-1)^{i-1}.&lt;/math&gt; In particular, for &lt;math&gt;i=k+1,&lt;/math&gt; we have &lt;math&gt;s_k t_{k+1} - t_k s_{k+1} = (-1)^k.&lt;/math&gt; Viewing this as a Bézout's identity, this shows that &lt;math&gt;s_{k+1}&lt;/math&gt; and &lt;math&gt;t_{k+1}&lt;/math&gt; are [[coprime]]. The relation &lt;math&gt;as_{k+1}+bt_{k+1}=0&lt;/math&gt; that has been proved above and [[Euclid's lemma]] show that &lt;math&gt;s_{k+1}&lt;/math&gt; divides {{mvar|b}}, that is that &lt;math&gt;b=ds_{k+1}&lt;/math&gt; for some integer {{mvar|d}}. Dividing by &lt;math&gt;s_{k+1}&lt;/math&gt; the relation &lt;math&gt;as_{k+1}+bt_{k+1}=0&lt;/math&gt; gives &lt;math&gt;a=-dt_{k+1}.&lt;/math&gt; So, &lt;math&gt;s_{k+1}&lt;/math&gt; and &lt;math&gt;-t_{k+1}&lt;/math&gt; are coprime integers that are the quotients of {{mvar|a}} and {{mvar|b}} by a common factor, which is thus their greatest common divisor or its [[additive inverse|opposite]].</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>To prove the last assertion, assume that ''a'' and ''b'' are both positive and &lt;math&gt;\gcd(a,b)\neq\min(a,b)&lt;/math&gt;. Then, &lt;math&gt;a \neq b &lt;/math&gt;, and if &lt;math&gt;a &lt; b&lt;/math&gt;, it can be seen that the ''s'' and ''t'' sequences for (''a'',''b'') under the EEA are, up to initial 0s and 1s, the ''t'' and ''s'' sequences for (''b'',''a''). The definitions then show that the (''a'',''b'') case reduces to the (''b'',''a'') case. So assume that &lt;math&gt;a &gt; b&lt;/math&gt; without loss of generality.</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>To prove the last assertion, assume that ''a'' and ''b'' are both positive and &lt;math&gt;\gcd(a,b)\neq\min(a,b)&lt;/math&gt;. Then, &lt;math&gt;a \neq b &lt;/math&gt;, and if &lt;math&gt;a &lt; b&lt;/math&gt;, it can be seen that the ''s'' and ''t'' sequences for (''a'',''b'') under the EEA are, up to initial 0s and 1s, the ''t'' and ''s'' sequences for (''b'',''a''). The definitions then show that the (''a'',''b'') case reduces to the (''b'',''a'') case. So assume that &lt;math&gt;a &gt; b&lt;/math&gt; <ins style="font-weight: bold; text-decoration: none;">[[</ins>without loss of generality<ins style="font-weight: bold; text-decoration: none;">]]</ins>.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>It can be seen that &lt;math&gt;s_2&lt;/math&gt; is 1 and &lt;math&gt;s_3&lt;/math&gt; (which exists by &lt;math&gt;\gcd(a,b)\neq\min(a,b)&lt;/math&gt;) is a negative integer. Thereafter, the &lt;math&gt;s_i&lt;/math&gt; alternate in sign and strictly increase in magnitude, which follows inductively from the definitions and the fact that &lt;math&gt;q_i\geq 1&lt;/math&gt; for &lt;math&gt;1 \leq i \leq k&lt;/math&gt;, the case &lt;math&gt;i = 1&lt;/math&gt; holds because &lt;math&gt;a &gt; b&lt;/math&gt;. The same is true for the &lt;math&gt;t_i&lt;/math&gt; after the first few terms, for the same reason. Furthermore, it is easy to see that &lt;math&gt;q_k \geq 2&lt;/math&gt; (when ''a'' and ''b'' are both positive and &lt;math&gt;\gcd(a,b)\neq\min(a,b)&lt;/math&gt;). Thus, noticing that &lt;math&gt;|s_{k+1}| = |s_{k-1}| + q_k |s_k|&lt;/math&gt;, we obtain</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>It can be seen that &lt;math&gt;s_2&lt;/math&gt; is 1 and &lt;math&gt;s_3&lt;/math&gt; (which exists by &lt;math&gt;\gcd(a,b)\neq\min(a,b)&lt;/math&gt;) is a negative integer. Thereafter, the &lt;math&gt;s_i&lt;/math&gt; alternate in sign and strictly increase in magnitude, which follows inductively from the definitions and the fact that &lt;math&gt;q_i\geq 1&lt;/math&gt; for &lt;math&gt;1 \leq i \leq k&lt;/math&gt;, the case &lt;math&gt;i = 1&lt;/math&gt; holds because &lt;math&gt;a &gt; b&lt;/math&gt;. The same is true for the &lt;math&gt;t_i&lt;/math&gt; after the first few terms, for the same reason. Furthermore, it is easy to see that &lt;math&gt;q_k \geq 2&lt;/math&gt; (when ''a'' and ''b'' are both positive and &lt;math&gt;\gcd(a,b)\neq\min(a,b)&lt;/math&gt;). Thus, noticing that &lt;math&gt;|s_{k+1}| = |s_{k-1}| + q_k |s_k|&lt;/math&gt;, we obtain</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Line 213:</td> <td colspan="2" class="diff-lineno">Line 213:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Thus {{math|''t''}}, or, more exactly, the remainder of the division of {{math|''t''}} by {{math|''n''}}, is the multiplicative inverse of {{math|''a''}} modulo {{math|''n''}}.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Thus {{math|''t''}}, or, more exactly, the remainder of the division of {{math|''t''}} by {{math|''n''}}, is the multiplicative inverse of {{math|''a''}} modulo {{math|''n''}}.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>To adapt the extended Euclidean algorithm to this problem, one should remark that the Bézout coefficient of {{math|''n''}} is not needed, and thus does not need to be computed. Also, for getting a result which is positive and lower than ''n'', one may use the fact that the integer {{math|''t''}} provided by the algorithm satisfies {{math|{{!}}''t''{{!}} &lt; ''n''}}. That is, if {{math|''t'' &lt; 0}}, one must add {{math|''n''}} to it at the end. This results in the pseudocode, in which the input ''n'' is an integer larger than 1.</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>To adapt the extended Euclidean algorithm to this problem, one should remark that the Bézout coefficient of {{math|''n''}} is not needed, and thus does not need to be computed. Also, for getting a result which is positive and lower than ''n'', one may use the fact that the integer {{math|''t''}} provided by the algorithm satisfies {{math|{{!}}''t''{{!}} &lt; ''n''}}. That is, if {{math|''t'' &lt; 0}}, one must add {{math|''n''}} to it at the end. This results in the <ins style="font-weight: bold; text-decoration: none;">[[</ins>pseudocode<ins style="font-weight: bold; text-decoration: none;">]]</ins>, in which the input ''n'' is an integer larger than 1.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> '''function''' inverse(a, n)</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> '''function''' inverse(a, n)</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> t := 0; newt := 1</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> t := 0; newt := 1</div></td> </tr> </table> MrGumballs https://en.wikipedia.org/w/index.php?title=Extended_Euclidean_algorithm&diff=1278555050&oldid=prev Atomvinter: /* Description */ 2025-03-03T04:24:23Z <p><span class="autocomment">Description</span></p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 04:24, 3 March 2025</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 50:</td> <td colspan="2" class="diff-lineno">Line 50:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This implies that the pair of Bézout's coefficients provided by the extended Euclidean algorithm is the ''minimal pair'' of Bézout coefficients, as being the unique pair satisfying both above inequalities.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This implies that the pair of Bézout's coefficients provided by the extended Euclidean algorithm is the ''minimal pair'' of Bézout coefficients, as being the unique pair satisfying both above inequalities.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">Also</del> <del style="font-weight: bold; text-decoration: none;">it</del> means that the algorithm can be done without [[integer overflow]] by a [[computer program]] using integers of a fixed size that is larger than that of ''a'' and ''b''.</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">It</ins> <ins style="font-weight: bold; text-decoration: none;">also</ins> means that the algorithm can be done without [[integer overflow]] by a [[computer program]] using integers of a fixed size that is larger than that of ''a'' and ''b''.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Example ===</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Example ===</div></td> </tr> </table> Atomvinter https://en.wikipedia.org/w/index.php?title=Extended_Euclidean_algorithm&diff=1255234918&oldid=prev MarkMarkB: Clarify "entries" to be "columns" 2024-11-03T21:35:44Z <p>Clarify &quot;entries&quot; to be &quot;columns&quot;</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 21:35, 3 November 2024</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 54:</td> <td colspan="2" class="diff-lineno">Line 54:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Example ===</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Example ===</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The following table shows how the extended Euclidean algorithm proceeds with input {{nowrap|{{green|240}}}} and {{nowrap|{{green|46}}}}. The greatest common divisor is the last non zero entry, {{nowrap|{{red|2}}}} in the column "remainder". The computation stops at row 6, because the remainder in it is {{nowrap|{{red|0}}}}. Bézout coefficients appear in the last two <del style="font-weight: bold; text-decoration: none;">entries</del> of the second-to-last row. In fact, it is easy to verify that {{nowrap|1={{magenta|−9}} × {{green|240}} + {{magenta|47}} × {{green|46}} = {{red|2}}}}. Finally the last two entries {{nowrap|{{cyan|23}}}} and {{nowrap|{{cyan|−120}}}} of the last row are, up to the sign, the quotients of the input {{nowrap|{{green|46}}}} and {{nowrap|{{green|240}}}} by the greatest common divisor {{nowrap|{{red|2}}}}.</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The following table shows how the extended Euclidean algorithm proceeds with input {{nowrap|{{green|240}}}} and {{nowrap|{{green|46}}}}. The greatest common divisor is the last non zero entry, {{nowrap|{{red|2}}}} in the column "remainder". The computation stops at row 6, because the remainder in it is {{nowrap|{{red|0}}}}. Bézout coefficients appear in the last two <ins style="font-weight: bold; text-decoration: none;">columns</ins> of the second-to-last row. In fact, it is easy to verify that {{nowrap|1={{magenta|−9}} × {{green|240}} + {{magenta|47}} × {{green|46}} = {{red|2}}}}. Finally the last two entries {{nowrap|{{cyan|23}}}} and {{nowrap|{{cyan|−120}}}} of the last row are, up to the sign, the quotients of the input {{nowrap|{{green|46}}}} and {{nowrap|{{green|240}}}} by the greatest common divisor {{nowrap|{{red|2}}}}.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{| class="wikitable" style="text-align:right;"</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{| class="wikitable" style="text-align:right;"</div></td> </tr> </table> MarkMarkB https://en.wikipedia.org/w/index.php?title=Extended_Euclidean_algorithm&diff=1250724269&oldid=prev GünniX: Reflist 2024-10-12T04:22:20Z <p>Reflist</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 04:22, 12 October 2024</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 321:</td> <td colspan="2" class="diff-lineno">Line 321:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== References ==</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== References ==</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{{Reflist}}</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* {{Cite book |title=[[The Art of Computer Programming]] |author-link=Donald Knuth |first=Donald |last=Knuth |publisher=Addison-Wesley }} Volume 2, Chapter 4.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* {{Cite book |title=[[The Art of Computer Programming]] |author-link=Donald Knuth |first=Donald |last=Knuth |publisher=Addison-Wesley }} Volume 2, Chapter 4.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Thomas H. Cormen]], [[Charles E. Leiserson]], [[Ronald L. Rivest]], and [[Clifford Stein]]. ''[[Introduction to Algorithms]]'', Second Edition. MIT Press and McGraw-Hill, 2001. {{ISBN|0-262-03293-7}}. Pages 859&amp;ndash;861 of section 31.2: Greatest common divisor.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Thomas H. Cormen]], [[Charles E. Leiserson]], [[Ronald L. Rivest]], and [[Clifford Stein]]. ''[[Introduction to Algorithms]]'', Second Edition. MIT Press and McGraw-Hill, 2001. {{ISBN|0-262-03293-7}}. Pages 859&amp;ndash;861 of section 31.2: Greatest common divisor.</div></td> </tr> </table> GünniX https://en.wikipedia.org/w/index.php?title=Extended_Euclidean_algorithm&diff=1250709666&oldid=prev Anita5192: Reverted edit by 148.252.133.17 (talk) to last version by 96.36.47.50 2024-10-12T01:41:33Z <p>Reverted edit by <a href="/wiki/Special:Contributions/148.252.133.17" title="Special:Contributions/148.252.133.17">148.252.133.17</a> (<a href="/wiki/User_talk:148.252.133.17" title="User talk:148.252.133.17">talk</a>) to last version by 96.36.47.50</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 01:41, 12 October 2024</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 137:</td> <td colspan="2" class="diff-lineno">Line 137:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>where &lt;math&gt;\operatorname{Res}(a,b)&lt;/math&gt; denotes the [[resultant]] of ''a'' and ''b''. In this form of Bézout's identity, there is no denominator in the formula. If one divides everything by the resultant one gets the classical Bézout's identity, with an explicit common denominator for the rational numbers that appear in it.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>where &lt;math&gt;\operatorname{Res}(a,b)&lt;/math&gt; denotes the [[resultant]] of ''a'' and ''b''. In this form of Bézout's identity, there is no denominator in the formula. If one divides everything by the resultant one gets the classical Bézout's identity, with an explicit common denominator for the rational numbers that appear in it.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>== Pseudocode==<del style="font-weight: bold; text-decoration: none;">false positive </del></div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>== Pseudocode==</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{hatnote|In this section and the following ones, '''''div''''' is an auxiliary function that computes the quotient of the [[Euclidean division]] of its left argument by its right argument.}} </div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{hatnote|In this section and the following ones, '''''div''''' is an auxiliary function that computes the quotient of the [[Euclidean division]] of its left argument by its right argument.}} </div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>To implement the algorithm that is described above, one should first remark that only the two last values of the indexed variables are needed at each step. Thus, for saving memory, each indexed variable must be replaced by just two variables.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>To implement the algorithm that is described above, one should first remark that only the two last values of the indexed variables are needed at each step. Thus, for saving memory, each indexed variable must be replaced by just two variables.</div></td> </tr> </table> Anita5192