349

An_Introduction_to_Error_Analysis__Taylor__2ed.pdf

Embed Size (px)

Citation preview

PrincipalFormulasinPartI Notation(Chapter2) (Measuredvalueof x)Xbest ax.(p.13) where xbest best estimateforx. axuncertaintyor errorinthemeasurement. .I.axFractlOnauncertamty=-I-I' (p.28) xbest Propagationof Uncertainties(Chapter3) Ifvariousquantitiesx. .... w aremeasuredwithsmalluncertaintiesax.. . .aw, andthemeasuredvaluesare usedtocalculatesome quantity q,thentheuncertainties inx,. . . ,w causeanuncertaintyinqasfollows: If qisthesumanddifference,q=x+...+ z- (u+.. . +w),then ;./(&)2+ .. . + (Sz)2+ (au?+ .. . + (aw? forindependentrandomerrors; ax++az+au+ +aw always.(p.60) xX...Xz If qistheproductandquotient.q=,then uX. . .Xw l(aX)2(Sz)2(8U)2(8W)2\j-;+ . . .+-;+ ... +-;8qforindependentrandomerrors; jqf&8zau8w

always.(p.61) If q=Bx.whereBisknownexactly,then 8q=IBI& (p.54) If qisafunctionof onevariable,q(x).then (p.65) If q isapower,q=X',then &Inl- (p.66)Ixl If q isanyfunctionof severalvariablesx,... , z.then 5q= (aq 8x)2+ . . . + (aq 8Z)2 (p.75)axaz. (forindependent random errors). StatisticalDefinitions(Chapter4) If xI' ... xNdenoteN separatemeasurementsof onequantityx,thenwedefine: _1N. X=- '" x=mean(p.98)NL..' I ;= 1 u= 1_1_ L(x;- x)2=standard deviation,orSD(p.100)x 'VN- 1 U x =~ =standarddeviationof mean,or SDOM.(p.102) TheNormalDistribution(Chapter5) Foranylirrutingdistributionf(x) formeasurementof acontinuousvariablex: f(x) dxprobabilitythatanyonemeasurementwill giveananswerbetweenxandx+ dx;(p.128)f f(x) dx probabilitythatanyonemeasurementwill giveananswerbetweenx=aandx=b;(p.128) f ~ f(x) dx= 1 isthenormalizationcondition.(p.128) TheGSlussor normaldistributionis (p.133) where Xcenter of distribution =truevalueof x meanafter manymeasurements. uwidthof distribution standarddeviationaftermanymeasurements. Theprobabilityof ameasurementwithintstandarddeviationsof X is 1 e-z212 dz Prob(withintu)--JI =normalerrorintegral;(p.136)--J21t-I inparticular Prob(withinlu)68%. ANINTRODUCTIONTO Error Analysis THESTUDYOFUNCERTAINTIES INPHYSICALMEASUREMENTS SECONDEDITION JohnR. Taylor PROFESSOROFPHYSICS UNIVERSITYOFCOLORADO University ScienceBooks Sausalito,California UniversityScienceBooks 55DGateFiveRoad Sausalito,CA 94965 Fax:(415)332-5393 Productionmanager:SusannaTadlock Manuscripteditor:AnnMcGuire Designer:Robert lshi Illustrators:Johnand JudyWaller Compositor:Maple- VailBook ManufacturingGroup Printer andbinder:Maple- VailBook ManufacturingGroup Thisbookisprintedonacid-freepaper. Copyright1982,1997byUniversityScienceBooks Reproductionor translationof anypartof thisworkbeyondthat permittedbySection107or108of the1976UnitedStatesCopyright Actwithoutthepermissionof thecopyrightownerisunlawful.Requestsforpermissionorfurtherinfonnationshouldbead- . dressedtothePermissionsDepartment,UniversityScienceBooks. Libraryof CongressCataloging-itl-PubJicationData Taylor,JohnR.(JohnRobert),1939Anintroductiontoerror analysis/John R.Taylor.-2nd ed. p.cm. Includesbibliographicalreferencesandindex. ISBN0-935702-42-3(c1oth).-ISBN 0-935702-75-X(pbk.) 1.Physicalmeasurements.2.Erroranalysis(Mathematics) 3.Mathematicalphysics.1.Title. QC39.T41997 530.1'6-dc2096-953 CIP PrintedintheUnitedStatesof America 109876 ToMyWife Contents Preface to the SecondEditionxi Preface to theFirst Editionxv Part I ChapterI.PreliminaryDescriptionof Error Analysis3 1.1ErrorsasUncertainties3 1.2Inevitabilityof Uncertainty3 1.3Importanceof KnowingtheUncertainties5 1.4MoreExamples6 1.5EstimatingUncertaintiesWhenReadingScales8 1.6EstimatingUncertaintiesinRepeatableMeasurements10 Chapter 2.How to Report andUseUncertaintiesI3 2.1BestEstimateUncertainty13 2.2SignificantFigures14 2.3Discrepancy16 2.4Comparisonof MeasuredandAcceptedValues18 2.5Comparisonof TwoMeasuredNumbers20 2.6CheckingRelationshipswithaGraph24 2.7FractionalUncertainties28 2.8SignificantFiguresandFractionalUncertainties30 2.9MultiplyingTwoMeasuredNumbers31 ProblemsforChapter 235 Chapter 3.Propagation of Uncertainties45 3.1UncertaintiesinDirectMeasurements46 3.2TheSquare-RootRuleforaCountingExperiment48 3.3SumsandDifferences;Products andQuotients49 3.4TwoImportant SpecialCases54 3.5IndependentUncertaintiesinaSum57 3.6MoreAboutIndependentUncertainties60 3.7ArbitraryFunctionsof One Variable63 3.8PropagationStepbyStep66 3.9Examples68 3.10AMoreComplicatedExample71 3. 1 IGeneralFormula forErrorPropagation73 ProblemsforChapter379 Chapter 4.Statistical Analysisof RandomUncertainties93 4.1RandomandSystematicErrors94vii viiiIntroductiontoErrorAnalysis 4.2TheMeanandStandardDeviation97 4.3TheStandardDeviationastheUncertaintyinaSingle Measurement101 4.4TheStandardDeviationof theMean102 4.5Examples104 4.6SystematicErrors106 ProblemsforChapter 4I I 0 Chapter 5.TheNormalDistribution121 5.1HistogramsandDistributions122 5.2LimitingDistributions126 5.3TheNormalDistribution129 5.4TheStandardDeviationas68%ConfidenceLimit135 5.5Justificationof theMeanasBestEstimate137 5.6Justificationof AdditioninQuadrature141 5.7StandardDeviationof theMean147 5.8Acceptabilityof aMeasuredAnswer149 ProblemsforChapter5I 54 Part II Chapter 6.Rejectionof Data165 6.1TheProblemof RejectingData165 6.2Chauvenet'sCriterion166 6.3Discussion169 ProblemsforChapter6170 Chapter 7.Weighted Averages173 7.1TheProblemof CombiningSeparateMeasurements173 7.2The WeightedAverage174 7.3AnExample176 ProblemsforChapter 7178 Chapter 8.Least-SquaresFitting181 8.1Data ThatShouldFitaStraightline181 8.2Calculationof theConstants AandB182 8.3UncertaintyintheMeasurementsof y186 8.4UncertaintyintheConstants AandB188 8.5AnExample190 8.6Least-SquaresFitstoOther Curves193 ProblemsforChapter 8199 Chapter 9.Covariance andCorrelation209 9.1ReviewofErrorPropagation209 9.2CovarianceinErrorPropagation211 9.3CoefficientofLinearCorrelation215 9.4QuantitativeSignificanceofr218 9.5Examples220 ProblemsforChapter 9222 ix Contents Chapter10.TheBinomialDistribution227 10.1Distributions227 10.2ProbabilitiesinDiceThrowing228 10.3Definitionof theBinomialDistribution228 10.4Propertiesof theBinomialDistribution23I 10.5TheGaussDistributionforRandomErrors235 10.6Applications;Testingof Hypotheses236 ProblemsforChapter10241 ChapterI I.ThePoissonDistribution245 I 1.1Definitionof thePoissonDistribution245 I 1.2Propertiesof thePoissonDistribution249 I 1.3Applications252 I 1.4Subtracting aBackground254 ProblemsforChapterI I256 Chapter12.The Chi-SquaredTest foraDistribution261 12.1IntroductiontoChiSquared261 12.2GeneralDefinitionof ChiSquared265 12.3DegreesofFreedomandReducedChiSquared268 12.4ProbabilitiesforChiSquared271 12.5Examples274 ProblemsforChapter12278 Appendixes285 AppendixA.NormalErrorIntegral.I286 AppendixB.NormalErrorIntegral.II288 AppendixC.ProbabilitiesforCorrelationCoefficients290 AppendixD.ProbabilitiesforChiSquared292 AppendixE.TwoProofsConcerning SampleStandardDeviations294 Bibliography299 Answersto QuickChecks andOdd-NumberedProblems30 I Index323 PrefacetotheSecondEdition IfirstwroteAnIntroductiontoErrorAnalysisbecausemyexperienceteaching introductorylaboratoryclasses forseveralyearshadconvincedmeof a seriousneed forabookthattrulyintroducedthesubjecttothecollegesciencestudent.Several finebooksonthetopicwereavailable,butnonewasreallysuitableforastudent newtothesubject.Thefavorablereceptiontothefirsteditionconfirmedtheexistenceof thatneedandsuggeststhebookmetit. Thecontinuingsuccessofthefirsteditionsuggestsitstillmeetsthatneed. Nevertheless,aftermorethanadecade,everyauthorofacollegetextbookmust surelyfeelobligedtoimproveandupdatetheoriginalversion.Ideasformodificationscamefromseveralsources:suggestionsfromreaders,theneedtoadaptthe booktothewideavailabilityofcalculatorsandpersonalcomputers,andmyown experiencesinteaching fromthebookandfindingportionsthatcouldbeimproved. Becauseoftheoverwhelminglyfavorablereactiontothefirstedition,Ihave maintaineditsbasiclevelandgeneralapproach.Hence,manyrevisionsaresimply changesinwordingtoimprove clarity. A fewchangesare major,themostimportant of whichareasfollows: (1)Thenumberofproblemsattheendofeachchapterisnearlydoubledto giveusersawiderchoiceandteacherstheabilitytovarytheirassignedproblems fromyeartoyear.Needlesstosay,anygivenreaderdoesnotneedtosolveanywherenearthe264problemsoffered;onthecontrary,halfadozenproblemsfrom eachchapterisprobablysufficient. (2)Severalreadersrecommendedplacingafewsimpleexercisesregularly throughoutthetexttoletreaderscheckthattheyreallyunderstandtheideasjust presented.Suchexercisesnowappearas"QuickChecks,"andIstronglyurgestudentsnewtothesubject totrythemall.If anyQuickChecktakesmuchlongerthan aminuteortwo,youprobablyneedtorereadtheprecedingfewparagraphs.The answerstoallQuick Checksaregiven intheanswer sectionatthebackof thebook. Thosewhofindthiskindof exercisedistractingcaneasilyskipthem. (3)Alsonewtothiseditionarecompletesummariesof alltheimportantequationsattheendofeachchaptertosupplementthefirstedition'sbriefsummaries insidethefrontandbackcovers.Thesenewsummarieslistallkeyequationsfrom thechapterandfromtheproblemsetsaswell. (4)Man}newfiguresappearinthisedition,particularlyintheearlierchapters. Thefigureshelpmakethetextseemlessintimidatingandreflectmyconscious xiiIntroductiontoError Analysis efforttoencouragestudentstothinkmorevisuallyaboutuncertainties.Ihaveobserved,forexample,thatmanystudentsgraspissuessuchastheconsistencyof measurementsif theythinkvisuallyintermsof errorbars. (5)Ihavereorganizedtheproblemsets attheendof eachchapterinthreeways. First,theAnswerssectionatthebackofthebooknowgivesanswerstoallof theodd-numberedproblems.(Thefirsteditioncontainedanswersonlytoselected problems.) The new arrangementissimpler andmoretraditional.Second,asa rough guidetothelevelof difficultyof eachproblem,Ihavelabeledtheproblemswitha systemof stars:Onestar(*) indicatesasimpleexercisethatshouldtakenomore thanacoupleof minutesif youunderstandthematerial.Twostars(**) indicatea somewhatharderproblem,andthreestars(***)indicateareallysearchingproblemthatinvolvesseveraldifferentconceptsandrequiresmoretime.Ifreelyadmit thattheclassificationisextremelyapproximate,butstudentsstudyingontheirown shouldfindtheseindicationshelpful,asmayteacherschoosingproblemstoassign totheirstudents. Third,Ihavearrangedtheproblemsbysectionnumber.Assoonasyouhave readSectionN,youshouldbereadytotryanyproblemlistedforthatsection. Althoughthissystemisconvenientforthestudentandtheteacher,itseemstobe currentlyoutoffavor.Iassumethisdisfavorstemsfromtheargumentthatthe systemmightexcludethedeepproblemsthatinvolvemanyideasfromdifferent sections.Iconsiderthisargumentspecious;aproblemlistedforSectionNcan,of course,involveideasfrommanyearliersectionsandcan,therefore,bejustasgeneralanddeepasanyproblemlistedunderamoregeneralheading. (6)IhaveaddedproblemsthatcallfortheuseofcomputerspreadsheetprogramssuchasLotus123orExcel.Noneof theseproblems isspecifictoa particular system;rather,theyurgethestudent tolearnhowtodovarioustasksusingwhatever systemisavailable.Similarly,severalproblemsencouragestudentstolearntouse thebuilt-infunctionsontheircalculatorstocalculatestandarddeviationsandthe like. (7)Ihaveaddedanappendix(AppendixE)toshowtwoproofsthatconcern samplestandarddeviations:first,that,basedonNmeasurementsofaquantity,the bestestimateofthetruewidthofitsdistributionisthesamplestandarddeviation with(N - 1)inthedenominator,andsecond,thattheuncertaintyinthisestimateis asgivenbyEquation(5.46).Theseproofsaresurprisinglydifficultandnoteasily foundintheliterature. It isapleasuretothankthemanypeoplewhohavemadesuggestionsforthis secondedition.AmongmyfriendsandcolleaguesattheUniversityof Colorado,the peoplewhogavemostgenerouslyof theirtimeandknowledgewereDavidAlexander,Dana Anderson,DavidBartlett,BarryBruce,JohnCumalat,MikeDubson,Bill Ford,MarkJohnson,JerryLeigh,UrielNauenberg,BillO'Sullivan,BobRistinen, RodSmythe,andChrisZafiratos.Atotherinstitutions,Iparticularlywanttothank R.G.Chambersof Leeds,England,Sharif Heger of theUniversityof NewMexico, StevenHoffmasterof GonzagaUniversity,HilliardMacomberof theUniversityof NorthernIowa,MarkSemonof BatesCollege,PeterTimbieofBrownUniversity, andDavidVanDykeof theUniversityof Pennsylvania.Iamdeeplyindebtedtoall of thesepeople fortheir generoushelp.Iamalsomost gratefultoBruce Armbruster xiiiPrefaceto the SecondEdition ofUniversityScienceBooksforhisgenerousencouragementandsupport.Above all,I wanttothankmywifeDebby;Idon't know howsheputsupwiththestresses andstrainsof bookwriting,butIamsogratefulshedoes. 1.R.Taylor September1996 Boulder,Colorado PrefacetotheFirstEdition Allmeasurements,howevercarefulandscientific,aresubjecttosomeuncertainties. Erroranalysisisthestudyandevaluationof theseuncertainties,itstwomainfunctionsbeingtoallowthescientisttoestimatehowlargehisuncertaintiesare,andto helphimtoreducethemwhennecessary.Theanalysisof uncertainties,or"errors," isavitalpartofanyscientificexperiment,anderroranalysisisthereforeanimportantpartof anycollegecourseinexperimentalscience.It canalsobeoneof the mostinterestingpartsof thecourse.Thechallengesof estimatinguncertaintiesand of reducingthemtoalevelthatallowsaproperconclusiontobedrawncanturna dullandroutinesetof measurementsintoatrulyinterestingexercise. Thisbookisanintroductiontoerroranalysisforusewithanintroductorycollegecourseinexperimentalphysicsof thesortusuallytakenbyfreshmenor sophomoresinthesciencesorengineering.Icertainlydonotclaimthaterroranalysisis themost(letalonetheonly)importantpartof suchacourse,butIhavefoundthat itisoftenthemostabusedandneglectedpart.Inmanysuchcourses,erroranalysis is"taught"byhandingoutacoupleofpagesofnotescontainingafewformulas, andthestudentisthenexpectedtogetonwiththejob solo.Theresultisthaterror analysisbecomesameaninglessritual,inwhichthestudentaddsafewlinesof calculationtotheendof eachlaboratoryreport,notbecauseheorsheunderstands why,butsimplybecausetheinstructorhassaidtodoso. Iwrotethisbook withtheconvictionthatanystudent,evenonewhohasnever heardof thesubject,shouldbeabletolearn what error analysisis,whyitisinteresting and important,andhow touse thebasic toolsof thesubject in laboratoryreports. PartIof thebook(Chapters1to5)triestodoallthis,withmanyexamplesof the kindof experimentencounteredinteachinglaboratories.Thestudentwhomasters thismaterialshouldthenknowandunderstandalmostalltheerroranalysisheor shewouldbeexpectedtolearninafreshmanlaboratorycourse:errorpropagation, theuseof elementarystatistics,andtheir justificationintermsof thenormaldistribution. PartIIcontainsaselectionofmoreadvancedtopics:least-squaresfitting,the correlationcoefficient,theK test,andothers.Thesewouldalmostcertainlynotbe includedofficiallyinafreshmanlaboratorycourse,although(fewstudentsmight becomeinterestedinsomeofthem.However,severalofthesetoricswouldbe neededinasecondlaboratorycourse,anditisprimarilyforthatreasonthatIhave includedthem.xv xviIntroductiontoError Analysis Iamwellawarethatthereisalltoolittletimetodevotetoasubjectlikeerror analysisinmostlaboratorycourses.AttheUniversityof Coloradowegiveaonehourlectureineachof thefirstsixweeksof ourfreshmanlaboratorycourse.These lectures,togetherwitha fewhomeworkassignmentsusingtheproblemsattheends ofthechapters,haveletuscoverChapters1through4indetailandChapter5 briefly.Thisgivesthestudentsaworkingknowledgeof errorpropagationandthe elementsof statistics,plusanoddingacquaintancewiththeunderlyingtheoryof the normaldistribution. Fromseveralstudents'commentsatColorado,itwasevidentthatthelectures wereanunnecessaryluxuryforatleastsomeofthestudents,whocouldprobably havelearnedthenecessarymaterialfromassignedreadingandproblemsets.Icertainlybelievethebookcouldbestudiedwithoutanyhelpfromlectures. PartIIcouldbe taughtinafewlecturesatthestartof asecond-year laboratory course(againsupplementedwithsomeassignedproblems).But,evenmorethan Part I,it was intendedtobe read bythestudent atanytimethathisor her own needs andinterestsmightdictate.Itssevenchaptersarealmostcompletelyindependentof oneanother,inordertoencouragethiskindof use. Ihaveincludedaselectionof problemsattheendofeachchapter;thereader doesneedtoworkseveralofthesetomasterthetechniques.Mostcalculationsof errorsarequitestraightforward. Astudentwhofindshimself orherself doingmany complicatedcalculations(eitherintheproblemsofthisbookorinlaboratoryreports)isalmostcertainlydoing something inan unnecessarilydifficultway.Inorder togiveteachersandreadersagoodchoice,Ihaveincludedmanymoreproblems thantheaveragereaderneedtry.A readerwhodidone-thirdof theproblemswould bedoingwell. Insidethefrontandbackcoversaresummariesof alltheprincipalformulas.I hopethereader willfindtheseausefulreference,bothwhile studyingthebookand afterward.Thesummariesareorganizedbychapters,and willalso,Ihope,serveas brief reviewstowhichthereadercanturnafterstudyingeachchapter. Withinthetext,a fewstatements-equations andrulesof procedure-have been highlightedbyashadedbackground.Thishighlightingisreservedforstatements thatareimportantandareintheirfinalform(thatis,willnotbemodifiedbylater work).Youwilldefinitelyneedtorememberthesestatements,sotheyhavebeen highlightedtobringthemtoyourattention. Thelevelof mathematicsexpectedof thereaderrisesslowlythroughthebook. Thefirsttwochaptersrequireonlyalgebra;Chapter3requiresdifferentiation(and partialdifferentiationinSection3.11,whichisoptional);Chapter5needsaknowledgeof integrationandtheexponentialfunction.InPartII, Iassumethatthereader isentirelycomfortablewithalltheseideas. Thebookcontainsnumerousexamplesofphysicsexperiments,butanunderstandingoftheunderlyingtheoryisnotessential.Furthermore,theexamplesare mostlytakenfromelementarymechanicsandopticstomakeitmorelikelythatthe studentwillalreadyhavestudiedthetheory.Thereaderwhoneedsitcanfindan accountof thetheorybylookingattheindexof anyintroductoryphysicstext. Erroranalysisisasubjectaboutwhichpeoplefeelpassionately,andnosingle treatmentcanhopetopleaseeveryone.Myownprejudiceisthat,whenachoice hastobemadebetween easeof understandingandstrictrigor,aphysicstextshould xviiPrefacetotheFirstEdition choosetheformer.Forexample,onthecontroversialquestionof combiningerrors inquadratureversusdirectaddition,Ihavechosentotreat directadditionfirst,since thestudentcaneasilyunderstandtheargumentsthatleadtoit. Inthelastfewyears,adramaticchangehasoccurredinstudentlaboratories withtheadventof thepocket calculator.Thishasa fewunfortunateconsequencesmostnotably,theatrocioushabitofquotingridiculouslyinsignificantfiguresjust becausethecalculatorproducedthem-butitisfromalmosteverypointofviewa tremendousadvantage,especiallyinerroranalysis.Thepocket calculator allowsone tocompute,ina fewseconds,meansandstandarddeviationsthatpreviouslywould havetakenhours.It rendersunnecessarymanytables,sinceonecannowcompute functionsliketheGaussfunctionmorequicklythanonecouldfindtheminabook of tables.Ihavetriedtoexploitthiswonderfultoolwhereverpossible. It ismypleasuretothank severalpeople fortheir helpfulcomments andsuggestions.Apreliminaryeditionofthebookwasusedatseveralcolleges,andIam gratefultomanystudents andcolleagues fortheir criticisms.Especiallyhelpful were thecommentsof JohnMorrisonandDavidNesbittattheUniversityofColorado, ProfessorsPrattandSchroederatMichiganState,ProfessorShugartatU.C.Berkeley,andProfessor SemonatBatesCollege.DianeCasparian,LindaFrueh,andConnieGuruletypedsuccessivedraftsbeautifullyandatgreatspeed.Withoutmy mother-in-law,FrancesKretschmann,theproofreadingwouldneverhavebeendone intime.Iamgratefultoallofthesepeoplefortheirhelp;butaboveallIthank mywife,whosepainstakingandruthlesseditingimprovedthewholebookbeyond measure. J. R.Taylor November1,1981 Boulder,Colorado ANINTRODUCTIONTO Error Analysis PartI I.PreliminaryDescriptionof ErrorAnalysis 2.HowtoReport andUseUncertainties 3.Propagationof Uncertainties 4.StatisticalAnalysisof RandomUncertainties 5.TheNormalDistribution PartIintroducesthebasicideasof erroranalysisastheyareneededinatypical first-year,college physics laboratory.The firsttwochapters describe what error analysisis,whyitisimportant,andhowitcanbeusedinatypicallaboratoryreport. Chapter3describeserrorpropagation,wherebyuncertaintiesintheoriginalmeasurements"propagate"throughcalculationstocauseuncertaintiesinthecalculated finalanswers.Chapters4and5introducethestatisticalmethodswithwhichthesocalledrandomuncertaintiescanbeevaluated. ChapterI PreliminaryDescription ofErrorAnalysis Error analysis isthestudyandevaluation of uncertaintyin measurement.Experience hasshownthatnomeasurement,howevercarefullymade,canbecompletelyfree of uncertainties.Becausethewholestructureandapplicationof sciencedependson measurements,theabilitytoevaluatetheseuncertaintiesandkeepthemtoaminimumiscruciallyimportant. This firstchapter describes some simple measurements that illustratetheinevitableoccurrenceofexperimentaluncertaintiesandshowtheimportanceof knowing howlargetheseuncertaintiesare.Thechapterthendescribeshow(insomesimple cases,atleast)themagnitudeoftheexperimentaluncertaintiescanbeestimated realistically,oftenbymeansof littlemorethanplaincommonsense. 1.1ErrorsasUncertainties Inscience,theword errordoes notcarrytheusual connotations of theterms mistake orblunder.Errorinascientificmeasurementmeanstheinevitableuncertaintythat attendsallmeasurements.Assuch,errorsarenotmistakes;youcannoteliminate thembybeingverycareful.The bestyoucanhopetodoistoensurethaterrorsare assmallasreasonablypossibleandtohaveareliableestimateofhowlargethey are.Mosttextbooksintroduceadditionaldefinitionsof error,andthesearediscussed later.Fornow,errorisusedexclusivelyinthesenseofuncertainty,andthetwo wordsareusedinterchangeably. 1.2Inevitabilityof Uncertainty Toillustratetheinevitable occurrence of uncertainties,wehaveonlytoexamineany everydaymeasurementcarefully.Consider,forexample,a carpenter whomust measuretheheightof adoorwaybeforeinstallinga door.Asa firstroughmeasurement, hemightsimplylookatthedoorwayandestimateitsheightas210cm. Thiscrude "measurement"iscertainlysubjecttouncertainty.If pressed,thecarpentermight expressthisuncertaintybyadmittingthattheheightcouldbeanywherebetween 205cmand215cm. 4ChapterI:PreliminaryDescriptionof Error Analysis If hewantedamoreaccuratemeasurement,hewoulduseatapemeasureand mightfindtheheightis211.3cm.Thismeasurementiscertainlymoreprecisethan hisoriginalestimate,butitisobviouslystillsubjecttosomeuncertainty,becauseit isimpossibleforhimtoknowtheheighttobeexactly211.3000cmratherthan 211.3001cm,forexample. Thisremaininguncertaintyhasmanysources,severalof whicharediscussedin thisbook.Somecausescouldberemovedif thecarpentertookenoughtrouble.For example,onesourceof uncertaintymightbethatpoorlightinghampersreadingof thetape;thisproblemcouldbecorrectedbyimprovingthelighting. Ontheotherhand,somesourcesofuncertaintyareintrinsictotheprocessof measurementandcanneverberemovedentirely.Forexample,letussupposethe carpenter'stapeisgraduatedinhalf-centimeters.Thetopof thedoorprobablywill notcoincidepreciselywithoneof thehalf-centimetermarks,andif itdoesnot,the carpentermustestimate just wherethetopliesbetweentwomarks.Evenif thetop happenstocoincidewithoneof themarks,themarkitselfisperhapsamillimeter wide;sohemustestimatejustwherethetoplieswithinthemark.Ineithercase, thecarpenterultimatelymustestimatewherethetopof thedoorliesrelativetothe markingsonthetape,andthisnecessitycausessomeuncertaintyinthemeasurement. By buying a better tapewithcloser andfinermarkings,thecarpenter canreduce hisuncertaintybutcannoteliminateitentirely.If hebecomesobsessivelydeterminedtofindtheheightof thedoorwiththegreatestprecisiontechnicallypossible, hecouldbuyanexpensive laser interferometer.But eventheprecisionof aninterferometerislimitedtodistancesoftheorderofthewavelengthoflight(about 0.5 X10-6 meters). Althoughthecarpenter wouldnowbeabletomeasuretheheight withfantasticprecision,hestillwouldnotknowtheheightof thedoorwayexactly. Furthermore,asourcarpenter strivesforgreaterprecision,hewillencounteran importantproblemof principle.Hewillcertainlyfindthattheheightisdifferentin different places.Eveninone place,hewill findthattheheight varies if thetemperatureandhumidityvary,orevenif heaccidentallyrubsoffathinlayerof dirt.In otherwords,hewillfindthatthereisnosuchthingastheheightof thedoorway. This kindof problem iscalled a problem of definition(theheight of thedoor isnota well-defined quantity)andplaysanimportantroleinmanyscientificmeasurements. Ourcarpenter'sexperiencesillustrateapointgenerallyfoundtobetrue,thatis, thatnophysicalquantity(alength,time,ortemperature,forexample)canbemeasuredwithcompletecertainty.Withcare,wemaybeabletoreducetheuncertainties untiltheyareextremelysmall,buttoeliminatethementirelyisimpossible. Ineverydaymeasurements,wedonotusuallybothertodiscussuncertainties. Sometimestheuncertaintiessimplyarenotinteresting.If wesaythatthedistance betweenhomeandschoolis3miles,whetherthismeans"somewherebetween2.5 and3.5miles"or"somewhere between2.99and3.01miles"isusuallyunimportant. Oftentheuncertaintiesareimportantbutcanbeallowedforinstinctivelyandwithout explicit consideration.Whenourcarpenter fitshisdoor, hemustknowitsheight withanuncertaintythatislessthan1mmorso.Aslongastheuncertaintyisthis small,thedoorwill(forallpracticalpurposes)beaperfect fit,andhisconcernwith erroranalysisisatanend. 5Section1.3Importanceof Knowing theUncertainties 1.3ImportanceofKnowingtheUncertainties Ourexampleof thecarpentermeasuringadoorwayillustrateshowuncertaintiesare alwayspresentinmeasurements.Letusnowconsideranexamplethatillustrates moreclearlythecrucialimportanceof knowinghowbigtheseuncertaintiesare. Supposewearefacedwithaproblemliketheonesaidtohavebeensolvedby Archimedes.Weareaskedtofindoutwhetheracrownismadeof I8-karatgold,as claimed,oracheaperalloy.FollowingArchimedes,wedecidetotestthecrown's densityP knowingthatthedensitiesof 18-karat goldandthesuspectedalloyare Pgold=15.5gram/cm3 and Palloy=13.8gram/cm3. If wecanmeasurethedensityofthecrown,weshouldbeable(asArchimedes suggested)todecidewhetherthecrownisreallygoldbycomparingPwiththe knowndensitiesPgoldandPalloy. Supposewesummontwoexpertsinthemeasurementof density.Thefirstexpert,George,mightmakea quickmeasurement of P andreport thathisbestestimate forP is15andthatitalmostcertainlyliesbetween13.5and16.5gram/cm3.Our secondexpert,Martha,mighttakealittlelongerandthenreportabestestimateof 13.9andaprobablerangefrom13.7to14.1gram/cm3.Thefindingsofourtwo expertsaresummarizedinFigure1.1. Density p (gram/cm3) 17 16 I---gold George-- 15 14Martha - - - - + ~ I ---alloy 13 Figure1.1.Twomeasurementsof thedensityof asupposedlygoldcrown.Thetwoblackdots showGeorge'sandMartha'sbestestimatesforthedensity;thetwoverticalerrorbarsshowtheir marginsof error,therangeswithinwhichtheybelievethedensityprobablylies.George'suncertaintyissolargethatbothgoldandthesuspectedalloyfallwithinhismarginsof error;therefore,hismeasurementdoesnotdeterminewhichmetalwasused.Martha'suncertaintyisappreciablysmaller,andhermeasurementshowsclearlythatthecrownisnotmadeof gold. 6 ChapterI:PreliminaryDescriptionof ErrorAnalysis ThefirstpointtonoticeabouttheseresultsisthatalthoughMartha'smeasurementismuchmoreprecise,George'smeasurementisprobablyalsocorrect.Each expertstatesarangewithinwhichheorsheisconfidentplies,andtheseranges overlap;soitisperfectlypossible(andevenprobable)thatbothstatementsare correct. NotenextthattheuncertaintyinGeorge'smeasurementissolargethathis resultsareof nouse.Thedensitiesof 18-karat goldandof thealloybothliewithin hisrange,from13.5to16.5gram/cm3;sonoconclusioncanbedrawnfrom George'smeasurements.Ontheotherhand,Martha's measurementsindicateclearly thatthecrownisnotgenuine;thedensityof thesuspectedalloy,13.8,liescomfortablyinsideMartha'sestimatedrangeof13.7to14.1,butthatof18-karatgold, 15.5,isfaroutsideit.Evidently,if themeasurementsaretoallowaconclusion,the experimentaluncertaintiesmustnotbetoolarge.Theuncertaintiesdonotneedtobe extremelysmall,however.Inthisrespect,ourexampleistypicalof manyscientific measurements,forwhichuncertaintieshavetobereasonablysmall(perhapsafew percent of themeasured value) but forwhichextremeprecision isoftenunnecessary. BecauseourdecisionhingesonMartha'sclaimthatpliesbetween13.7and 14.1gram/cm3,shemustgiveussufficientreasontobelieveherclaim.Inother words,shemust justifyherstatedrangeof values.Thispointisoftenoverlookedby beginningstudents,whosimplyasserttheiruncertaintiesbutomitanyjustification. Withoutabriefexplanationofhowtheuncertaintywasestimated,theassertionis almostuseless. Themostimportantpointaboutourtwoexperts'measurementsisthis:Like mostscientificmeasurements,theywouldbothhavebeenuselessiftheyhadnot includedreliablestatementsof theiruncertainties.Infact,if weknewonlythetwo bestestimates(15forGeorgeand13.9forMartha),notonlywouldwehavebeen unabletodrawa validconclusion,but we couldactuallyhavebeenmisled,because George'sresult(15)seemstosuggestthecrownisgenuine. 1.4MoreExamples Theexamplesinthepasttwosectionswerechosen,notfortheirgreatimportance, buttointroducesomeprincipalfeaturesof error analysis.Thus,youcanbeexcused forthinkingthemalittlecontrived.Itiseasy,however,tothinkofexamplesof greatimportanceinalmostanybranchof appliedorbasicscience. Intheappliedsciences,forexample,theengineersdesigningapowerplant must knowthecharacteristics of thematerialsandfuelstheyplantouse.Themanufacturerofapocketcalculatormustknowthepropertiesofitsvariouselectronic components.Ineachcase,somebodymustmeasuretherequiredparameters,and havingmeasuredthem,mustestablishtheirreliability,whichrequireserroranalysis. Engineers concernedwith thesafetyof airplanes,trains,orcarsmustunderstandthe uncertaintiesindrivers'reactiontimes,inbrakingdistances,andinahostof other variables;failuretocarryouterror analysiscanleadtoaccidentssuchasthatshown onthecoverof thisbook.Evenina lessscientificfield,suchasthemanufactureof clothing,erroranalysisintheformof qualitycontrolplaysa vitalpart. 7Section1.4MoreExamples Inthebasicsciences,erroranalysishasanevenmorefundamentalrole.When anynewtheoryisproposed,itmustbetestedagainstoldertheoriesbymeansof oneormoreexperimentsforwhichthenewandoldtheoriespredictdifferentoutcomes.Inprinciple,aresearchersimplyperformstheexperimentandletstheoutcomedecidebetween therivaltheories.Inpractice,however,thesituationiscomplicatedbytheinevitableexperimentaluncertainties.Theseuncertaintiesmustallbe analyzedcarefullyandtheireffectsreduceduntiltheexperimentsinglesoutone acceptabletheory.That is,theexperimentalresults,withtheir uncertainties,mustbe consistentwiththepredictionsofonetheoryandinconsistentwiththoseofall known,reasonablealternatives.Obviously,thesuccessof suchaproceduredepends criticallyonthescientist'sunderstandingof erroranalysisandabilitytoconvince othersof thisunderstanding. Afamousexampleof suchatestofascientifictheoryisthemeasurementof thebendingof lightasitpassesnearthesun.WhenEinsteinpublishedhisgeneral theoryof relativityin1916,hepointedoutthatthetheorypredictedthatlightfrom astarwouldbebentthroughananglea=1.8"asitpassesnearthesun.The simplestclassicaltheorywouldpredictnobending(a =0),andamorecareful classicalanalysiswouldpredict(asEinsteinhimself notedin1911) bendingthrough ananglea=0.9".Inprinciple,allthatwasnecessarywastoobserveastarwhen itwasalignedwiththeedgeof thesunandtomeasuretheangleof bendinga.If theresultwerea=1.8",generalrelativitywouldbevindicated(atleastforthis phenomenon);if awerefoundtobe0or0.9",generalrelativitywouldbewrong andoneof theoldertheoriesright. Inpractice,measuringthebendingof lightbythesunwasextremelyhardand waspossibleonlyduringasolareclipse.Nonetheless,in1919itwassuccessfully measuredbyDyson,Eddington,andDavidson,whoreportedtheirbestestimateas a=2",with95%confidencethatitlaybetween1.7"and2.3".1Obviously,this result wasconsistent withgeneralrelativityandinconsistentwitheitherof theolder predictions.Therefore,itgavestrongsupporttoEinstein'stheoryofgeneralrelativity. At thetime,thisresult was controversial.Manypeople suggested that theuncertaintieshadbeen badlyunderestimatedandhencethattheexperiment wasinconclusive.Subsequentexperimentshavetended,toconfirmEinstein'spredictionandto vindicatetheconclusionof Dyson,Eddington,andDavidson.Theimportantpoint hereisthatthewholequestionhingedontheexperimenters'abilitytoestimate reliablyalltheiruncertaintiesandtoconvinceeveryoneelsetheyhaddoneso. Studentsinintroductoryphysicslaboratoriesarenotusuallyabletoconduct definitivetestsof newtheories.Often,however,theydoperformexperimentsthat testexisting physical theories.For example,Newton's theoryof gravitypredictsthat bodiesfallwithconstantaccelerationg(undertheappropriateconditions),andstudentscanconduct experimentstotestwhetherthisprediction iscorrect. At first,this kindof experiment mayseemartificialandpointlessbecausethetheorieshaveobvi1 Thissimplifiedaccountisbasedontheoriginalpaperof F.W.Dyson, A.S.Eddington,andC.Davidson (PhilosophicalTransactionsof theRoyalSociety,220A,1920,291).1haveconvertedtheprobableerror originallyquotedintothe95%confidencelimits.Theprecisesignificanceofsuchconfidencelimitswillbe establishedinChapter5. 8 ChapterI:PreliminaryDescriptionof ErrorAnalysis ouslybeentestedmanytimeswithmuchmoreprecisionthanpossiblein ateaching laboratory.Nonetheless,ifyouunderstandthecrucialroleoferroranalysisand acceptthechallengetomakethemostprecisetestpossiblewiththeavailableequipment,suchexperimentscanbeinterestingandinstructiveexercises. 1.5EstimatingUncertaintiesWhenReadingScales Thusfar,wehaveconsideredseveralexamplesthatillustratewhyeverymeasurementsuffersfromuncertaintiesandwhytheirmagnitudeisimportanttoknow.We havenotyetdiscussedhowwecanactuallyevaluatethemagnitudeofanuncertainty.Suchevaluationcanbefairlycomplicatedandisthemaintopicof thisbook. Fortunately,reasonableestimatesoftheuncertaintyofsomesimplemeasurements areeasytomake,oftenusingnomorethancommonsense.HereandinSection 1.6,Idiscussexamplesof suchmeasurements.Anunderstandingof theseexamples willallowyoutobeginusingerroranalysisinyourexperimentsandwillformthe basisforlaterdiscussions. Thefirstexampleisameasurementusingamarkedscale,suchastherulerin Figure1.2orthevoltmeterinFigure1.3.Tomeasurethelengthofthepencilin millimeters oto20304050 1"II!!!!!I,,!,!!!!!I!!,!!!!!!I!!!!!!!!!I!!!!!!!!!I!!!I Figure1.2.Measuringalengthwitharuler. Figure1.2,wemustfirstplacetheendof thepenciloppositethezeroof theruler andthendecidewherethetipcomestoontheruler'sscale.Tomeasurethevoltage inFigure1.3,wehavetodecidewheretheneedlepointsonthevoltmeter'sscale. If weassumetherulerandvoltmeterarereliable,thenineachcasethemainprobvolts 5 46 5) Figure1.3.Areadingonavoltmeter. 9Section1.5EstimatingUncertaintiesWhenReadingScales lemistodecidewhereacertainpointliesinrelationtothescalemarkings.(Of course,ifthereisanypossibilitytherulerandvoltmeterarenotreliable,wewill havetotakethisuncertaintyintoaccountaswell.) Themarkingsof therulerinFigure1.2arefairlyclosetogether(1mmapart). Wemightreasonablydecidethatthelengthshownisundoubtedlycloserto36mm thanitisto35or 37mmbutthatnomoreprecisereadingispossible.Inthiscase, wewouldstateourconclusionas bestestimateof length=36mm, (1.1) probablerange:35.5to36.5mm andwouldsaythatwehavemeasuredthelengthtothenearestmillimeter. Thistypeof conclusion-thatthequantityliesclosertoagivenmarkthanto eitherof itsneighboringmarks-isquitecommon.Forthisreason,manyscientists introducetheconventionthatthestatement"I=36mm"withoutanyqualification ispresumedtomeanthatI iscloserto36thanto35or37;thatis, I=36mm means 35.5mm:%;I:%;36.5mm. Inthesameway,ananswersuchasx=1.27 withoutanystateduncertaintywould bepresumedtomeanthatxliesbetween1.265and1.275.Inthisbook,Idonot usethisconvention but instead always indicate uncertaintiesexplicitly.Nevertheless, youneedtounderstandtheconventionandknowthatitappliestoanynumber statedwithoutanuncertainty,especiallyinthisageofpocketcalculators,which displaymanydigits.If youunthinkinglycopyanumbersuchas123.456 fromyour calculatorwithoutanyqualification,thenyourreaderisentitledtoassumethenumberisdefinitelycorrecttosixsignificantfigures,whichisveryunlikely. ThemarkingsonthevoltmetershowninFigure1.3aremorewidelyspaced thanthoseontheruler.Here,mostobserverswouldagreethatyoucandobetter thansimplyidentifythemarktowhichthepointerisclosest.Becausethespacing islarger,youcanrealisticallyestimatewherethepointerliesinthespacebetween twomarks.Thus,areasonableconclusionforthevoltageshownmightbe bestestimateof voltage=5.3volts, (1.2) probablerange:5.2to5.4volts. Theprocessof estimatingpositionsbetweenthescalemarkingsiscalledinterpolation.It isanimportanttechniquethatcanbeimprovedwithpractice. DifferentobserversmightnotagreewiththepreciseestimatesgiveninEquations(1.1)and(1.2).Youmightwelldecidethatyoucouldinterpolateforthelength inFigure1.2andmeasureitwithasmalleruncertaintythanthatgiveninEquation (1.1).Nevertheless,fewpeoplewoulddenythatEquations(1.1)and(1.2)arereasonableestimatesofthequantitiesconcernedandoftheirprobableuncertainties. Thus,weseethatapproximateestimationofuncertaintiesisfairlyeasywhenthe onlyproblemistolocateapointonamarkedscale. 10ChapterI:PreliminaryDescriptionof Error Analysis 1.6EstimatingUncertaintiesinRepeatableMeasurements Manymeasurementsinvolveuncertaintiesthataremuchhardertoestimatethan thoseconnectedwithlocatingpointsonascale.Forexample,whenwemeasurea timeintervalusingastopwatch,themainsourceof uncertaintyisnotthedifficulty of readingthedialbutourownunknownreactiontimeinstartingandstoppingthe watch.Sometimesthesekindsofuncertaintycanbeestimatedreliably,ifwecan repeatthemeasurementseveraltimes.Suppose,forexample,wetimetheperiodof apendulumonceandgetananswerof2.3seconds.Fromonemeasurement,we can'tsaymuchabouttheexperimentaluncertainty.Butifwerepeatthemeasurementandget2.4seconds,thenwecanimmediatelysaythattheuncertaintyis probablyof theorderof0.1s.If asequenceoffourtimingsgivestheresults(in seconds), 2.3,2.4,2.5,2.4,(1.3) thenwecanbegintomakesomefairlyrealisticestimates. First,anaturalassumptionisthatthebestestimateof theperiodistheaverage 2 value,2.4s. Second,anotherreasonablysafeassumptionisthatthecorrectperiodliesbetweenthelowestvalue,2.3,andthehighest,2.5.Thus,wemightreasonablyconcludethat bestestimate=average=2.4s, (1.4) probablerange:2.3to2.5s. Wheneveryoucanrepeatthesamemeasurementseveraltimes,thespreadin yourmeasuredvaluesgivesavaluableindicationoftheuncertaintyinyourmeasurements.InChapters4and5,Idiscussstatisticalmethodsfortreatingsuchrepeatedmeasurements.Undertherightconditions,thesestatisticalmethodsgivea moreaccurateestimateof uncertaintythanwehavefoundinEquation(1.4)using justcommonsense.Aproperstatisticaltreatmentalsohastheadvantageof giving anobjective value fortheuncertainty,independent of theobserver's individual judgment?Nevertheless,theestimateinstatement(1.4)representsasimple,realistic conclusiontodrawfromthefourmeasurementsin(1.3). Repeatedmeasurementssuchasthosein(1.3)cannotalwaysbereliedonto revealtheuncertainties.First,wemustbesurethatthequantitymeasuredisreally thesamequantityeachtime.Suppose,forexample,wemeasurethebreaking strengthoftwosupposedlyidenticalwiresbybreakingthem(somethingwecan't domorethanoncewitheachwire).If wegettwodifferentanswers,thisdifference mayindicatethatourmeasurementswereuncertainorthatthetwowireswerenot reallyidentical.Byitself,thedifferencebetweenthetwoanswersshedsnolighton thereliabilityof ourmeasurements. 2 IwillproveinChapter5thatthebestestimatebasedonseveralmeasurementsofaquantityisalmost alwaystheaverageof themeasurements. 3 Also,aproperstatisticaltreatmentusuallygivesasmalleruncertaintythanthefullrangefromthelowest tothehighestobservedvalue.Thus,uponlookingatthefourtimingsin(1.3),wehavejudgedthattheperiod is"probably"somewherebetween2.3and2.5s.Thestatisticalmethodsof Chapters4and5letusstatewith 70%confidencethattheperiodliesinthesmallerrangeof 2.36to2.44s. IISection1.6Estimating UncertaintiesinRepeatableMeasurements Evenwhenwecanbesurewearemeasuringthesamequantityeachtime, repeatedmeasurementsdonotalwaysrevealuncertainties.Forexample,suppose theclockusedforthetimingsin(1.3)wasrunningconsistently5%fast.Then,all timingsmadewithitwillbe5%toolong,andnoamountofrepeating(withthe sameclock)willrevealthisdeficiency.Errorsof thissort,whichaffectallmeasurementsinthesameway,arecalledsystematicerrorsandcanbehardtodetect,as discussedinChapter4.Inthisexample,theremedyistochecktheclockagainsta morereliableone.Moregenerally,ifthereliabilityofanymeasuringdeviceisin doubt,itshouldclearlybecheckedagainstadeviceknowntobemorereliable. Theexamplesdiscussedinthisandtheprevious sectionshow thatexperimental uncertaintiessometimescanbeestimatedeasily.Ontheotherhand,manymeasurementshaveuncertaintiesthatarenotsoeasilyevaluated.Also,weultimatelywant moreprecisevaluesfortheuncertaintiesthanthesimpleestimatesjustdiscussed. ThesetopicswilloccupyusfromChapter3onward.InChapter2,Iassumetemporarilythatyouknowhowtoestimatetheuncertaintiesinallquantitiesofinterest, sothatwecandiscusshowtheuncertaintiesarebestreportedandhowtheyare usedindrawinganexperimentalconclusion. Chapter2 How toReportandUse Uncertainties Having readChapter 1,youshould nowhave some idea of theimportance of experimentaluncertaintiesandhowtheyarise.Youshouldalsounderstandhowuncertaintiescanbeestimatedinafewsimplesituations.Inthischapter,youwilllearnsome basic notationsandrulesof erroranalysisandstudyexamplesof theiruseintypical experimentsinaphysicslaboratory.Theaimistofamiliarizeyouwiththebasic vocabularyoferroranalysisanditsuseintheintroductorylaboratory.Chapter3 beginsasystematicstudyof howuncertaintiesareactuallyevaluated. Sections2.1to2.3defineseveralbasicconceptsinerroranalysisanddiscuss generalrulesforstatinguncertainties.Sections2.4to2.6discusshowtheseideas couldbeusedintypicalexperimentsinanintroductoryphysicslaboratory.Finally, Sections2.7to2.9introducefractionaluncertaintyanddiscussitssignificance. 2.1BestEstimate+Uncertainty Wehaveseenthatthecorrectwaytostatetheresultofmeasurementistogivea bestestimateofthequantityandtherangewithinwhichyouareconfidentthe quantitylies.Forexample,theresultofthetimingsdiscussedinSection1.6was reportedas bestestimateof time=2.4s, (2.1) probablerange:2.3to2.5s. Here,thebest estimate,2.4 s,liesatthemidpoint of theestimated rangeof probable values,2.3to2.5s,asithasinalltheexamples.Thisrelationshipisobviously naturalandpertainsinmostmeasurements.It allowstheresultsof themeasurement tobeexpressedincompactform.Forexample,themeasurementofthetimerecordedin(2.1)isusuallystatedasfollows: measuredvalueof time=2.40.1s.(2.2) Thissingleequationisequivalenttothetwostatementsin(2.1). Ingeneral,theresultof anymeasurementof aquantityxisstatedas (measuredvalueof x)XbeSl &. (2.3) 14Chapter2:HowtoReport andUseUncertainties Thisstatementmeans,first,thattheexperimenter'sbestestimateforthequantity concernedisthenumber Xbest'andsecond,thatheor sheisreasonablyconfidentthe quantityliessomewhere between x best - Oxand xbest+ Ox.ThenumberOxiscalled theuncertainty,orerror,ormarginof errorinthemeasurementof x.Forconvenience,theuncertaintyOxisalwaysdefinedtobepositive,sothatx best +Oxis alwaysthehighestprobablevalueofthemeasuredquantityandx best - Oxthe lowest. Ihaveintentionallyleftthemeaningof therange Xbcst - OxtoXbest+Oxsomewhatvague,butitcansometimesbemademoreprecise.Inasimplemeasurement suchasthatoftheheightofadoorway,wecaneasilystatearangexbest- Ox toxbest+Oxwithinwhichweareabsolutelycertainthemeasuredquantitylies. Unfortunately,inmostscientificmeasurements,suchastatementishardtomake. Inparticular,tobecompletelycertainthatthemeasuredquantityliesbetween x best - Oxand Xbest+Ox,weusuallyhavetochoosea valueforOxthatistoolarge tobeuseful.Toavoidthissituation,wecansometimeschooseavaluefor8xthat letsusstatewithacertainpercentconfidencethattheactualquantitylieswithinthe rangex best Ox.Forinstance,thepublicopinionpollsconductedduringelections aretraditionallystatedwithmarginsof errorthatrepresent95%confidencelimits. Thestatementthat60%of theelectoratefavorCandidate A,withamarginof error of 3percentagepoints(603),meansthatthepollstersare95%confidentthatthe percentof votersfavoringCandidate Aisbetween57and63;inotherwords,after manyelections,weshouldexpectthecorrectanswertohavebeeninsidethestated marginsof error95%of thetimesandoutsidethesemarginsonly5%of thetimes. Obviously,wecannotstateapercentconfidenceinourmarginsof erroruntil weunderstandthestatisticallawsthatgoverntheprocessof measurement.Ireturn tothispointinChapter4.Fornow,letusbecontentwithdefiningtheuncertainty Oxsothatweare"reasonablycertain"themeasuredquantityliesbetween Xbest - Ox andXbest + ax. QuickCheck'2.1 .(a)Astudentmeasuresthelengthofasimplependulum andreportshisbestestimateas110mmandtherangeinwhichthelength probablyliesas108to112mm.Rewritethisresultinthestandardform(2.3). (b)If anotherstudentreportshermeasurementof acurrentasI=3.050.03 amps,whatistherangewithinwhich Iprobablylies? 2.2SignificantFigures Severalbasicrulesforstatinguncertaintiesareworthemphasizing.First,because thequantityOxisanestimateofanuncertainty,obviouslyitshouldnotbestated 1 These "QuickChecks"appearatintervalsthroughthetexttogiveyoua chancetocheckyourunderstandingof theconceptjustintroduced. Theyarestraightforwardexercises,andmanycanbedoneinyourhead.I urgeyoutotakeamomenttomakesureyoucandothem;ifyoucannot,youshouldrereadthepreceding fewparagraphs. 15Section2.2SignificantFigures withtoomuchprecision.If wemeasuretheaccelerationof gravityg,itwouldbe absurdtostatearesultlike (measuredg)=9.820.02385m/s2.(2.4) The uncertaintyinthemeasurement cannot conceivablybe knowntofoursignificant figures.Inhigh-precisionwork,uncertaintiesaresometimesstatedwithtwosignificantfigures,butforourpurposeswecanstatethefollowingrule: RuleforStatingUncertainties Experimentaluncertaintiesshouldalmostalwaysbe (2.5) roundedtoonesignificant figure. Thus,ifsomecalculationyieldstheuncertaintyog=0.02385m/s2,thisanswer shouldberoundedtoog=0.02m/s2,andtheconclusion(2.4)shouldberewritten as (measuredg)=9.820.02m/s2.(2.6) Animportantpracticalconsequenceof thisruleisthatmanyerrorcalculationscan becarriedoutmentallywithoutusingacalculatororevenpencilandpaper. Therule(2.5)hasonlyonesignificantexception.If theleadingdigitinthe uncertaintyOxisa1,thenkeepingtwosignificantfiguresinOxmaybebetter.For example,supposethatsomecalculationgavetheuncertaintyOx= 0.14.Rounding thisnumber toOx= 0.1would be a substantialproportionate reduction,so wecould arguethatretainingtwofiguresmightbelessmisleading,andquoteOx= 0.14. The sameargumentcouldperhapsbeappliedif theleadingdigitisa2butcertainlynot if itisanylarger. Oncetheuncertaintyinameasurementhasbeenestimated,thesignificantfiguresinthemeasuredvaluemustbeconsidered.Astatementsuchas measuredspeed=6051.7830m/s(2.7) isobviouslyridiculous.Theuncertaintyof 30 meansthatthedigit5might reallybe assmallas2oraslargeas8.Clearlythetrailingdigits1,7,and8havenosignificanceatallandshouldberounded.Thatis,thecorrectstatementof (2.7)is measuredspeed=605030m/s.(2.8) Thegeneralruleisthis: RuleforStating Answers The last significant figurein anystatedanswer should (2.9)usuallybeofthesameorderofmagnitude(inthe samedecimalposition)astheuncertainty. 16Chapter 2:HowtoReport andUseUncertainties Forexample,theanswer92.81withanuncertaintyof 0.3shouldberoundedas 92.80.3. If itsuncertaintyis3,thenthesameanswershouldberoundedas 933, andif theuncertaintyis30,thentheanswershouldbe 9030. Animportantqualificationtorules(2.5)and(2.9)isasfollows :Toreduce inaccuracies caused byrounding,any numbers tobe used insubsequent calculations shouldnormallyretainatleastonesignificant figuremorethanisfinallyjustified. Attheendof thecalculations,thefinalanswershouldberoundedtoremovethese extra,insignificant figures.Anelectroniccalculator willhappilycarrynumberswith farmoredigitsthanarelikelytobesignificantinanycalculationyoumakeina laboratory.Obviously,thesenumbersdonotneedtoberoundedinthemiddleof a calculationbutcertainlymustberoundedappropriatelyforthefinalanswers.2 Notethattheuncertaintyinanymeasuredquantityhasthesamedimensionsas themeasuredquantityitself.Therefore,writingtheunits(m/s2,cm3,etc.)afterboth theanswerandtheuncertaintyisclearerandmoreeconomical,asinEquations (2.6)and(2.8).Bythesametoken,if ameasurednumberissolargeorsmallthat itcallsforscientificnotation(theuseoftheform3X103 insteadof3,000,for example),thenitissimplerandclearertoputtheansweranduncertaintyinthe sameform.Forexample,theresult measuredcharge=(1.610.05)X10-19 coulombs ismucheasiertoreadandunderstandinthisformthanit wouldbeintheform measuredcharge=1.61X10-19 5X10-21 coulombs. QuickCheck2.2.Rewriteeachofthefollowingmeasurementsinitsmost appropriateform : (a)v8.1234560.0312m/s (b)x3.1234X104 2 m (c)m5.6789X10-7 3X10-9 kg. 2.3Discrepancy BeforeIaddressthequestionof howtouseuncertaintiesinexperimentalreports,a fewimportanttermsshouldbeintroducedanddefined.First,iftwomeasurements 2 Rule(2.9)hasonemoresmallexception.If theleadingdigitintheuncertaintyissmall(alor,perhaps, a2),retaining one extradigitinthefinalanswermaybeappropriate.Forexample,ananswersuchas3.61 isquiteacceptablebecauseonecouldarguethatroundingitto41wouldwasteinformation. 17 Section2.3Discrepancy of thesame quantitydisagree,wesaythereisadiscrepancy.Numerically,wedefine thediscrepancybetweentwomeasurementsastheirdifference: discrepancy=differencebetweentwomeasured (2.10)valuesof the samequantity. Morespecifically,eachof thetwomeasurementsconsistsof abestestimateandan uncertainty,andwedefinethediscrepancyasthedifferencebetweenthetwobest estimates. Forexample,if twostudentsmeasurethesameresistanceasfollows Student A:151ohms and StudentB:252ohms, theirdiscrepancyis discrepancy=25- 15=10ohms. Recognizethatadiscrepancymayor maynotbesignificant.ThetwomeasurementsjustdiscussedareillustratedinFigure2.1(a),whichshowsclearlythatthe discrepancyof10ohmsissignificantbecausenosinglevalueof theresistanceis compatiblewithbothmeasurements.Obviously,atleastonemeasurementisincorrect,andsomecarefulcheckingisneededtofindoutwhatwentwrong. 3030 ~~ onon DEE BI-I..c..c 2- 2- discrepancy =1020 dimep,"'y = 10 20 WB'sothebestestimate xbest iscloserto xA thantox B,justasitshouldbe. QuickCheck7.1.Workersfromtwolaboratoriesreportthelifetimeof acertainparticleas10.00.5and121,bothinnanoseconds.If theydecideto combinethetworesults,what willbetheirrespective weightsasgivenby(7.8) andtheirweightedaverageasgivenby(7.9)? Ouranalysisof twomeasurementscanbegeneralizedtocoveranynumberof measurements.Supposewehave Nseparatemeasurementsof aquantityx, withtheircorrespondinguncertainties(Tl'(T2'.. ,(TN.Arguingmuchasbefore,we findthatthebestestimatebasedonthesemeasurementsistheweightedaverage (7.10) wherethesumsareoverallNmeasurements,i=1,. .. , N,andtheweightWiof each measurementisthereciprocalsquareof thecorresponding uncertainty, 1 (7.11) fori1,2,... , N. 176Chapter 7:WeightedAverages Because theweightWi=l/a? associated witheachmeasurementinvolves the squareof thecorrespondinguncertaintyai'anymeasurementthatismuchlessprecisethantheotherscontributesverymuchlesstothefinalanswer(7.10).For example,ifonemeasurementisfourtimeslessprecisethantherest,itsweightis16 timeslessthantheotherweights,andformanypurposesthismeasurementcould simplybeignored. Becausetheweightedaverage xwaV'isa functionof theoriginalmeasuredvalues Xl'X2,..,XN,theuncertaintyinxwavcanbecalculatedusingerrorpropagation.As youcaneasilycheck (Problem7.8),theuncertaintyinxwavis 1 (7.12)aWay ~ I . W i Thisratheruglyresultisperhapsalittleeasiertorememberif werewrite(7.11)as (7.13) ParaphrasingEquation(7.13),wecansaythattheuncertaintyineachmeasurement isthereciprocalsquarerootofitsweight.ReturningtoEquation(7.12),wecan paraphraseitsimilarlytosaythattheuncertaintyinthegrandanswerXwavisthe reciprocalsquarerootofthesumof alltheindividualweights;inotherwords,the totalweightof thefinalansweristhesumof theindividualweightsWi' QuickCheck7.2.WhatistheuncertaintyinyourfinalanswerforQuick Check7.1? 7.3AnExample Hereisanexampleinvolving threeseparatemeasurementsof thesameresistance. Example:ThreeMeasurementsof a Resistance Eachofthreestudentsmeasuresthesameresistanceseveraltimes,andtheirthree finalanswersare(allinohms): Student1:R111 Student2:R121 Student3:R103 Giventhesethreeresults,whatisthebestestimatefortheresistance R? ThethreeuncertaintiesaI'a2,a3 are1,1,and3.Therefore,thecorresponding weightsWi= l/a? are 11,1, 9 PrincipalDefinitionsandEquationsof Chapter7I 77 ThebestestimateforRistheweightedaverage,whichaccordingto(7.10)is I.w.R--"-' I. Wi (1X11)+ (1X12)+ (X10) 11.42ohms. 1+ 1+ Theuncertaintyinthisanswerisgivenby(7.12)as 11 0.69. aWay=-JI. Wi=-J1+ 1+ Thus,our finalconclusion(properlyrounded)is R=11.40.7ohms. Forinterest,letusseewhatanswerwewouldgetif weweretoignorecompletely the thirdstudent's measurement, which isthreetimes less accurateandhence ninetimeslessimportant.Here,asimplecalculationgives Rbesl =11.50(compared with11.42)withanuncertaintyof 0.71(comparedwith0.69).Obviously,thethird measurementdoesnothaveabigeffect. PrincipalDefinitionsandEquationsof Chapter7 If XI' Xz,. . ., xN aremeasurementsof a singlequantity X,with knownuncertaintiesal'a2'... ,aN'thenthebestestimateforthetruevalueof Xistheweighted average I.WiXi Xwav=~ , ":'Wi [See(7.10)] wherethesumsareoverallNmeasurements,i=1, . .. , N,andtheweightsWi arethereciprocalsquaresof thecorresponding uncertainties, 1 W, = TheuncertaintyinXwavis 1 [See(7.12)] -JI.w/ where,again,thesumrunsoverallof themeasurementsi1,2, ... ,N. 178Chapter 7:WeightedAverages ProblemsforChapter7 For Section7.2:TheWeightedAverage 7.1.*Findthebestestimateanditsuncertaintybasedonthefollowingfourmeasurementsof acertainvoltage: 1.40.5,1.20.2,1.00.25,1.30.2. 7.2.*Threegroupsof particlephysicistsmeasurethemassofacertainelementaryparticlewiththeresults(inunitsof Me V Ic2): 1,967.01.0,1,9691.4,1,972.12.5. Findtheweightedaverageanditsuncertainty. 7.3.*(a)Twomeasurementsof thespeedof soundugivetheanswers3341 and3362(bothinm/s).Wouldyouconsiderthemconsistent?If so,calculate thebest estimate foru anditsuncertainty.(b)Repeat part (a)fortheresults3341 and3365.Isthesecondmeasurementworthincludinginthiscase? 7.4.**Fourmeasurementsaremadeofthewavelengthoflightemittedbya certainatom.Theresults,innanometers,are: 50310,4918,52520,57040. Findtheweightedaverageanditsuncertainty.Isthelastmeasurementworthincluding? 7.5.**Twostudentsmeasurearesistancebydifferentmethods.Eachmakes10 measurementsandcomputesthemeananditsstandarddeviation,andtheirfinal resultsareasfollows: Student A:R=728ohms StudentB:R=785ohms. (a)Includingbothmeasurements,whatarethebestestimateof Randitsuncertainty?(b)Approximatelyhowmanymeasurements(usinghissametechnique) wouldstudent Aneed tomaketo give hisresultthesameweight asB's? (Remember thateachstudent'sfinaluncertaintyistheSDOM,whichisequaltotheSDI-1N.) 7.6.**Twophysicistsmeasuretherateofdecayofalong-livedradioactive source.Physicist A monitorsthesample for4hoursandobserves 412 decays;physicist Bmonitorsitfor6hoursandobserves576decays.(a)Findtheuncertaintiesin thesetwocountsusingthesquare-rootrule(3.2).(Rememberthatthesquare-root rulegivestheuncertaintyintheactualcountednumber.)(b)Whatshouldeach physicistreport forthedecayrateindecaysperhour,withitsuncertainty?(c)What istheproper weightedaverageof thesetworates,withitsuncertainty? 7.7.**Supposethat Nseparatemeasurementsof aquantityxallhavethesame uncertainty.Showclearlythatinthissituationtheweightedaverage(7.10)reduces totheordinaryaverage,ormean,x=LxJN,andthattheuncertainty(7.12)reducestothefamiliarstandarddeviationof themean. 179ProblemsforChapter7 7.8.**Theweightedaverage(7.10)ofNseparatemeasurementsisasimple functionof Xl'X2,.. .,XN.Therefore,theuncertaintyinXwavcanbefoundbyerror propagation.ProveinthiswaythattheuncertaintyinXwavisasclaimedin(7.12). 7.9.***(a)If youhaveaccesstoaspreadsheetprogramsuchasLotus123or Excel,createa spreadsheettocalculatetheweightedaverageof threemeasurements Xiwithgivenuncertainties(Ti'Inthefirstcolumn,givethetrialnumberi,anduse columns2and3toenterthedataXiandtheuncertainties(T;.Incolumns4and5, putfunctionstocalculatetheweightsWiandtheproductsWiXi;atthebottomsof thesecolumns,youcancalculatethesumsLW;andLWiXiFinally,insomeconvenientposition,placefunctionstocalculate Xwavanditsuncertainty(7.12).Testyour spreadsheetusingthedataofSection7.3.(b)Trytomodifyyourspreadsheetso thatitcanhandleanynumberofmeasurementsuptosomemaximum(20say). (Themaindifficultyisthatyouwillprobablyneedtousesomelogicalfunctionsto makesurethatemptycellsincolumn3 don't get countedaszerosandcausetrouble withthefunctionthatcalculatesWi=l/(T?)Testyournewspreadsheetusingthe datainSection7.3andinProblem7.1. Chapter8 Least-SquaresFitting Ourdiscussionof thestatisticalanalysisofdatahassofarfocusedexclusivelyon therepeatedmeasurementof onesinglequantity,notbecausetheanalysisofmany measurementsof onequantityisthemostinterestingprobleminstatistics,butbecausethissimpleproblemmustbewellunderstoodbeforemoregeneralonescan bediscussed.Nowwearereadytodiscussourfirst,andveryimportant,more generalproblem. 8.1DataThatShouldFita StraightLine Oneof themostcommonandinteresting typesof experimentinvolvesthemeasurementofseveralvaluesof twodifferentphysicalvariablestoinvestigatethemathematicalrelationshipbetweenthetwovariables.Forinstance,anexperimentermight dropastonefromvariousdifferentheightshl' ... , hNandmeasurethecorrespondingtimesoffalltl,.. .,tNtoseeif theheightsandtimesareconnectedbythe expectedrelationh=!g? Probablythemostimportantexperimentsof thistypearethoseforwhichthe expectedrelationislinear.Forinstance,ifwebelievethatabodyisfallingwith constantacceleration g,thenitsvelocityvshouldbealinearfunctionof thetimet, v=Vo+ gt. Moregenerally,wewillconsider anytwophysicalvariables xand ythatwesuspect areconnectedbyalinearrelationof theform y=A+ Ex,(8.1) where AandB areconstants.Unfortunately,manydifferentnotationsareusedfora linearrelation;bewareofconfusingtheform(8.1)withtheequallypopular y=ax+ b. If thetwovariablesyandxarelinearlyrelatedasin(8.1),thenagraphof y against xshouldbea straight linethathasslope Bandintersectstheyaxisaty=A. If weweretomeasureNdifferentvaluesx I, ... ,xN andthecorrespondingvalues Yl'. .. , YNandif ourmeasurementsweresubjecttonouncertainties,theneachof thepoints(Xi'y) wouldlieexactlyontheline y=A+ Ex,asinFigure8.1(a).In181 182Chapter 8:Least-SquaresFitting yy __L-________+X----'---------x (a)(b) Figure8.1.(a)If thetwovariables yandxarelinearlyrelatedasinEquation(8.1),andif therewerenoexperimentaluncertainties,thenthemeasuredpoints(x;,y;)wouldalllieexactly ontheliney=A+ Bx.(b)Inpractice,therealwaysareuncertainties,whichcanbeshownby errorbars,andthepoints(Xi ' yJcanbeexpectedonlytoliereasonablyclosetotheline.Here, only yisshownassubjecttoappreciableuncertainties. practice,thereareuncertainties,andthemostwecanexpectisthatthedistanceof eachpoint(Xi'y;)fromthelinewillbereasonablecomparedwiththeuncertainties, asinFigure8.1(b). Whenwemakea seriesof measurementsof thekindjust described, wecanask twoquestions.First,if wetakeforgrantedthat Y and Xarelinearlyrelated,thenthe interesting problemistofindthestraightline Y =A+ Ex thatbestfitsthemeasurements,thatis,tofindthebestestimatesfortheconstants Aand Ebasedonthedata (xl>Yl)'... ,(XN'YN)'Thisproblemcanbeapproachedgraphically,asdiscussed brieflyinSection2.6.It canalsobetreatedanalytically,bymeansof theprinciple ofmaximumlikelihood.Thisanalyticalmethodof findingthebeststraightlineto fitaseriesof experimentalpointsiscalledlinearregression,ortheleast-squaresfit foraline,andisthemainsubjectof thischapter. Thesecondquestionthatcanbeaskediswhetherthemeasuredvalues(Xl'Yl)' . . . ,(XN'YN)doreallybearoutourexpectationthat Y islinearinx.Toanswerthis question,wewould firstfindthelinethatbestfitsthedata,butwemustthendevise somemeasureof howwellthislinefitsthedata.If wealreadyknowtheuncertaintiesinourmeasurements,wecandrawagraph,likethatinFigure8.1(b),that showsthebest-fitstraightlineandtheexperimentaldatawiththeirerrorbars.We canthenjudgevisuallywhetherornotthebest-fitlinepassessufficientlycloseto alloftheerrorbars.If wedonotknowtheuncertaintiesreliably,wemustjudge howwellthepointsfitastraightlinebyexaminingthedistributionofthepoints themselves.WetakeupthisquestioninChapter9. 8.2Calculationof theConstantsA andB Letusnowreturntothequestionof findingthebeststraightline Y=A+ Exto fitasetofmeasuredpoints(Xl'Yl), . . . ,(XN'YN)'Tosimplifyourdiscussion,we willsupposethat,althoughourmeasurementsof Ysufferappreciableuncertainty, theuncertaintyinourmeasurementsof Xisnegligible.Thisassumptionisoften reasonable,becausetheuncertaintiesinonevariableoftenaremuchlargerthan Section8.2Calculationof theConstants A andBI 83 thoseintheother,whichwecanthereforesafelyignore.Wewillfurtherassume thattheuncertaintiesinYallhavethesamemagnitude.(Thisassumptionisalso reasonableinmanyexperiments,butif theuncertaintiesaredifferent,thenour analysiscanbe generalizedtoweight themeasurements appropriately;seeProblem8.9.) Morespecifically,weassumethatthemeasurementofeachYiisgovernedbythe Gaussdistribution,withthesamewidthparameteray forallmeasurements. IfweknewtheconstantsAandB,then,foranygivenvalueXi(whichweare assuminghasnouncertainty),wecouldcomputethetruevalueof thecorresponding Y; , (truevaluefor yJ=A+ Bx; .(8.2) Themeasurementof y;isgovernedbyanormaldistributioncenteredonthistrue value,withwidthparameteray. Therefore,theprobabilityof obtaining theobserved value Yiis Prob(y.)oc~ e-(y;-A-Bx;)2/2ui (8.3)Afl,, ay wherethesubscripts A and Bindicatethatthisprobabilitydependsonthe(unknown) valuesof AandB.Theprobabilityof obtainingourcompletesetof measurements Y1'... , YNistheproduct (8.4) wheretheexponentisgivenby x 2 =~(y,- A- BX,)2 (8.S)L.Ja2 ; =1y Inthe now-familiar way,we willassumethatthebest estimates forthe unknown constants AandB,basedonthegivenmeasurements,arethosevaluesof AandB forwhichtheprobability ProbA iYl' .. . 'YN)ismaximum,or forwhichthesumof squaresX2 in(8.S)isam i n ~ u m .(Thisiswhythemethodisknownasleastsquaresfitting.)Tofindthesevalues,wedifferentiateX2 withrespecttoAandB andsetthederivativesequaltozero: o(8.6) and ax2-2N - =-2 L Xi (y;- A- Bx;)=O.(8.7) aBa yi =1 Thesetwoequationscanberewrittenassimultaneousequationsfor AandB: AN + BIx;=Iy;(8.8) and AIxi + BIx?(8.9) 184Chapter 8:Least-SquaresFitting Here,Ihaveomittedthelimitsi= 1toNfromthesummationsignsI.Inthe followingdiscussion,Ialsoomitthesubscriptsi whenthereisnoseriousdangerof confusion;thus,IXiYiisabbreviatedtoIxy andsoon. Thetwoequations(8.8)and(8.9),sometimescallednormalequations,areeasilysolvedfortheleast-squaresestimatesfortheconstants Aand B, Ix2Iy - IxIxyA !1 (8.10) and NIxy- LxLYB= (8.11)!1 whereIhaveintroducedtheconvenientabbreviationforthedenominator, !1=NIx2- (Ix?(8.12) Theresults(8.10)and(8.11)givethebestestimatesfortheconstants AandB ofthestraightlineY=A+ Bx,basedontheNmeasuredpoints(XI' YI)'. .. , (xN' YN)'Theresultinglineiscalledtheleast-squaresfittothedata,orthelineof regressionof Yonx. Example:LengthversusMassfora SpringBalance Astudentmakesascaletomeasuremasseswithaspring.Sheattachesitstopend toarigidsupport,hangsapanfromitsbottom,andplacesameterstickbehindthe arrangementtoreadthelengthof thespring.Beforeshecanusethescale,shemust calibrateit;thatis,shemustfindtherelationshipbetweenthemassinthepanand thelengthof thespring.Todothiscalibration,shegetsfiveaccurate2-kgmasses, whichsheaddstothepanonebyone,recordingthecorrespondinglengthslias showninthefirstthreecolumnsof Table8.1.AssumingthespringobeysHooke's law,sheanticipatesthatlshouldbealinearfunctionof m, I=A+ Bm .(8.13) (Here,theconstant Aistheunloadedlengthof thespring,andBisg/k,wherekis theusualspringconstant.)Thecalibrationequation(8.13)willletherfindany unknownmassmfromthecorrespondinglengthl , oncesheknowstheconstants A andB.Tofindtheseconstants,sheusesthemethodof leastsquares.Whatareher answersforAandB?Plothercalibrationdataandthelinegivenbyherbestfit (8.13).If sheputsanunknownmassminthepanandobservesthespring'slength tobel=53.2em,whatism? 185Section8.2Calculationof theConstants A andB Table8.1.Massesmi (inkg)andlengthsIi(incm)fora springbalance. The"x"and"y"inquotesindicatewhichvariablesplaytherolesof xand yinthisexample. Trialnumber"x""y" Load,m;Length,I;mI 2 mil; 1242.0484 2448.416194 3651.336308 4856.364450 51058.6100586 N=5Im; =30II; =256.6Im/ =220Im;f;=1,622 Asoftenhappensinsuchproblems,thetwovariablesarenotcalledxandy, andonemustbecarefultoidentifywhichiswhich.Comparing(8.13)withthe standardform,y=A+ Bx,weseethatthelengthI playstheroleof thedependent variabley,whilethemassmplaystheroleoftheindependentvariablex.The constants AandBaregivenby(8.10)through(8.12),withthereplacements and (Thiscorrespondenceisindicatedbytheheadings "x"and "y"inTable8.1.)Tofind A and B,weneedtofindthesumsI,mi, I,li, I,m/,andI,mi(;therefore,thelasttwo columnsof Table8.1showthequantitiesm/ andmJi'andthecorrespondingsum isshownatthebottomof eachcolumn. Computingtheconstants AandBisnowstraightforward.Accordingto(8.12), thedenominatora is aNI,m2- (I,m? 5x 220- 302 =200. Next,from(8.10)wefindtheintercept(theunstretchedlength) I,m2I,l- I,mI,ml A=a 220x256.6- 30X1622 39.0cm. 200 Finally,from(8.11)wefindtheslope B=NI,ml- I,mI,1 a 5x1622- 30x256.6 200 2.06cm/kg. 186Chapter8:Least-SquaresFitting 60 E50 ~ ..c: '5'0 c: OJ ....l 40 0246810 Mass (kg)-+ Figure 8.2.A plotof thedatafromTable8.1andthebest-fitline(8.13). A plot of thedataandtheline(8.13)usingthesevaluesof A andB isshownin Figure8.2. If themassmstretchesthespringto53.2cm,thenaccordingto(8.13) themassis I- A(53.2- 39.0)cm m6.9kg. B2.06cm/kg QuickCheck8.1 .Findtheleast-squaresbest-fitlineY = A+Exthroughthe threepoints(x,y)= (-1, 0),(0,6),and(1,6).Usingsquaredpaper,plotthe pointsandyour line.[Notethat becausethethreevaluesof x (-1, 0,and1)are symmetricaboutzero,LX =0,whichsimplifiesthecalculationof AandB.In someexperiments,thevaluesof xcanbearrangedtobesymmetricallyspaced inthisway,whichsavessometrouble.] NowthatweknowhowtofindthebestestimatesfortheconstantsAandB, wenaturallyaskfortheuncertaintiesintheseestimates.Beforewecanfindthese uncertainties,however,wemustdiscusstheuncertaintya), intheoriginalmeasurementsof YI'Y2,. .. , YN' 8.3UncertaintyintheMeasurementsof y Inthecourse of measuringthevalues Yl' ... , YN,we havepresumablyformedsome ideaof theiruncertainty.Nonetheless,knowinghowtocalculatetheuncertaintyby analyzingthedatathemselvesisimportant.RememberthatthenumbersYI'... , YN arenotNmeasurementsofthesamequantity.(Theymight,forinstance,bethe timesforastonetofallfromNdifferentheights.)Thus,wecertainlydonotgetan ideaof theirreliabilitybyexaminingthespreadintheirvalues. Nevertheless,wecaneasilyestimatetheuncertaintyay inthenumbersYl' . .. , YN'Themeasurement of eachY;is(weareassuming)normallydistributedaboutits truevalue A+ Bx;,withwidthparametera,v'Thusthedeviations Y;- A- Bx;are 187Section8.3UncertaintyintheMeasurementsof y normallydistributed,allwiththesamecentralvaluezeroandthesamewidthuyThissituationimmediatelysuggeststhatagoodestimateforuy wouldbegivenby asumof squareswiththefamiliarform uy=~ ~ L ( Y i- ABXif (8.14) Infact,thisanswercanbeconfirmedbymeansoftheprincipleof maximumlikelihood.Asusual,thebestestimatefortheparameterinquestion(uy here)isthat valueforwhichtheprobability(8.4)of obtainingtheobservedvalues Yr,. . . , YNis maximum.Asyoucaneasilycheckbydifferentiating(8.4)withrespecttouy and settingthederivativeequaltozero,thisbestestimateispreciselytheanswer(8.14). (SeeProblem8.12.) Unfortunately,asyoumayhavesuspected,theestimate(8.14)foruy isnot quitetheendofthestory.ThenumbersAandBin(8.14)aretheunknowntrue valuesof theconstants Aand B.Inpractice,thesenumbersmust bereplacedbyour bestestimatesfor AandB,namely,(8.10)and(8.11),andthisreplacementslightly reducesthevalueof (8.14).It canbeshownthatthisreductioniscompensatedfor ifwereplacethefactorNinthedenominatorby(N- 2).Thus,ourfinalanswer fortheuncertaintyinthemeasurements Yr'. .. , YNis (8.15) with Aand Bgivenby (8.10)and(8.11).If wealreadyhaveanindependent estimate of ouruncertaintyin Yr,. .. , YN'wewouldexpectthisestimatetocomparewithuy ascomputedfrom(8.15). Iwillnotattempttojustifythefactorof (N - 2)in(8.15)butcanmakesome comments.First,aslongasNismoderatelylarge,thedifferencebetweenNand (N- 2)isunimportantanyway.Second,thatthefactor(N- 2)isreasonablebecomesclearifweconsidermeasuringjusttwopairsofdata(Xl'Yl)and(X2'Yz). Withonlytwopoints,wecanalwaysfindalinethatpassesexactlythroughboth points,andtheleast-squaresfitwillgivethisline.Thatis,withjusttwopairsof data,wecannot possiblydeduceanythingaboutthereliabilityof our measurements. Now,sincebothpointslieexactlyonthebestline,thetwotermsofthesumin (8.14)and(8.15)arezero.Thus,theformula(8.14)(with N=2inthedenominator) wouldgivetheabsurdansweruy =0;whereas(8.15),withN- 2=0inthedenominator,givesuy =0/0,indicatingcorrectlythatuy isundeterminedafteronly twomeasurements. Thepresenceof thefactor(N- 2)in(8.15)isreminiscentof the(N- 1)that appearedinour estimateof thestandarddeviationof Nmeasurementsof onequantityX,inEquation(5.45).There,wemadeNmeasurementsXl'... ,XN oftheone quantityx.BeforewecouldcalculateU X'wehadtouseourdatatofindthemean x.Inacertainsense,thiscomputationleftonly(N- 1)independentmeasuredvalues,sowesaythat,havingcomputedX,wehaveonly(N- 1)degreesof freedom left.Here,wemade Nmeasurements,butbeforecalculatinguy wehadtocompute thetwoquantitiesAandB.Havingdonethis,wehadonly(N- 2)degreesof I 88Chapter 8:Least-SquaresFitting freedomleft.Ingeneral,wedefinethenumberof degreesof freedomatanystage inastatisticalcalculationasthenumberofindependentmeasurementsminusthe numberof parameterscalculatedfromthesemeasurements.Wecanshow(butwill notdosohere)thatthenumberof degreesof freedom,notthenumberof measurements,iswhatshouldappearinthedenominatorofformulassuchas(8.1S)and (S.4S).Thisfactexplainswhy(8.1S)containsthefactor(N- 2)and(S.4S)the factor(N- 1). 8.4UncertaintyintheConstantsA andB Having foundtheuncertaintyO'yinthemeasurednumbers Y[,... , YN'wecaneasily returntoourestimatesfortheconstantsAandBandcalculatetheiruncertainties. Thepointisthattheestimates(8.10)and(8.11)for AandBarewell-definedfunctionsof themeasurednumbers Y[,... , YN'Therefore,theuncertaintiesin AandB aregivenbysimpleerrorpropagationintermsof thoseinYl,. . . , YN'Ileaveitas anexerciseforyoutocheck(Problem8.16)that (8.16) and (8.17) where.:lisgivenby(8.12)asusual. The resultsof thisandtheprevioustwosectionswerebasedontheassumptions thatthemeasurementsof Ywereallequallyuncertainandthatanyuncertaintiesin xwerenegligible. Although theseassumptions oftenare justified,weneedtodiscuss brieflywhathappenswhentheyarenot.First,if theuncertaintiesinyarenotall equal,wecanusethemethodofweightedleastsquares,asdescribedinProblem 8.9.Second,if thereareuncertaintiesinxbutnotiny,wecansimplyinterchange therolesof xandyinouranalysis.Theremainingcaseisthatinwhichbothx and Yhaveuncertainties-acasethatcertainlycanoccur.Theleast-squaresfittingofa generalcurvewhenbothxandYhaveuncertaintiesisrathercomplicatedandeven controversial.Intheimportantspecialcaseof astraightline(whichisallwehave discussedsofar),uncertaintiesinbothxandYmakesurprisinglylittledifference, aswenowdiscuss. Suppose,first,thatourmeasurementsof xaresubjecttouncertaintybutthose of yare not,andweconsideraparticularmeasuredpoint(x,y).Thispointandthe truelineY =A+ BxareshowninFigure8.3.Thepoint(x,y)doesnotlieonthe linebecauseoftheerror-callit.:lx-inourmeasurementof x.Now,wecansee 189Section8.4UncertaintyintheConstantsA andB y \ '(x,y) error L'lx inx equivalent error iny L'ly(equiv) = L'lx

Figure 8.3.Ameasuredpoint(x,y)andtheliney=A+ Exonwhichthepointissupposed tolie.Theerror inx,withyexact,producesthesameeffectasanerror =iny,withxexact.(Here,dy/dxdenotestheslopeof theexpectedline.) easilyfromthepicturethattheerrorAxinx,withnoerroriny,producesexactly thesameeffectasif therehadbeennoerrorinxbutanerrorinygivenby Ay(equiv)=:Ax(8.18) (where"equiv"standsfor"equivalent").Thestandarddeviationax isjusttherootmean-squarevalueof Axthatwouldresultfromrepeatingthismeasurementmany times.Thus,accordingto(8.18),theproblemwithuncertaintiesaxinxcanbe replacedwithanequivalentproblem withuncertaintiesiny,givenby .)dy(ay eqUlv=dxax (8.19) Theresult(8.19)istruewhateverthecurveof yvsx,but(8.19)isespecially simpleif thecurveisastraightline,becausetheslopedy/dxisjusttheconstantB. Therefore,forastraightline (8.20) Inparticular,if alltheuncertaintiesaxareequal,thesameistrueof theequivalent uncertaintiesay(equiv).Therefore,theproblemof fittinga linetopoints(x;,y;)with equaluncertaintiesinxbutnouncertaintiesinyisequivalenttotheproblemof equaluncertaintiesinybutnoneinx.Thisequivalencemeanswecansafelyuse themethodalreadydescribedforeitherproblem.[Inpractice,thepointsdonotlie exactlyontheline,andthetwo"equivalent"problemswillnotgiveexactlythe sameline.Nevertheless,thetwolinesshouldusuallyagreewithintheuncertainties givenby(8.16)and(8.17).SeeProblem8.17.] Wecannowextendthisargumenttothecasethatbothxandyhaveuncertainties.Theuncertaintyinxisequivalenttoanuncertaintyin yasgivenby(8.20).In addition,yisalreadysubjecttoitsownuncertaintyay- Thesetwouncertaintiesare 190Chapter 8:Least-SquaresFitting independentandmustbecombinedinquadrature.Thus,theoriginalproblem,with uncertaintiesinbothxandy,canbereplacedwithanequivalentprobleminwhich only yhasuncertainty,givenby (8.21) Providedalltheuncertaintiesaxarethesame,andlikewisealltheuncertaintiesay' theequivalent uncertainties (S.21)areallthesame,and we cansafelyuse theformulas(S.lO)through(S.17). If theuncertaintiesinx(oriny)arenotallthesame,wecanstilluse(S.21), buttheresultinguncertaintieswillnotallbethesame,andwewillneedtousethe methodof weightedleastsquares.If thecurvetowhichwearefittingourpointsis notastraightline,afurthercomplicationarisesbecausetheslopedy/dxisnota constantandwecannotreplace(S.19)with(S.20).Nevertheless,wecanstilluse (8.21)(withdy/dxinplaceof B)toreplacetheoriginalproblem(withuncertainties inboth xand y)byanequivalentproblem inwhichonly yhasuncertaintiesasgiven by(S.21V 8.5AnExample Hereisasimpleexampleof least-squaresfittingtoastraightline;itinvolvesthe constant-volumegasthermometer. Example:Measurementof AbsoluteZerowithaConstant-VolumeGas Thermometer If thevolumeofasampleof anidealgasiskeptconstant,itstemperatureTisa linearfunctionof itspressure P, T=A+ BP.(S.22) Here,theconstant Aisthetemperatureatwhichthepressure Pwoulddroptozero (if thegasdidnotcondenseintoaliquidfirst);itiscalledtheabsoLutezeroof temperature,andhastheacceptedvalue A=- 273.1SoC TheconstantBdependsonthenatureofthegas,itsmass,anditsvolume.2 By measuringaseriesofvaluesforTandP,wecanfindthebestestimatesforthe constants AandB.Inparticular,thevalueof Agivestheabsolutezeroof temperature. Onesetof fivemeasurementsof PandT obtainedbyastudentwasasshown inthefirstthreecolumnsof TableS.2.Thestudent judgedthathismeasurementsof I This procedureisquitecomplicatedinpractice.Before wecanuse(8.21)tofindtheuncertaintylTiequiv), weneedtoknowtheslopeB(or,moregenerally,dy/dx),whichisnotknownuntilwehavesolvedthe problem!Nevertheless,wecangetareasonablefirstapproximationfortheslopeusingthemethodofunweightedleastsquares,ignoringallof thecomplicationsdiscussedhere.Thismethodgivesanapproximate valuefortheslope B,whichcanthenbeusedin(8.21)togiveareasonableapproximationforlTy(equiv). 2ThedifferenceT- Aiscalledtheabsolutetemperature.Thus(8.22)canberewrittentosaythatthe absolutetemperatureisproportionaltothepressure(atconstantvolume). 191Section8.5AnExample Table8.2.Pressure(inmmof mercury)andtemperature CC)of a gasatconstant volume. "x""y" TrialnumberPressureTemperature PiTiA+ BPi 165-20-22.2 2751714.9 3854252.0 4959489.1 5105127126.2 Phadnegligibleuncertainty,andthoseofTwereallequallyuncertainwithan uncertaintyof "a fewdegrees." Assuminghispointsshouldfitastraightlineof the form(8.22),hecalculatedhisbestestimatefortheconstant A(theabsolutezero) anditsuncertainty.Whatshouldhavebeenhisconclusions? Allwehavetodohereisuseformulas(8.10)and(8.16),withXireplacedby Pi andYibyTi,tocalculateallthequantitiesof interest.Thisrequiresustocompute thesumsIP,IP2,IT, 2.PT.Manypocketcalculatorscanevaluateallthesesums automatically,but evenwithoutsuchamachine,wecaneasilyhandlethesecalculationsif thedataareproperlyorganized.FromTable8.2,wecancalculate IP425, Ip2 37,125, IT260, IPT25,810, Il NIP2- (IP)2 =5,000. Inthiskindof calculation,itisimportanttokeepplentyof significantfiguresbecausewehavetotakedifferencesof theselargenumbers.Armedwiththesesums, wecanimmediatelycalculatethebestestimatesfortheconstants AandB: A=Ip2IT ~IP IPT=- 263.35 and =NIPT - IPIT=371B Il-.. Thiscalculationalreadygivesthestudent ' sbestestimateforabsolutezero, A=- 263C. Knowingtheconstants AandB,wecannextcalculatethenumbersA+ BPi' thetemperatures"expected"onthebasisof ourbestfittotherelationT =A+ BP. Thesenumbersareshowninthefarrightcolumnofthetable,andaswewould hope,allagreereasonablywellwiththeobservedtemperatures.Wecannowtake thedifferencebetweenthefiguresinthelasttwocolumnsandcalculate UT=~ N ~2I(Ti- A- BPY=6.7. 192Chapter 8:Least-SquaresFitting 100 __ 2040100 P (mm of mercury)p- - 100 -200 -300 Figure8.4.Graphof T vspressurePforagasatconstantvolume.Theerrorbars extendonestandarddeviation,uT ,oneachsideof thefiveexperimentalpoints,andthelineis theleast-squaresbestfit.Theabsolutezeroof temperaturewasfoundbyextrapolatingtheline backtoitsintersectionwiththeTaxis. Thisresultagreesreasonablywiththestudent'sestimatethathistemperaturemeasurementswereuncertainby"a fewdegrees." Finally,wecancalculatetheuncertaintyin Ausing(8.16): O"A=O"T,I"Lp2/1l=18. Thus,ourstudent'sfinalconclusion,suitablyrounded,shouldbe absolutezero, A=- 260200 e, whichagreessatisfactorilywiththeacceptedvalue,- 273C. Asisoftentrue,theseresultsbecomemuchclearerif wegraphthem,asin Figure8.4.Thefivedatapoints,withtheiruncertaintiesof7inT,areshown ontheupperright.Thebeststraightlinepassesthroughfouroftheerrorbarsand closetothefifth. Tofindavalueforabsolutezero,thelinewasextendedbeyondallthedata pointstoitsintersectionwiththeTaxis.Thisprocessof extrapolation(extendinga curvebeyondthedatapointsthatdetermineit)canintroducelargeuncertainties,as isclearfromthepicture.Averysmallchangeintheline'sslopewillcausealarge changeinitsinterceptonthedistantTaxis.Thus,anyuncertaintyinthedatais greatlymagnifiedif wehavetoextrapolate anydistance.Thismagnificationexplains whytheuncertaintyinthevalueofabsolutezero( 18)issomuchlargerthan thatintheoriginaltemperaturemeasurements(7). 193Section8.6Least-SquaresFitsto Other Curves 8.6Least-SquaresFitstoOtherCurves So farinthischapter, wehave consideredtheobservationof twovariables satisfying a linear relation, Y=A+ Bx,andwehavediscussedthecalculation of theconstants AandB.Thisimportantproblemisaspecialcaseofawideclassof curve-fitting problems,manyof whichcanbesolvedinasimilarway.Inthissection,Imention brieflyafewmoreof theseproblems. FITTINGAPOLYNOMIAL Often,one variable,y,isexpectedtobe expressibleasa polynomialina second variable,x, Y=A+ Bx+ Cx2 + ... + Hxn.(8.23) For example,theheight Yof afallingbodyisexpectedtobequadraticinthetimet, Y=Yo+ vot- !gF, whereYoandVoaretheinitialheightandvelocity,andgistheaccelerationof gravity.Givenaset of observationsof thetwovariables,wecanfindbestestimates fortheconstants A, B,. . . , Hin(8.23)byanargumentthatexactlyparallelsthatof Section8.2,asInowoutline. Tosimplifymatters,wesupposethatthepolynomial(8.23)isactuallyaquadratic, Y=A+ Bx+ cx2.(8.24) (Youcaneasilyextendtheanalysistothegeneralcaseif youwish.)Wesuppose, asbefore,thatwehaveaseriesof measurements(Xi'Yi)'i=1,. .. , N,withtheYi allequallyuncertainandtheXiallexact.ForeachXi'thecorrespondingtruevalue of Yiisgivenby(8.24),withA,B,andCasyetunknown.Weassumethatthe measurementsof the Yiaregovernedbynormaldistributions,eachcenteredonthe appropriatetruevalueandallwiththesamewidthuy Thisassumptionletsus computetheprobabilityof obtainingourobservedvalues Yl'. .. , YNinthefamiliar form (8.25) wherenow (8.26) [Thisequation correspondstoEquation(8.5)forthelinearcase.]The bestestimates forA,B,andCarethosevaluesforwhichProb(Yl' ... , YN)islargest,orX2 is smallest.DifferentiatingX2withrespectto A, B,andCandsettingthesederivatives equaltozero,weobtainthethreeequations(asyoushouldcheck;seeProblem 8.21): AN + BIx + CIX2Iy, AIx + BIx2 + CIx3 Ixy,(8.27) 194Chapter 8:Least-SquaresFitting Foranygivensetofmeasurements(xi'y),thesesimultaneousequationsforA,B, andC(knownasthenormal equations)can besolvedtofindthebestestimatesfor A,B,andC.WithA,B,andCcalculatedinthisway,theequation y=A+ Bx+ c:x2iscalledtheleast-squarespolynomialfit,orthepolynomial regression,forthegivenmeasurements.(Foranexample,seeProblem8.22.) Themethodof polynomialregressiongeneralizeseasilytoapolynomialof any degree,althoughtheresultingnormalequationsbecomecumbersomeforpolynomialsofhighdegree.Inprinciple,asimilarmethodcanbeappliedtoanyfunction y=f(x)thatdependsonvariousunknownparameters A, B,.... Unfortunately, theresultingnormalequationsthatdeterminethebestestimatesfor A, B,.. . can be difficult or impossibletosolve.However,one largeclassof problems canalways besolved,namely,thoseproblemsinwhichthefunctiony=f(x)dependslinearly ontheparameters A, B,.... Theseincludeallpolynomials(obviouslythepolynomial(8.23)islinearinitscoefficients A, B,...)buttheyalsoincludemanyother functions.For example, in someproblems yis expectedtobea sumof trigonometric functions,suchas y=A sin x+ B cos x.(8.28) Forthisfunction,andinfactforanyfunctionthatislinearintheparametersA, B,... , thenormal equations that determinethebest estimates for A, B,... aresimultaneouslinearequations,whichcanalwaysbesolved(seeProblems8.23and 8.24). EXPONENTIALFUNCTIONS Oneof themostimportantfunctionsinphysicsistheexponentialfunction (8.29) whereAandBareconstants.TheintensityIof radiation,afterpassingadistancex throughashield,fallsoff exponentially: where10istheoriginalintensityandJ..Lcharacterizestheabsorptionbytheshield. Thechargeonashort-circuitedcapacitordrainsawayexponentially: Q=Qoe-At whereQoistheoriginalchargeandA =1/(RC),whereRand Caretheresistance andcapacitance. If theconstants AandBin(8.29)areunknown,wenaturallyseekestimatesof thembasedonmeasurementsof xandy.Unfortunately,directapplicationofour previousargumentsleadstoequationsforAandBthatcannotbeconveniently solved.Wecan,however,transformthenonlinearrelation(8.29)betweenyandx intoalinearrelation,towhichwecanapplyourleast-squaresfit. Toeffectthedesired"linearization,"wesimplytakethenaturallogarithmof (8.29)togive lny=InA+ Bx.(8.30) 195Section8.6Least-SquaresFitstoOther Curves Weseethat,even though y isnot linear in x,In yis.This conversion of thenonlinear (8.29)intothelinear(8.30)isusefulinmanycontextsbesidesthatof least-squares fitting.If wewanttochecktherelation(8.29)graphically,thenadirectplotof y against xwillproduceacurvethatishardtoidentifyvisually.Ontheotherhand,a plotof In yagainstx(oroflogyagainstx)shouldproduceastraightline,which canbeidentifiedeasily.(Suchaplotisespeciallyeasyif youuse"semilog"graph paper,onwhichthegraduationsononeaxisarespacedlogarithmically.Suchpaper letsyouplotlog ydirectlywithoutevencalculatingit.) Theusefulnessofthelinearequation(8.30)inleast-squaresfittingisreadily apparent.If webelievethatyandxshouldsatisfyy=AI3x ,thenthevariables Z=lnyandxshouldsatisfy(8.30),or z=InA+ Bx.(8.31) If wehaveaseriesof measurements(x;,y), thenforeach YiwecancalculateZi= lny;.Thenthepairs(x;,z;)shouldlieontheline(8.31).Thislinecanbefittedby themethodof leastsquarestogive best estimates fortheconstants InA (from which wecanfindA) and B. Example:APopulationof Bacteria Manypopulations(ofpeople,bacteria,radioactivenuclei,etc.)tendtovary exponentiallyovertime.If apopulation Nisdecreasingexponentially,we write (8.32) where7iscalledthepopulation'smeanlife[closelyrelatedtothehalf-life,t1/2;in fact,t1/2=(In2) 7].A biologistsuspectsthat apopulationof bacteria isdecreasing exponentiallyasin(8.32)andmeasuresthepopulationonthreesuccessivedays;he obtainstheresultsshowninthefirsttwocolumnsof Table8.3.Giventhesedata, whatishisbestestimateforthemeanlife7? Table S.3.Populationof bacteria. Timet;(days)Population N;Z;=InN; o 1 2 153,000 137,000 128,000 11.94 11.83 11.76 If Nvariesasin(8.32),thenthevariable z =inN shouldbelinearint: t z=InN=In No- -.(8.33) 7 OurbiologistthereforecalculatesthethreenumbersZi=InN; (i0,1,2)shown inthethirdcolumnof Table8.3.Usingthesenumbers,hemakesaleast-squaresfit tothestraightline(8.33)andfindsasbestestimatesforthecoefficientsInNoand ( - 1/7), In No11.93and(-1/7)=-0.089 day-I. 196Chapter 8:Least-SquaresFitting I Thesecondof thesecoefficientsimpliesthathisbestestimateforthemeanlifeis L7=11.2days. Themethodjustdescribedisattractivelysimple(especiallywithacalculator thatperformslinearregressionautomatically)andisfrequentlyused.Nevertheless, themethodisnotquitelogicallysound.Ourderivationof theleast-squaresfittoa straightlineY= A+ Bxwasbasedontheassumptionthatthemeasuredvalues Yl'... , YNwereallequallyuncertain.Here,weareperformingourleast-squaresfit usingthevariablez=Iny.Now,if themeasuredvalues Yiareallequallyuncertain, thenthevaluesZi=InYiarenot.Infact,fromsimpleerrorpropagationweknow that (8.34) Thus,if CTy isthesameforallmeasurements,thenCTz varies(withCTz largerwhen Y issmaller).Evidently,thevariable Z= In Y doesnot satisfytherequirementof equal uncertaintiesforallmeasurements,if Y itself does. Theremedyforthisdifficultyisstraightforward.Theleast-squaresprocedure canbemodifiedtoallowfordifferentuncertaintiesinthemeasurements,provided thevariousuncertaintiesareknown.(Thismethodof weightedleastsquaresisoutlinedinProblem8.9).If weknowthatthemeasurementsof Y1'.. . , YNreallyare equallyuncertain,thenEquation(8.34)tellsushowtheuncertaintiesinZl' . .. ,ZN vary,andwecanthereforeapplythemethodof weightedleastsquarestotheequationz= InA+ Bx. Inpractice,weoftencannotbesurethattheuncertaintiesinYI,.. . , YNreally areconstant;sowecanperhapsarguethatwecould justaswellassumetheuncertaintiesinz[,... ,ZNtobeconstantandusethesimpleunweightedleastsquares. Oftenthevariationintheuncertaintiesissmall,andwhichmethodisusedmakes littledifference,asintheprecedingexample.Inanyevent,whentheuncertainties areunknown,straightforwardapplicationof theordinary(unweighted)least-squares fitisanunambiguousandsimplewaytogetreasonable(if notbest)estimatesfor theconstantsAandBintheequationY=A ~ x ,soitisfrequentlyusedinthis way. MULTIPLEREGRESSION Finally,wehavesofardiscussedonlyobservationsof twovariables,xandy, andtheirrelationship.Manyrealproblems,however,havemorethantwovariables tobeconsidered.Forexample,instudyingthepressurePof agas,wefindthatit dependsonthevolumeVandtemperatureT,andwemustanalyzePasafunction ofVandT.Thesimplestexampleof suchaproblemiswhenonevariable,z,dependslinearlyontwoothers,xandy: Z=A+ Bx+ Cy.(8.35) 197PrincipalDefinitionsandEquationsof Chapter8 Thisproblemcanbeanalyzedbyaverystraightforwardgeneralizationof ourtwovariablemethod.If wehaveaseriesof measurements(Xi'Yi'z), i= 1,... , N(with theZiallequallyuncertain,andtheXiandYiexact),thenwecanusetheprinciple of maximum likelihoodexactlyasinSection8.2toshowthatthebestestimatesfor theconstants A, B,ande aredeterminedbynormalequationsof theform AN +BIx +eIyIz, A Ix + BIx2 + eIxyIxz,(8.36) AIy + BIxy + eIiIyz. TheequationscanbesolvedforA,B,ande togivethebestfitfortherelation (8.35).Thismethodiscalledmultiple regression("multiple"becausetherearemore thantwovariables),butwewillnotdiscussitfurtherhere. PrincipalDefinitionsandEquationsof Chapter8 Throughoutthischapter,wehaveconsidered Npairsof measurements(x]' y]), . .. , (XN'YN)of twovariables xand y.Theproblemaddressedwasfindingthebestvalues of theparametersof thecurvethatagraphof yvsxisexpectedtofit.Weassume thatonlythemeasurementsof ysufferedappreciableuncertainties,whereasthose for xwere negligible.[For thecaseinwhichboth xand yhavesignificantuncertainties,seethediscussionfollowingEquation(8.17).]Variouspossiblecurvescanbe analyzed,andtherearetwodifferentassumptionsabouttheuncertaintiesiny.Some of themoreimportantcasesareasfollows: ASTRAIGHTLINE,Y =A +Bx;EQUALWEIGHTS If Yisexpectedtolieonastraightliney= A+ Bx,andif themeasurements of yallhavethesameuncertainties,thenthebestestimatesfortheconstants Aand Bare: A and NIxy- Ix I,yB ~ wherethedenominator,~ ,is [See(8.10)to(8.12)] Basedontheobservedpoints,thebestestimatefortheuncertaintyinthemeasurementsof yis [See(8.15)] 198Chapter8:Least-SquaresFitting Theuncertaintiesin AandBare: and [See(8.16)&(8.17)] STRAIGHTLINETHROUGHTHEORIGIN(y=Bx); EQUALWEIGHTS If Yisexpectedtolieonastraightlinethroughtheorigin,y=Bx,andifthe measurementsof yallhavethesameuncertainties,thenthebestestimateforthe constant Bis: LXY B=LX2 [SeeProblem8.5] Basedonthemeasuredpoints,thebestestimatefortheuncertaintyinthemeasurementsof yis: andtheuncertaintyinBis: [SeeProblem8.18] WEIGHTEDFITFORASTRAIGHTLINE,y=A +Bx If yisexpectedtolieona straightline y=A+ Bx,andif themeasuredvalues Yihavedifferent,knownuncertaintiesai'thenweintroducetheweightsWi=1!a?, andthebestestimatesfortheconstants Aand Bare: A=LWx2LWY - LWXLWXY tl and LW LWXY- Iwx IwyB tl where [SeeProblem8.9] TheuncertaintiesinAandBare: 199ProblemsforChapter 8 and O"B [SeeProblem8.19] OTHERCURVES If yisexpectedtobeapolynomialinx,thatis, y=A+Bx+... +Hxfl , thenanexactlyanalogousmethodof least-squaresfittingcanbeused,althoughthe equationsarequitecumbersomeif nislarge.(Forexamples,seeProblems8.21and 8.22.)Curvesof theform y=Af(x)+Bg(x)+... +Hk(x) , wheref(x),... ,k(x)areknownfunctions,canalsobehandledinthesameway. (Forexamples,seeProblems8.23and8.24.) If yisexpectedtobegivenbytheexponentialfunction y=A ~ x , thenwecan"linearize"theproblembyusingthevariablez=In(y),whichshould satisfythelinearrelation z=In(y)=In(A)+ Bx.[See(8.31)] Wecanthenapplythelinear least-squaresfittozasa functionof x.Note,however, thatif theuncertaintiesinthemeasuredvaluesof yareallequal,thesameiscertainlynottrueof thevaluesof z.Then,strictlyspeaking,themethodof weighted leastsquaresshouldbeused.(SeeProblem8.26foranexample.) ProblemsforChapter8 For Section8.2:Calculationof theConstants A andB 8.1.*Usethemethodof leastsquarestofindtheliney= A+ Bxthatbestfits thethreepoints(1,6),(3,5),and(5,1).Usingsquaredpaper,plotthethreepoints andyourline.Yourcalculatorprobablyhasabuilt-infunctiontocalculate Aand B; if youdon'tknowhowtouseit,takeamomenttolearnandthencheckyourown answerstothisproblem. 8.2.*Usethemethodofleastsquarestofindtheliney=A+ Bxthatbestfits thefourpoints ( - 3,3),(-1, 4),(1,8),and(3,9). Using squaredpaper,plot thefour pointsandyourline.Yourcalculatorprobablyhasabuilt-in