You are on page 1of 3

8/22/2016

Euclid'salgorithmproofDivisionalgorithm

Navigation
Home
Search
Sitemap

Euclid'salgorithmproofDivision
algorithm

ContactGraeme
Home
Email
Twitter

MathHelp>NumberTheory>Theorems>Euclid'sAlgorithm

Wellorderingprinciple
Thewellorderingprinciple(orwellorderingaxiom)isstatedasfollows:
Everynonemptysubsetofnonnegativeintegerscontainsasmallestelement.

Divisionalgorithm,a.k.a.uniquedivisiontheorem
Theorem:Givenintegersaandd,d0,thereexistuniqueintegers,qandr,suchthata=qd+r,with
0r<|d|
Proof:
Considertheset,S,ofallnumbersoftheforma+nd,wherenisaninteger.
S={and:nisaninteger}
Scontainsatleastonenonnegativeinteger,becausethereisaninteger,n,thatensuresand0,
namely
n=|a|dmakesand=a+|a|d2a+|a|0.
Now,bythewellorderingprinciple,thereisaleastnonnegativeelementofS,whichwewillcallr,
wherer=andforsomen.Letq=(ar)/d=(a(and))/d=n.Toshowthatr<|d|,supposetothe
contrarythatr|d|.Inthatcase,eitherr|d|=amd,wherem=n+1(ifdispositive)orm=n1(ifdis
negative),andsor|d|isanelementofSthatisnonnegativeandsmallerthanr,acontradiction.Thus
r<|d|.
Toshowuniqueness,supposethereexistq,r,q',r'with0r,r'<|d|suchthata=qd+randa=q'd+r'.
Subtractingtheseequationsgivesd(q'q)=r'r,sod|r'r.Since0r,r'<|d|,thedifferencer'rmust
alsobesmallerthand.Sincedisadivisorofthisdifference,itfollowsthatthedifferencer'rmustbe
zero,i.e.r'=r,andsoq'=q.

Euclid'salgorithm
Bytheuniquedivisionprinciple,adividedbybgivesquotientqandremainderr,suchthata=bq+r,
with0r<|b|.
Considernow,asequenceofdivisions,beginningwithadividedbybgivingquotientq1andremainder
b1,thenbdividedbyb1givingquotientq2andremainderb2,etc.
a=bq1+b1,
b=b1q2+b2,
b1=b2q3+b3,
...
http://2000clicks.com/mathhelp/NumberTh09EuclidsAlgorithm.aspx

1/3

8/22/2016

Euclid'salgorithmproofDivisionalgorithm

bn2=bn1qn+bn,
bn1=bnqn+1
Inthissequenceofdivisions,0b1<|b|,0b2<|b1|,etc.,sowehavethesequence
|b|>|b1|>|b2|>...0.Sinceeachbisstrictlysmallerthantheonebeforeit,eventuallyoneofthem
willbe0.Wewillletbnbethelastnonzeroelementofthissequence.
Fromthelastequation,weseebn|bn1,andthenfromthisfactandtheequationbeforeit,weseethat
bn|bn2,andfromtheonebeforethat,weseethatbn|bn3,etc.Followingthechainbackwards,it
followsthatbn|b,andbn|a.Soweseethatbnisacommondivisorofaandb.
Toseethatbnisthegreatestcommondivisorofaandb,consider,d,anarbitrarycommondivisorofa
andb.Fromthefirstequation,abq1=b1,weseed|b1,andfromthesecond,equation,bb1q2=b2,we
seed|b2,etc.Followingthechaintothebottom,weseethatd|bn.Sinceanarbitrarycommondivisor
ofaandbdividesbn,weseethatbnisthegreatestcommondivisorofaandb.

Theorem:m*GCD(a,b)=GCD(ma,mb)
Foranyinteger,m,m*GCD(a,b)=GCD(ma,mb)
Proof:
Bytheuniquedivisiontheorem,ifadividedbybgivesquotientqandremainderr,
a=bq+r,with0r<|b|
Thenmadividedbymbgivesthesamequotientandremaindermr,
ma=mbq+mr,with0mr<|mb|
and,again,theuniquedivisiontheoremassuresusthatqandmraretheuniquequotientand
remainderofthisdivision.
FromEuclid'salgorithm,
a=bq1+b1,
b=b1q2+b2,
b1=b2q3+b3,
...
bn2=bn1qn+bn,
bn1=bnqn+1
Multiplyingeachequationbym,weobtaintheresultofEuclid'salgorithmtofindGCD(ma,mb):
ma=mbq1+mb1,
mb=mb1q2+mb2,
mb1=mb2q3+mb3,
...
mbn2=mbn1qn+mbn,
mbn1=mbnqn+1,
http://2000clicks.com/mathhelp/NumberTh09EuclidsAlgorithm.aspx

2/3

8/22/2016

Euclid'salgorithmproofDivisionalgorithm

provingtheresult.

Internetreferences
Mathworld:Wellorderingprinciple
Wikipedia:Divisionalgorithm,Euclideanalgorithm

Relatedpagesinthiswebsite
NumberTheoryDefinitionsParticularlytheEuclideanAlgorithmProperty,a.k.a.
Bzout'sIdentity.
ExtendedEuclideanAlgorithm,anditsuseintheChineseRemainderTheorem

ThewebmasterandauthorofthisMathHelpsiteisGraemeMcRae.

http://2000clicks.com/mathhelp/NumberTh09EuclidsAlgorithm.aspx

3/3

You might also like