Solutionsofsimultaneousequations:联立方程组的解
- 格式:pdf
- 大小:133.60 KB
- 文档页数:8
Solutionsofsimultaneousequations
TheHELMnotesuseCramer’sruletosolvesystemsoflinearequationsbutthatmethodiscompu-
tationallyveryinefficient,withmanyrepeatedsubcalculations.Thetechniquepresentedhere-Gauss
elimination-usuallyisalotfaster,especiallyforlargesystems.
Considerthesimultaneousequations
x+y=5
2x+3y=13
Theny=5−xandso,
2x+3(5−x)=13
2x+15−3x=13
−x=13−15=−2
Thereforex=2andy=5−2=3.
However,thisapproachbecomesverymessywhenwehavethreeormorevariables.And,evenworse,
youcaneasily“lose”informationandgetthewronganswer.Hereisthesortofthingthatcangowrong:
Considerthesystemofequations
2x+y+3z=1
2x+2y+5z=4
x+y+z=1
x+2y+2z=3
ItmightbenaturaltotakeEqu2minusEqu1andthenEqu4minusEqu3togivethetwoequations
y+2z=3
y+z=2
Solvingtheseequationsgivesy=1andz=1.Pluggingthisbackintothefirstequationgives2x=
1−y−z=1−1−3andhence
x=−32.
IsthisOK?NO!-thesevalues,x=−32,y=1,z=1don’tsatisfythethirdequation.So,whathas
gonewrong?Theproblemisthatwehavenotkeptalltheinformationfromall4equations.So,weneed
amethodthatreliablyensuresthatwedon’tloseinformation.WeuseamethodknownasGaussian
elimination.
1Gaussianelimination
Wearegivenasystemofequations
ax+by+cz+···=d
ex+fy+gz+···=k
···
Herea,b,c,d,e,···areconstantsandx,y,z,···areunknownsthatwewanttosolvefor.
Ateachstepoftheprocedureweareallowedtodooneofthefollowing3operations:
(a)Addmultiplesofoneequationtotheothers
(b)swoptwoequations
(c)multiplyanequationbya(nonzero)number.
andthen,crucially,
Writedownalltheresultingequations.
Thislaststepisalittletediousbutitdoesstoperrorsliketheonewehadabove.
IndoingthisyoucanalwaysreducethesystemtoEchelonForm,whereeachequationstartstotheright
oftheoneabove,followedperhapsbyseveralequationsoftheform0=0.
ax+by+cz+···=d
fy+gz+···=k
mz+nw+···=p
······
Notethatitispossibletogetanequationoftheform0=−1orsimilarrubbish(thatmeansthatthe
systemofequationsisinconsistent-there’snosolution).Atthisstage,wecaneasilysolvethesystemby
backsubstitutionwherewestartfromthebottomequationandworkupwards.Thereare3thingsthat
canhappen:
•Youhaveanequationoftheform0=−12.InthiscasethereisNoSolution.
•Youhaveasmany(nonzero)equationsasunknowns.InthiscaseyouwillhaveaUniqueSolution
whichyoucanprettymuchwritedown(seetheexamplesbelow).
•Youhavefewerequationsthanunknowns.InthiscaseyouhaveInfinitelyManySolutions.I
willexplainbelowhowyoufindthemall.
2Letstrythiswiththesystemwehadbefore:
2x+y+3z=1
2x+2y+5z=4
x+y+z=1
x+2y+2z=3
SinceIdon’tlikefractions,Iamgoingtofirstswopthefirstandfourthequation:
x+2y+2z=3
2x+2y+5z=4
x+y+z=1
2x+y+3z=1
NowsubtracttwiceRow1fromtheRows2and4andsubtractonecopyofrowonefromRow3togive:
x+2y+2z=3
−2y+z=−2
−y−z=−2
−3y−z=−5
Nowusingthesecondequationtoeliminatethey’sfromthelast2equationsgives:
x+2y+2z=3
−2y+z=−2
−32z=−1
−52z=−2
And,finallytakingequation4minus5/3timesequation3gives
x+2y+2z=3
−2y+z=−2
−32z=−1
0=−13
So,thelastequationisimpossibleandexplainswhythereisNosolution.
3Let’sdothiswithafewmoreexamples.First,considerthesystemofequations
x+2y+3z=1
4x+5y+6z=1
2x+5y+7z=1
BeforegoingthroughtheGaussianelimination,Iamgoingtointroducesomeconvenientnotation.We
shallusetheshorthandnotationR1,R2,...torepresentrows1,2,...andwriteforexampleR4−R1as
shorthandfor“ReplaceRow4byRow4minusRow1.”Secondly,weonlyneedthenumbers1,2,...,7,1
sowewillwritedowntheAugmentedmatrixforthesystem;thisconsistsofallthenumbers,witha
verticallineinplaceoftheequalssign.Here,thoughitisveryimportanttoputinazeroifsomevariable
doesnotoccur.Thisgives:1231
4561
25
71
Proceedbyeliminatingxfromthesecondandthirdequationsusingrowoperation(a).1231
4561
25
71R2−4R1
R3−2R1∼1231
0−3−6−3
01
1−1.
Nextwedividerow2by(-3)toproduce:1231
0−3−6−3
01
1−1−13R2∼1231
0121
01
1−1.
Finally,weget1231
0121
01
1−1R3−R2∼1231
0121
00−
1−2
Revertingtoasystemofequationsweseethat
x+4y+2z=3
y+2z=1
−z=−2
4Solvingfromthebottomupthisgives
z=2
y=−1−z=−3
x=1−2y−3z=1+6−6=1
ThenextthingIshouldexplainiswhattodowhenyouendupwithfewerequationsthanunknownsin
echelonform.Forexample,onemighthave:
x+y+z+w=2
z+3w=5
Inthiscase,ifIaddintwoequationsy=27andw=34(oranyothernumbers)thenIwouldhavea
systemofequationsinechelonformwiththesamenumberofequationsasunknowns,andIcouldsolve
uniquely.So,wedosomethingsimilar.Theruleis:
•Ifyouareinechelonformandhavefewerequationsthanunknowns,foreachvariable
thatdoesnotappearatthebeginningofanequation,putthatequationequaltoan
arbitraryconstantandthensolve(uniquely)fortheothers.
So,inourexamplethisgives
w=a
z=5−3w=5−3a
y=b
x=2−y−z−w=2−b−(5−3a)−a=−3−b+2a
Letsdoonemoreexample:
−2x+z+w=−3
x+y+z+w=2
x+y−2z−2w=5
−3x+y+4z+4w=−5
Wewriteinechelonformthenswoprowsoneandtwotoget:−2011−3
11112
11−2−25
−314
4−5∼11112
−2011−3
11−2−25
−314
4−5
5