Introduction to Statistics 
Introduction+to+Statistics%0d%0aIntroduction%2c+examples+and+de%ef%ac%81nitions%0d%0aIntroduction%0d%0aWe+begin+the+module+with+some+basic+data+analysis.+Since+Statistics+involves+the+collection+and+interpretation+of+data%2c+we+must+%ef%ac%81rst+know+how+to+understand%2c+display+and+summarise+large+amounts+of+quantitative+information%2c+before+undertaking+a+more+sophisticated+analysis.+Statistical+analysis+of+quantitative+data+is+important+throughout+the+pure+and+social+sciences.+For+example%2c+during+this+module+we+will+consider+examples+from+Biology%2c+Medicine%2c+Agriculture%2c+Economics%2c+Business+and+Meteorology.%0d%0a%0d%0aExamples%0d%0aSurvival+of+cancer+patients%3a+A+cancer+patient+wants+to+know+the+probability+that+he+will+survive+for+at+least+5+years.+By+collecting+data+on+survival%0d%0a%0d%0a%0crates+of+people+in+a+similar+situation%2c+it+is+possible+to+obtain+an+empirical+estimate+of+survival+rates.+We+cannot+know+whether+or+not+the+patient+will+survive%2c+or+even+know+exactly+what+the+probability+of+survival+is.+However%2c+we+can+estimate+the+proportion+of+patients+who+survive+from+data.%0d%0a%0d%0aCar+maintenance%3a+When+buying+a+certain+type+of+new+car%2c+it+would+be+useful+to+know+how+much+it+is+going+to+cost+to+run+over+the+%ef%ac%81rst+three+years+from+new.+Of+course%2c+we+cannot+predict+exactly+what+this+will+be+%e2%80%94+it+will+vary+from+car+to+car.+However%2c+collecting+data+from+people+who+bought+similar+cars+will+give+some+idea+of+the+distribution+of+costs+across+the+population+of+car+buyers%2c+which+in+turn+will+provide+information+about+the+likely+cost+of+running+the+car.%0d%0a%0d%0aDe%ef%ac%81nitions%0d%0aThe+quantities+measured+in+a+study+are+called+random+variables%2c+and+a+particular+outcome+is+called+an+observation.+Several+observations+are%0d%0a%0d%0a%0ccollectively+known+as+data.+The+collection+of+all+possible+outcomes+is+called+the+population.+In+practice%2c+we+cannot+usually+observe+the+whole+population.+Instead+we+observe+a+sub-set+of+the+population%2c+known+as+a+sample.+In+order+to+ensure+that+the+sample+we+take+is+representative+of+the+whole+population%2c+we+usually+take+a+random+sample+in+which+all+members+of+the+population+are+equally+likely+to+be+selected+for+inclusion+in+the+sample.+For+example%2c+if+we+are+interested+in+conducting+a+survey+of+the+amount+of+physical+exercise+undertaken+by+the+general+public%2c+surveying+people+entering+and+leaving+a+gymnasium+would+provide+a+biased+sample+of+the+population%2c+and+the+results+obtained+would+not+generalise+to+the+population+at+large.+Variables+are+either+qualitative+or+quantitative.+Qualitative+variables+have+non-numeric+outcomes%2c+with+no+natural+ordering.+For+example%2c+gender%2c+disease+status%2c+and+type+of+car+are+all+qualitative+variables.+Quantitative+variables+have+numeric+outcomes.+For+example%2c+survival+time%2c+height%2c+age%2c+number+of+children%2c+and+number+of+faults+are+all+quantitative+variables.%0d%0a%0d%0a%0cQuantitative+variables+can+be+discrete+or+continuous.+Discrete+random+variables+have+outcomes+which+can+take+only+a+countable+number+of+possible+values.+These+possible+values+are+usually+taken+to+be+integers%2c+but+don%e2%80%99t+have+to+be.+For+example%2c+number+of+children+and+number+of+faults+are+discrete+random+variables+which+take+only+integer+values%2c+but+your+score+in+a+quiz+where+%e2%80%9chalf%e2%80%9d+marks+are+awarded+is+a+discrete+quantitative+random+variable+which+can+take+on+non-integer+values.+Continuous+random+variables+can+take+any+value+over+some+continuous+scale.+For+example%2c+survival+time+and+height+are+continuous+random+variables.+Often%2c+continuous+random+variables+are+rounded+to+the+nearest+integer%2c+but+the+are+still+considered+to+be+continuous+variables+if+there+is+an+underlying+continuous+scale.+Age+is+a+good+example+of+this.%0d%0a%0d%0aData+presentation%0d%0aIntroduction%0d%0aA+set+of+data+on+its+own+is+very+hard+to+interpret.+There+is+lots+of+information+contained+in+the+data%2c+but+it+is+hard+to+see.+We+need+ways+of+understanding+important+features+of+the+data%2c+and+to+summarise+it+in+meaningful+ways.%0d%0a%0d%0a%0cThe+use+of+graphs+and+summary+statistics+for+understanding+data+is+an+important+%ef%ac%81rst+step+in+the+undertaking+of+any+statistical+analysis.+For+example%2c+it+is+useful+for+understanding+the+main+features+of+the+data%2c+for+detecting+outliers%2c+and+data+which+has+been+recorded+incorrectly.+Outliers+are+extreme+observations+which+do+not+appear+to+be+consistent+with+the+rest+of+the+data.+The+presence+of+outliers+can+seriously+distort+some+of+the+more+formal+statistical+techniques+to+be+examined+in+the+second+semester%2c+and+so+preliminary+detection+and+correction+or+accommodation+of+such+observations+is+crucial%2c+before+further+analysis+takes+place.%0d%0a%0d%0aFrequency+tables%0d%0aIt+is+important+to+investigate+the+shape+of+the+distribution+of+a+random+variable.+This+is+most+easily+examined+using+frequency+tables+and+diagrams.+A+frequency+table+shows+a+tally+of+the+number+of+data+observations+in+different+categories.+For+qualitative+and+discrete+quantitative+data%2c+we+often+use+all+of+the+observed+values+as+our+categories.+However%2c+if+there+are+a+large+number+of+different%0d%0a%0d%0a%0cobservations%2c+consecutive+observations+may+be+grouped+together+to+form+combined+categories.+Example+For+Example+1+(germinating+seeds)%2c+we+can+construct+the+following+frequency+table.+No.+germinating+Frequency+85+3+86+1+87+5+88+2+89+3+90+6+91+11+92+4+93+4+94+1+n+%3d+40%0d%0a%0d%0aSince+we+only+have+10+categories%2c+there+is+no+need+to+amalgamate+them.+For+continuous+data%2c+the+choice+of+categories+is+more+arbitrary.+We+usually+use+8+to+12+non-overlapping+consecutive+intervals+of+equal+width.+Fewer+than+this+may+be+better+for+small+sample+sizes%2c+and+more+for+very+large+samples.+The+intervals+must+cover+the+entire+observed+range+of+values.+Example%0d%0a%0d%0a%0cFor+Example+2+(survival+times)%2c+we+have+the+following+table.+Range+0+%e2%80%94+39+40+%e2%80%94+79+80+%e2%80%94+119+120+%e2%80%94+159+160+%e2%80%94+199+200+%e2%80%94+240+Frequency+11+4+1+1+2+1%0d%0a%0d%0an+%3d+20%0d%0a%0d%0aN.B.+You+should+de%ef%ac%81ne+the+intervals+to+the+same+accuracy+of+the+data.+Thus%2c+if+the+data+is+de%ef%ac%81ned+to+the+nearest+integer%2c+the+intervals+should+be+(as+above).+Alternatively%2c+if+the+data+is+de%ef%ac%81ned+to+one+decimal+place%2c+so+should+the+intervals.+Also+note+that+here+the+underlying+data+is+continuous.+Consequently%2c+if+the+data+has+been+rounded+to+the+nearest+integer%2c+then+the+intervals+are+actually+0+%e2%88%92+39.5%2c+39.5+%e2%88%92+79.5%2c+etc.+It+is+important+to+include+the+sample+size+with+the+table.%0d%0a%0d%0aHistograms%0d%0a%0d%0a%0cOnce+the+frequency+table+has+been+constructed%2c+pictorial+representation+can+be+considered.+For+most+continuous+data+sets%2c+the+best+diagram+to+use+is+a+histogram.+In+this+the+classi%ef%ac%81cation+intervals+are+represented+to+scale+on+the+abscissa+(x-axis)+of+a+graph+and+rectangles+are+drawn+on+this+base+with+their+areas+proportional+to+the+frequencies.+Hence+the+ordinate+(y-axis)+is+frequency+per+unit+class+interval+(or+more+commonly%2c+relative+frequency+%e2%80%94+see+below).+Note+that+the+heights+of+the+rectangles+will+be+proportional+to+the+frequencies+if+and+only+if+class+intervals+of+equal+width+are+used.%0d%0a%0d%0a%0cExample+The+histogram+for+Example+2+is+as+follows.%0d%0aRaw+frequency+histogram+(n%3d20)%0d%0a10+Frequency+0+0%0d%0a%c2%a2+%c2%a1%0d%0a%0d%0a2%0d%0a%0d%0a4%0d%0a%0d%0a6%0d%0a%0d%0a8%0d%0a%0d%0aTimes%0d%0a%0d%0aNote+that+here+we+have+labelled+the+y-axis+with+the+raw+frequencies.+This+only+makes+sense+when+all+of+the+intervals+are+the+same+width.+Otherwise%2c+we+should+label+using+relative+frequencies%2c+as+follows.%0d%0a%0d%0a%c2%a4%0d%0a%0d%0a%c2%a4%0d%0a%0d%0a%c2%a0%0d%0a%0d%0a%c2%a3%0d%0a%0d%0a40%0d%0a%0d%0a80%0d%0a%0d%0a120%0d%0a%0d%0a160%0d%0a%0d%0a200%0d%0a%0d%0a240%0d%0a%0d%0a%0cRelative+frequency+histogram+(n%3d20)%0d%0a0.012+0.0+0%0d%0a%c2%a2+%c2%a1%0d%0a%0d%0aRelative+Frequency+0.004+0.008%0d%0a%0d%0aTimes%0d%0a%0d%0aThe+y-axis+values+are+chosen+so+that+the+area+of+each+rectangle+is+the+proportion+of+observations+falling+in+that+bin.+Consider+the+%ef%ac%81rst+bin+(0%e2%80%9339).+The+proportion+of+observations+falling+into+this+bin+is+11%2f20+(from+the+frequency+table).+The+area+of+our+rectangle+should%2c+therefore%2c+be+11%2f20.+Since+the+rectangle+has+a+base+of+40%2c+the+height+of+the+rectangle+must+be+11%2f(20+%c3%97+40)+%3d+0.014.+In+general+therefore%2c+we+calculate+the+bin+height+as%0d%0a%0d%0a%c2%a4%0d%0a%0d%0a%c2%a4%0d%0a%0d%0a%c2%a0%0d%0a%0d%0a%c2%a3%0d%0a%0d%0a40%0d%0a%0d%0a80%0d%0a%0d%0a120%0d%0a%0d%0a160%0d%0a%0d%0a200%0d%0a%0d%0a240%0d%0a%0d%0a%0cfollows%3a+Frequency+.+n+%c3%97+BinWidth+This+method+can+be+used+when+the+interval+widths+are+not+the+same%2c+as+shown+below.+Height+%3d%0d%0a%0d%0a%0cRelative+frequency+histogram+(n%3d20)%0d%0aRelative+Frequency+0.005+0.015+0.0+0%0d%0a%c2%a2+%c2%a1%0d%0a%0d%0aTimes%0d%0a%0d%0aNote+that+when+the+y-axis+is+labelled+with+relative+frequencies%2c+the+area+under+the+histogram+is+always+one.+Bin+widths+should+be+chosen+so+that+you+get+a+good+idea+of+the+distribution+of+the+data%2c+without+being+swamped+by+random+variation.+Example%0d%0a%0d%0a%c2%a2%0d%0a%0d%0a%c2%a0%0d%0a%0d%0a%c2%a4%0d%0a%0d%0a%c2%a3%0d%0a%0d%0a20%0d%0a%0d%0a50%0d%0a%0d%0a80%0d%0a%0d%0a160%0d%0a%0d%0a240%0d%0a%0d%0a%0cConsider+the+leaf+area+data+from+Example+3.+There+follows+some+histograms+of+the+data+based+on+different+bin+widths.+Which+provides+the+best+overview+of+the+distribution+of+the+data%3f%0d%0aHistogram+of+Leaves%0d%0a140+Frequency+0+0+20+40+60+80+100+120%0d%0a%0d%0a20%0d%0a%0d%0a40%0d%0a%0d%0a60%0d%0a%0d%0a80+Leaves%0d%0a%0d%0a100%0d%0a%0d%0a120%0d%0a%0d%0a140%0d%0a%0d%0a%0cHistogram+of+Leaves%0d%0a80+Frequency+0+0+20+40+60%0d%0a%0d%0a20%0d%0a%0d%0a40%0d%0a%0d%0a60+Leaves%0d%0a%0d%0a80%0d%0a%0d%0a100%0d%0a%0d%0a120%0d%0a%0d%0a140%0d%0a%0d%0a%0cHistogram+of+Leaves%0d%0a25+Frequency+0+5+10+15+20%0d%0a%0d%0a20%0d%0a%0d%0a40%0d%0a%0d%0a60+Leaves%0d%0a%0d%0a80%0d%0a%0d%0a100%0d%0a%0d%0a120%0d%0a%0d%0a%0cHistogram+of+Leaves%0d%0a%0d%0aFrequency%0d%0a%0d%0a0%0d%0a%0d%0a2%0d%0a%0d%0a4%0d%0a%0d%0a6%0d%0a%0d%0a20%0d%0a%0d%0a40%0d%0a%0d%0a60+Leaves%0d%0a%0d%0a80%0d%0a%0d%0a100%0d%0a%0d%0a120%0d%0a%0d%0aBar+charts+and+frequency+polygons%0d%0aWhen+the+data+are+discrete+and+the+frequencies+refer+to+individual+values%2c+we+display+them+graphically+using+a+bar+chart+with+heights+of+bars+representing+frequencies%2c+or+a+frequency+polygon+in+which+only+the+tops+of+the+bars+are+marked%2c+and+then+these+points+are+joined+by+straight+lines.+Bar+charts+are+drawn+with+a+gap+between+neighbouring+bars+so+that+they+are+easily%0d%0a%0d%0a%0cdistinguished+from+histograms.+Frequency+polygons+are+particularly+useful+for+comparing+two+or+more+sets+of+data.+Example+Consider+again+the+number+of+germinating+seeds+from+Example+1.+Using+the+frequency+table+constructed+earlier%2c+we+can+construct+a+Bar+Chart+and+Frequency+Polygon+as+follows.%0d%0aBarplot+of+the+number+of+germinating+seeds%0d%0a10+Frequency+0+2+4+6+8%0d%0a%0d%0a85%0d%0a%0d%0a86%0d%0a%0d%0a87%0d%0a%0d%0a88%0d%0a%0d%0a89%0d%0a%0d%0a90%0d%0a%0d%0a91%0d%0a%0d%0a92%0d%0a%0d%0a93%0d%0a%0d%0a94%0d%0a%0d%0aNumber+of+seeds%0d%0a%0d%0a%0cFrequency+polygon+for+the+number+of+germinating+seeds%0d%0a%0d%0aFrequency%0d%0a%0d%0a2%0d%0a%0d%0a4%0d%0a%0d%0a6%0d%0a%0d%0a8%0d%0a%0d%0a10%0d%0a%0d%0a86%0d%0a%0d%0a88%0d%0a%0d%0a90+Number+of+seeds%0d%0a%0d%0a92%0d%0a%0d%0a94%0d%0a%0d%0an+%3d+40+A+third+method+which+is+sometimes+used+for+qualitative+data+is+called+a+pie+chart.+Here%2c+a+circle+is+divided+into+sectors+whose+areas%2c+and+hence+angles+are+proportional+to+the+frequencies+in+the+different+categories.+Pie+charts+should+generally+not+be+used+for+quantitative+data+%e2%80%93+a+bar+chart+or+frequency+polygon+is+almost+always+to+be+preferred.+Whatever+the+form+of+the+graph%2c+it+should+be+clearly+labelled+on+each+axis+and+a+fully+descriptive+title+should+be+given%2c+together+with+the+number+of+observations+on+which+the+graph+is+based.%0d%0a%0d%0a%0cStem-and-leaf+plots%0d%0aA+good+way+to+present+both+continuous+and+discrete+data+for+sample+sizes+of+less+than+200+or+so+is+to+use+a+stem-and-leaf+plot.+This+plot+is+similar+to+a+bar+chart+or+histogram%2c+but+contains+more+information.+As+with+a+histogram%2c+we+normally+want+5%e2%80%9312+intervals+of+equal+size+which+span+the+observations.+However%2c+for+a+stem-and-leaf+plot%2c+the+widths+of+these+intervals+must+be+0.2%2c+0.5+or+1.0+times+a+power+of+10%2c+and+we+are+not+free+to+choose+the+end-points+of+the+bins.+They+are+best+explained+in+the+context+of+an+example.+Example+Recall+again+the+seed+germination+Example+1.+Since+the+data+has+a+range+of+9%2c+an+interval+width+of+2+(%3d+0.2+%c3%97+101)+seems+reasonable.+To+form+the+plot%2c+draw+a+vertical+line+towards+the+left+of+the+plotting+area.+On+the+left+of+this+mark+the+interval+boundaries+in+increasing+order%2c+noting+only+those+digits+that+are+common+to+all+of+the+observations+within+the+interval.+This+is+called+the+stem+of+the+plot.+Next+go+through+the+observations+one+by+one%2c+noting+down+the+next+signi%ef%ac%81cant+digit+on+the+right-hand+side+of+the+corresponding+stem.%0d%0a%0d%0a%0c8+8+8+9+9+9%0d%0a%0d%0a5+7+8+1+3+4%0d%0a%0d%0a5+7+9+1+2%0d%0a%0d%0a5+7+8+0+2%0d%0a%0d%0a7+9+1+2%0d%0a%0d%0a6+9+1+3%0d%0a%0d%0a7+0+3+0+3+1+2+1+1+0+1+1+0+0+1+1%0d%0a%0d%0aFor+example%2c+the+%ef%ac%81rst+stem+contains+any+values+of+84+and+85%2c+the+second+stem+contains+any+values+of+86+and+87%2c+and+so+on.+The+digits+to+the+right+of+the+vertical+line+are+known+as+the+leaves+of+the+plot%2c+and+each+digit+is+known+as+a+leaf.+Now+re-draw+the+plot+with+all+of+the+leaves+corresponding+to+a+particular+stem+ordered+increasingly.+At+the+top+of+the+plot%2c+mark+the+sample+size%2c+and+at+the+bottom%2c+mark+the+stem+and+leaf+units.+These+are+such+that+an+observation+corresponding+to+any+leaf+can+be+calculated+as+Observation+%3d+StemLabel+%c3%97+StemUnits+%2b+LeafDigit+%c3%97+LeafUnits+to+the+nearest+leaf+unit.+n+%3d+40%0d%0a%0d%0a%0c8+8+8+9+9+9%0d%0a%0d%0a5+6+8+0+2+4%0d%0a%0d%0a5+7+8+0+2%0d%0a%0d%0a5+7+9+0+2%0d%0a%0d%0a7+9+0+2%0d%0a%0d%0a7+9+0+3%0d%0a%0d%0a7+0+3+1+3+1+3+1+1+1+1+1+1+1+1+1%0d%0a%0d%0aStem+Units+%3d+10+seeds%2c+Leaf+Units+%3d+1+seed.+The+main+advantages+of+using+a+stem-and-leaf+plot+are+that+it+shows+the+general+shape+of+the+data+(like+a+bar+chart+or+histogram)%2c+and+that+the+all+of+the+data+can+be+recovered+(to+the+nearest+leaf+unit).+For+example%2c+we+can+see+from+the+plot+that+there+is+only+one+value+of+94%2c+and+three+values+of+89.+Example+A+stem-and-leaf+plot+for+the+data+from+Example+5+is+given+below.+An+interval+width+of+0.5+(%3d+0.5+%c3%97+100)+is+used.%0d%0a%0d%0a%0cn+%3d+24+1+2+2+3+3+4+5+0+6+0+5+1+9+1+7+1+6+9+3+7+2+8%0d%0a%0d%0a4+8+2+8%0d%0a%0d%0a4+8+8%0d%0a%0d%0a9%0d%0a%0d%0aStem+Units+%3d+1%2c+Leaf+Units+%3d+0.1.+Note+that+in+this+example%2c+the+data+is+given+with+more+signi%ef%ac%81cant+digits+than+can+be+displayed+on+the+plot.+Numbers+should+be+%e2%80%9ccut%e2%80%9d+rather+than+rounded+to+the+nearest+leaf+unit+in+this+case.+For+example%2c+1.97+is+cut+to+1.9%2c+and+then+entered+with+a+stem+of+1+and+a+leaf+of+9.+It+is+not+rounded+to+2.0.%0d%0a%0d%0aSummary%0d%0a%0d%0a%0cUsing+the+plots+described+in+this+section%2c+we+can+gain+an+empirical+understanding+of+the+important+features+of+the+distribution+of+the+data.%0d%0a%0d%0a%e2%80%a2+Is+the+distribution+symmetric+or+asymmetric+about+its+central+value%3f%0d%0a%0d%0a%e2%80%a2+Are+there+any+unusual+or+outlying+observations%2c+which+are+much+larger+or+smaller+than+the+main+body+of+observations%3f%0d%0a%0d%0a%e2%80%a2+Is+the+data+multi-modal%3f+That+is%2c+are+there+gaps+or+multiple+peaks+in+the+distribution+of+the+data%3f+Two+peaks+may+imply+that+there+are+two+different+groups+represented+by+the+data.%0d%0a%0d%0a%e2%80%a2+By+putting+plots+side+by+side+with+the+same+scale%2c+we+may+compare+the+distributions+of+different+groups.%0d%0a%0d%0aSummary+measures%0d%0a%0d%0a%0cMeasures+of+location%0d%0aIn+addition+to+the+graphical+techniques+encountered+so+far%2c+it+is+often+useful+to+obtain+quantitative+summaries+of+certain+aspects+of+the+data.+Most+simple+summary+measurements+can+be+divided+into+two+types%3b+%ef%ac%81rstly+quantities+which+are+%e2%80%9ctypical%e2%80%9d+of+the+data%2c+and+secondly%2c+quantities+which+summarise+the+variability+of+the+data.+The+former+are+known+as+measures+of+location+and+the+latter+as+measures+of+spread.+Suppose+we+have+a+sample+of+size+n+of+quantitative+data.+We+will+denote+the+measurements+by+x1%2c+x2%2c+.+.+.+xn.+Sample+mean+This+is+the+most+important+and+widely+used+measure+of+location.+The+sample+mean+of+a+set+of+data+is+x1+%2b+x2+%2b+%c2%b7+%c2%b7+%c2%b7+%2b+xn+1+n+%3d+%e2%88%91+xi+.+x%3d+%c2%af+n+n+i%3d1+This+is+the+location+measure+often+used+when+talking+about+the+average+of+a+set+of+observations.+However%2c+the+term+%e2%80%9caverage%e2%80%9d+should+be+avoided%2c+as+all+measures+of+location+are+different+kinds+of+averages+of+the+data.%0d%0a%0d%0a%0cIf+we+have+discrete+quantitative+data%2c+tabulated+in+a+frequency+table%2c+then+if+the+possible+outcomes+are+y1%2c+.+.+.+%2c+yk+%2c+and+these+occur+with+frequencies+f1%2c+.+.+.+%2c+fk+%2c+so+that+%e2%88%91+fi+%3d+n%2c+then+the+sample+mean+is+f+1+y1+%2b+%c2%b7+%c2%b7+%c2%b7+%2b+f+k+yk+1+k+1+k+x%3d+%c2%af+%3d+%e2%88%91+f+i+yi+%3d+%e2%88%91+fy.+n+n+i%3d1+fi+i%3d1+i+i+%e2%88%91+For+continuous+data%2c+the+sample+mean+should+be+calculated+from+the+original+data+if+this+is+known.+However%2c+if+it+is+tabulated+in+a+frequency+table%2c+and+the+original+data+is+not+known%2c+then+the+sample+mean+can+be+estimated+by+assuming+that+all+observations+in+a+given+interval+occurred+at+the+mid-point+of+that+interval.+So%2c+if+the+mid-points+of+the+intervals+are+m1%2c+.+.+.+%2c+mk+%2c+and+the+corresponding+frequencies+are+f1%2c+.+.+.+%2c+fk+%2c+then+sample+mean+can+be+approximated+using+x+%c2%af+1+k+%e2%88%91+fm.+n+i%3d1+i+i%0d%0a%0d%0aSample+median+The+sample+median+is+the+middle+observation+when+the+data+are+ranked+in+increasing+order.+We+will+denote+the+ranked+observations+x(1)%2c+x(2)%2c+.+.+.+%2c+x(n).+If%0d%0a%0d%0a%0cthere+are+an+even+number+of+observations%2c+there+is+no+middle+number%2c+and+so+the+median+is+de%ef%ac%81ned+to+be+the+sample+mean+of+the+middle+two+observations.+%ef%a3%b1+%ef%a3%b4x+n%2b1+%2c+n+odd%2c+%ef%a3%b4+(+)+%ef%a3%b2+2+SampleMedian+%3d+%ef%a3%b4+%ef%a3%b41+%ef%a3%b3+x+n+%2b+1+x+n+%2c+n+even.%0d%0a2+(2)+2+(+2+%2b1)%0d%0a%0d%0aThe+sample+median+is+sometimes+used+in+preference+to+the+sample+mean%2c+particularly+when+the+data+is+asymmetric%2c+or+contains+outliers.+However%2c+its+mathematical+properties+are+less+easy+to+determine+than+those+of+the+sample+mean%2c+making+the+sample+mean+preferable+for+formal+statistical+analysis.+The+ranking+of+data+and+calculation+of+the+median+is+usually+done+with+a+stem-and-leaf+plot+when+working+by+hand.+Of+course%2c+for+large+amounts+of+data%2c+the+median+is+calculated+with+the+aid+of+a+computer.+Sample+mode+The+mode+is+the+value+which+occurs+with+the+greatest+frequency.+Consequently%2c+it+only+really+makes+sense+to+calculate+or+use+it+with+discrete+data%2c+or+for+continuous+data+with+small+grouping+intervals+and+large+sample%0d%0a%0d%0a%0csizes.+For+discrete+data+with+possible+outcomes+y1%2c+.+.+.+%2c+yk+occurring+with+frequencies+f1%2c+.+.+.+%2c+fk+%2c+we+may+de%ef%ac%81ne+the+sample+mode+to+be+SampleMode+%3d+%7byk+%7c+fk+%3d+max%7b+fi%7d%7d.%0d%0ai%0d%0a%0d%0aThat+is%2c+the+yk+whose+corresponding+fk+is+largest.+Summary+of+location+measures+As+we+have+already+remarked%2c+the+sample+mean+is+by+far+the+most+important+measure+of+location%2c+primarily+due+to+its+attractive+mathematical+properties+(for+example%2c+the+sample+mean+of+the+sum+of+two+equal+length+columns+of+data+is+just+the+sum+of+the+sample+means+of+the+two+columns).+When+the+distribution+of+the+data+is+roughly+symmetric%2c+the+three+measures+will+be+very+close+to+each+other+anyway.+However%2c+if+the+distribution+is+very+skewed%2c+there+may+be+a+considerable+difference%2c+and+all+three+measures+could+be+useful+in+understanding+the+data.+In+particular%2c+the+sample+median+is+a+much+more+robust+location+estimator%2c+much+less+sensitive+than+the+sample+mean+to+asymmetries+and+unusual+values+in+the+data.%0d%0a%0d%0a%0cIn+order+to+try+and+overcome+some+of+the+problems+associated+with+skewed+data%2c+such+data+is+often+transformed+in+order+to+try+and+get+a+more+symmetric+distribution.+If+the+data+has+a+longer+tail+on+the+left+(smaller+values)+it+is+known+as+left-skewed+or+negatively+skewed.+If+the+data+has+a+longer+tail+on+the+right+(larger+values)%2c+then+it+is+known+as+right-skewed+or+positively+skewed.+N.B.+This+is+the+opposite+to+what+many+people+expect+these+terms+to+mean%2c+as+the+%e2%80%9cbulk%e2%80%9d+of+the+distribution+is+shifted+in+the+opposite+direction+on+automatically+scaled+plots.+If+the+data+is+positively+skewed%2c+then+we+may+take+square+roots+or+logs+of+the+data.+If+it+is+negatively+skewed%2c+we+may+square+or+exponentiate+it.+Example+One+of+the+histograms+for+Example+3%2c+the+leaf+area+data%2c+is+repeated+below.+We+can+see+that+the+long+tail+is+on+the+right%2c+and+so+this+data+is+positively+or+right+skewed.+This+is+the+case+despite+the+fact+that+the+bulk+of+the+distribution+is+shifted+to+the+left+of+the+plot.+If+we+look+now+at+a+histogram+of+the+logs+of+this+data%2c+we+see+that+it+is+much+closer+to+being+symmetric.+The+sample+mean+and+median+are+much+closer+together+(relatively)+for+the+transformed+data.%0d%0a%0d%0a%0cHistogram+of+Leaves%0d%0a25+Frequency+0+5+10+15+20%0d%0a%0d%0a20%0d%0a%0d%0a40%0d%0a%0d%0a60+Leaves%0d%0a%0d%0a80%0d%0a%0d%0a100%0d%0a%0d%0a120%0d%0a%0d%0aHistogram+of+log(Leaves)%0d%0a40+Frequency+0+10+20+30%0d%0a%0d%0a2.5%0d%0a%0d%0a3.0%0d%0a%0d%0a3.5+log(Leaves)%0d%0a%0d%0a4.0%0d%0a%0d%0a4.5%0d%0a%0d%0a5.0%0d%0a%0d%0aMeasures+of+spread%0d%0a%0d%0a%0cKnowing+the+%e2%80%9ctypical+value%e2%80%9d+of+the+data+alone+is+not+enough.+We+also+need+to+know+how+%e2%80%9cconcentrated%e2%80%9d+or+%e2%80%9cspread+out%e2%80%9d+it+is.+That+is%2c+we+need+to+know+something+about+the+%e2%80%9cvariability%e2%80%9d+of+the+data.+Measures+of+spread+are+a+way+of+quantifying+this+idea+numerically.+Range+This+is+the+difference+between+the+largest+and+smallest+observation.+So%2c+for+our+ranked+data%2c+we+have+Range+%3d+x(n)+%e2%88%92+x(1)+This+measure+can+sometimes+be+useful+for+comparing+the+variability+of+samples+of+the+same+size%2c+but+it+is+not+very+robust%2c+and+is+affected+by+sample+size+(the+larger+the+sample%2c+the+bigger+the+range)%2c+so+it+is+not+a+%ef%ac%81xed+characteristic+of+the+population%2c+and+cannot+be+used+to+compare+variability+of+different+sized+samples.+Mean+absolute+deviation+(M.A.D.)%0d%0a%0d%0a%0cThis+is+the+average+absolute+deviation+from+the+sample+mean.+%7cx1+%e2%88%92+x%7c+%2b+%c2%b7+%c2%b7+%c2%b7+%2b+%7cxn+%e2%88%92+x%7c+1+n+%c2%af+%c2%af+M.A.D.+%3d+%c2%af+%3d+%e2%88%91+%7cxi+%e2%88%92+x%7c+n+n+i%3d1+where+%7cx%7c+%3d+x+%e2%88%92x+x%e2%89%a50+x+%3c+0.%0d%0a%0d%0aThe+M.A.D.+statistic+is+easy+to+understand%2c+and+is+often+used+by+non-statisticians.+However%2c+there+are+strong+theoretical+and+practical+reasons+for+preferring+the+statistic+known+as+the+variance%2c+or+its+square+root%2c+the+standard+deviation.+Sample+variance+and+standard+deviation+The+sample+variance%2c+s2+is+given+by+s2+%3d+1+n+2%3d+1+%c2%af+%e2%88%91+(x+%e2%88%92+x)+n+%e2%88%92+1+n+%e2%88%92+1+i%3d1+i%0d%0a%0d%0ai%3d1%0d%0a%0d%0a%e2%88%91+xi2%0d%0a%0d%0an%0d%0a%0d%0a%e2%88%92+nx2+.+%c2%af%0d%0a%0d%0aIt+is+the+average+squared+distance+of+the+observations+from+their+mean+value.+The+second+formula+is+easier+to+calculate+with.+The+divisor+is+n+%e2%88%92+1+rather+than%0d%0a%0d%0a%0cn+in+order+to+correct+for+the+bias+which+occurs+because+we+are+measuring+deviations+from+the+sample+mean+rather+than+the+%e2%80%9ctrue%e2%80%9d+mean+of+the+population+we+are+sampling+from+%e2%80%94+more+on+this+in+Semester+2.+For+discrete+data%2c+we+have+1+k+s2+%3d+%c2%af+%e2%88%91+fi(yi+%e2%88%92+x)2+n+%e2%88%92+1+i%3d1+and+for+continuous+tabulated+data+we+have+s2+1+k+%c2%af+%e2%88%91+fi(mi+%e2%88%92+x)2.+n+%e2%88%92+1+i%3d1%0d%0a%0d%0aThe+sample+standard+deviation%2c+s%2c+is+just+the+square+root+of+the+sample+variance.+It+is+preferred+as+a+summary+measure+as+it+is+in+the+units+of+the+original+data.+However%2c+it+is+often+easier+from+a+theoretical+perspective+to+work+with+variances.+Thus+the+two+measures+are+complimentary.+Most+calculators+have+more+than+one+way+of+calculating+the+standard+deviation+of+a+set+of+data.+Those+with+%cf%83n+and+%cf%83n%e2%88%921+keys+give+the+sample%0d%0a%0d%0a%0cstandard+deviation+by+pressing+the+%cf%83n%e2%88%921+key%2c+and+those+with+%cf%83+and+s+keys+give+it+by+pressing+the+s+key.+When+calculating+a+summary+statistic%2c+such+as+the+mean+and+standard+deviation%2c+it+is+useful+to+have+some+idea+of+the+likely+value+in+order+to+help+spot+arithmetic+slips+or+mistakes+entering+data+into+a+calculator+or+computer.+The+sample+mean+of+a+set+of+data+should+be+close+to+fairly+typical+values%2c+and+4s+should+cover+the+range+of+the+bulk+of+your+observations.+Quartiles+and+the+interquartile+range+Whereas+the+median+has+half+of+the+data+less+than+it%2c+the+lower+quartile+has+a+quarter+of+the+data+less+than+it%2c+and+the+upper+quartile+has+a+quarter+of+the+data+above+it.+So+the+lower+quartile+is+calculated+as+the+(n+%2b+1)%2f4th+smallest+observation%2c+and+the+upper+quartile+is+calculated+as+the+3(n+%2b+1)%2f4th+smallest+observation.+Again%2c+if+this+is+not+an+integer%2c+linearly+interpolate+between+adjacent+observations+as+necessary+(examples+below).+There+is+no+particularly+compelling+reason+why+(n+%2b+1)%2f4+is+used+to+de%ef%ac%81ne+the+position+of+the+lower+quartile+%e2%80%94+(n+%2b+2)%2f4+and+(n+%2b+3)%2f4+seem+just+as%0d%0a%0d%0a%0creasonable.+However%2c+the+de%ef%ac%81nitions+given+are+those+used+by+Minitab%2c+which+seems+as+good+a+reason+as+any+for+using+them!+Examples+Calculating+lower+quartiles%0d%0a%0d%0an+%3d+15+n+%3d+16+n+%3d+17+n+%3d+18+n+%3d+19%0d%0a%0d%0aLQ+at+(15+%2b+1)%2f4+%3d+4+LQ+at+(16+%2b+1)%2f4+%3d+4+1+4+LQ+at+(17+%2b+1)%2f4+%3d+4+1+2+LQ+at+(18+%2b+1)%2f4+%3d+4+3+4+LQ+at+(19+%2b+1)%2f4+%3d+5%0d%0a%0d%0aLQ+is+x(4)+LQ+is+3+x(4)+%2b+1+x(5)+4+4+LQ+is+1+x(4)+%2b+1+x(5)+2+2+LQ+is+1+x(4)+%2b+3+x(5)+4+4+LQ+is+x(5)%0d%0a%0d%0aThe+inter-quartile+range+is+the+difference+between+the+upper+and+lower+quartiles%2c+that+is+IQR+%3d+UQ+%e2%88%92+LQ.%0d%0a%0d%0a%0cIt+measures+the+range+of+the+middle+50%25+of+the+data.+It+is+an+alternative+measure+of+spread+to+the+standard+deviation.+It+is+of+interest+because+it+is+much+more+robust+than+the+standard+deviation%2c+and+thus+is+often+used+to+describe+asymmetric+distributions.+Coef%ef%ac%81cient+of+variation+A+measure+of+spread+that+can+be+of+interest+is+known+as+the+coef%ef%ac%81cient+of+variation.+This+is+the+ratio+of+the+standard+deviation+to+the+mean%2c+s+Coef%ef%ac%81cient+of+variation+%3d+%2c+x+%c2%af+and+thus+has+no+units.+The+coef%ef%ac%81cient+of+variation+does+not+change+if+the+(linear)+scale%2c+but+not+the+location+of+the+data+is+changed.+That+is%2c+if+you+take+data+x1%2c+.+.+.+%2c+xn+and+transform+it+to+new+data%2c+y1%2c+.+.+.+%2c+yn+using+the+mapping+yi+%3d+%ce%b1xi+%2b+%ce%b2%2c+the+coef%ef%ac%81cient+of+variation+of+y1%2c+.+.+.+%2c+yn+will+be+the+same+as+the+coef%ef%ac%81cient+of+variation+of+x1%2c+.+.+.+%2c+xn+if+%ce%b2+%3d+0+and+%ce%b1+%3e+0%2c+but+not+otherwise.+So%2c+the+coef%ef%ac%81cient+of+variation+would+be+the+same+for+a+set+of+length+measurements+whether+they+were+measured+in+centimeters+or+inches+(zero+is+the+same+on+both+scales).+However%2c+the+coef%ef%ac%81cient+of+variation+would+be%0d%0a%0d%0a%0cdifferent+for+a+set+of+temperature+measurements+made+in+Celsius+and+Fahrenheit+(as+the+zero+of+the+two+scales+is+different).%0d%0a%0d%0aBox-and-whisker+plots%0d%0aThis+is+a+useful+graphical+description+of+the+main+features+of+a+set+of+observations.+There+are+many+variations+on+the+box+plot.+The+simplest+form+is+constructed+by+drawing+a+rectangular+box+which+stretches+from+the+lower+quartile+to+the+upper+quartile%2c+and+is+divided+in+two+at+the+median.+From+each+end+of+the+box%2c+a+line+is+drawn+to+the+maximum+and+minimum+observations.+These+lines+are+sometimes+called+whiskers%2c+hence+the+name.+Example+Consider+the+data+for+Example+3%2c+the+leaf+size+data.+Box+plots+for+this+data+and+the+logs+are+given+below.+Notice+how+the+asymmetry+of+the+original+distribution+shows+up+very+clearly+on+the+left+plot%2c+and+the+symmetry+of+the+distribution+of+the+logs%2c+on+the+right+plot.%0d%0a%0d%0a%0c120%0d%0a%0d%0a100%0d%0a%0d%0a80%0d%0a%0d%0a40%0d%0a%0d%0aBox+plots+of+raw+and+transformed+leaf+area+data+(n+%3d+200)+Box-and-whisker+plots+are+particularly+useful+for+comparing+several+groups+of+observations.+A+box+plot+is+constructed+for+each+group+and+these+are+displayed+on+a+common+scale.+At+least+10+observations+per+group+are+required+in+order+for+the+plot+to+be+meaningful.%0d%0a%0d%0a20%0d%0a%0d%0a3.0%0d%0a%0d%0a3.5%0d%0a%0d%0a60%0d%0a%0d%0a4.0%0d%0a%0d%0a4.5%0d%0a%0d%0a%0cIntroduction+to+Probability%0d%0aSample+spaces%2c+events+and+sets%0d%0aIntroduction%0d%0aProbability+is+the+language+we+use+to+model+uncertainty.+The+data+and+examples+we+looked+at+in+the+last+chapter+were+the+outcomes+of+scienti%ef%ac%81c+experiments.+However%2c+those+outcomes+could+have+been+different+%e2%80%94+many+different+kinds+of+uncertainty+and+randomness+were+part+of+the+mechanism+which+led+to+the+actual+data+we+saw.+If+we+are+to+develop+a+proper+understanding+of+such+experimental+results%2c+we+need+to+be+able+to+understand+the+randomness+underlying+them.+In+this+chapter%2c+we+will+look+at+the+fundamentals+of+probability+theory%2c+which+we+can+then+use+in+the+later+chapters+for+modelling+the+outcomes+of+experiments%2c+such+as+those+discussed+in+the+previous+chapter.%0d%0a%0d%0aSample+spaces%0d%0a%0d%0a%0cProbability+theory+is+used+as+a+model+for+situations+for+which+the+outcomes+occur+randomly.+Generically%2c+such+situations+are+called+experiments%2c+and+the+set+of+all+possible+outcomes+of+the+experiment+is+known+as+the+sample+space+corresponding+to+an+experiment.+The+sample+space+is+usually+denoted+by+S%2c+and+a+generic+element+of+the+sample+space+(a+possible+outcome)+is+denoted+by+s.+The+sample+space+is+chosen+so+that+exactly+one+outcome+will+occur.+The+size+of+the+sample+space+is+%ef%ac%81nite%2c+countably+in%ef%ac%81nite+or+uncountably+in%ef%ac%81nite.+Examples+Consider+Example+1.+The+outcome+of+one+of+any+replication+is+the+number+of+germinating+seeds.+Since+100+seeds+were+monitored%2c+the+number+germinating+could+be+anything+from+0+to+100.+So%2c+the+sample+space+for+the+outcomes+of+this+experiment+is+S+%3d+%7b0%2c+1%2c+2%2c+.+.+.+%2c+100%7d.+This+is+an+example+of+a+%ef%ac%81nite+sample+space.+For+Example+2%2c+the+survival+time+in+weeks+could+be+any+non-negative+integer.+That+is+S+%3d+%7b0%2c+1%2c+2%2c+.+.+.+%7d.%0d%0a%0d%0a%0cThis+is+an+example+of+a+countably+in%ef%ac%81nite+sample+space.+In+practice%2c+there+is+some+upper+limit+to+the+number+of+weeks+anyone+can+live%2c+but+since+this+upper+limit+is+unknown%2c+we+include+all+non-negative+integers+in+the+sample+space.+For+Example+3%2c+leaf+size+could+be+any+positive+real+number.+That+is+S+%3d+I+%2b+%e2%89%a1+(0%2c+%e2%88%9e).+R+This+is+an+example+of+an+uncountably+in%ef%ac%81nite+sample+space.+Although+the+leaf+sizes+were+only+measured+to+1+decimal+place%2c+the+actual+leaf+sizes+vary+continuously.+For+Example+4+(number+of+siblings)%2c+the+sample+space+would+be+as+for+Example+2%2c+and+for+Example+5+(plutonium+measurements)%2c+the+sample+space+would+be+the+same+as+in+Example+3.%0d%0a%0d%0aEvents%0d%0aA+subset+of+the+sample+space+(a+collection+of+possible+outcomes)+is+known+as+an+event.+Events+may+be+classi%ef%ac%81ed+into+four+types%3a%0d%0a%0d%0a%e2%80%a2+the+null+event+is+the+empty+subset+of+the+sample+space%3b%0d%0a%0d%0a%0c%e2%80%a2+an+atomic+event+is+a+subset+consisting+of+a+single+element+of+the+sample+space%3b+%e2%80%a2+a+compound+event+is+a+subset+consisting+of+more+than+one+element+of+the+sample+space%3b+%e2%80%a2+the+sample+space+itself+is+also+an+event.+Examples+Consider+the+sample+space+for+Example+4+(number+of+siblings)%2c+S+%3d+%7b0%2c+1%2c+2%2c+.+.+.+%7d+and+the+event+at+most+two+siblings%2c+E+%3d+%7b0%2c+1%2c+2%7d.+Now+consider+the+event+F+%3d+%7b1%2c+2%2c+3%2c+.+.+.+%7d.%0d%0a%0d%0a%0cHere%2c+F+is+the+event+at+least+one+sibling.+The+union+of+two+events+E+and+F+is+the+event+that+at+least+one+of+E+and+F+occurs.+The+union+of+the+events+can+be+obtained+by+forming+the+union+of+the+sets.+Thus%2c+if+G+is+the+union+of+E+and+F%2c+then+we+write+G+%3d+E+%e2%88%aaF+%3d+%7b0%2c+1%2c+2%7d+%e2%88%aa+%7b1%2c+2%2c+3%2c+.+.+.+%7d+%3d+%7b0%2c+1%2c+2%2c+.+.+.+%7d+%3dS+So+the+union+of+E+and+F+is+the+whole+sample+space.+That+is%2c+the+events+E+and+F+together+cover+all+possible+outcomes+of+the+experiment+%e2%80%94+at+least+one+of+E+or+F+must+occur.+The+intersection+of+two+events+E+and+F+is+the+event+that+both+E+and+F+occur.+The+intersection+of+two+events+can+be+obtained+by+forming+the+intersection+of+the+sets.+Thus%2c+if+H+is+the+intersection+of+E+and+F%2c+then+H+%3d+E+%e2%88%a9F+%3d+%7b0%2c+1%2c+2%7d+%e2%88%a9+%7b1%2c+2%2c+3%2c+.+.+.+%7d+%3d+%7b1%2c+2%7d%0d%0a%0d%0a%0cSo+the+intersection+of+E+and+F+is+the+event+one+or+two+siblings.+%c2%af+The+complement+of+an+event%2c+A%2c+denoted+Ac+or+A%2c+is+the+event+that+A+does+not+occur%2c+and+hence+consists+of+all+those+elements+of+the+sample+space+that+are+not+in+A.+Thus+if+E+%3d+%7b0%2c+1%2c+2%7d+and+F+%3d+%7b1%2c+2%2c+.+.+.+%7d%2c+E+c+%3d+%7b3%2c+4%2c+5%2c+.+.+.+%7d+and+F+c+%3d+%7b0%7d.+Two+events+A+and+B+are+disjoint+or+mutually+exclusive+if+they+cannot+both+occur.+That+is%2c+their+intersection+in+empty+%2f+A+%e2%88%a9+B+%3d+0.+Note+that+for+any+event+A%2c+the+events+A+and+Ac+are+disjoint%2c+and+their+union+is+the+whole+of+the+sample+space%3a+%2f+A+%e2%88%a9+Ac+%3d+0+and+A+%e2%88%aa+Ac+%3d+S.+The+event+A+is+true+if+the+outcome+of+the+experiment%2c+s%2c+is+contained+in+the+event+A%3b+that+is%2c+if+s+%e2%88%88+A.+We+say+that+the+event+A+implies+the+event+B%2c+and+write%0d%0a%0d%0a%0cA+%e2%87%92+B%2c+if+the+truth+of+B+automatically+follows+from+the+truth+of+A.+If+A+is+a+subset+of+B%2c+then+occurrence+of+A+necessarily+implies+occurrence+of+the+event+B.+That+is+(A+%e2%8a%86+B)+%e2%87%90%e2%87%92+(A+%e2%88%a9+B+%3d+A)+%e2%87%90%e2%87%92+(A+%e2%87%92+B).+We+can+see+already+that+to+understand+events%2c+we+must+understand+a+little+set+theory.%0d%0a%0d%0aSet+theory%0d%0aWe+already+know+about+sets%2c+complements+of+sets%2c+and+the+union+and+intersection+of+two+sets.+In+order+to+progress+further+we+need+to+know+the+basic+rules+of+set+theory.%0d%0a%0d%0aCommutative+laws%3a+A%e2%88%aaB+%3d+B%e2%88%aaA+A%e2%88%a9B+%3d+B%e2%88%a9A%0d%0a%0d%0a%0cAssociative+laws%3a+(A+%e2%88%aa+B)+%e2%88%aaC+%3d+A+%e2%88%aa+(B+%e2%88%aaC)+(A+%e2%88%a9+B)+%e2%88%a9C+%3d+A+%e2%88%a9+(B+%e2%88%a9C)+Distributive+laws%3a+(A+%e2%88%aa+B)+%e2%88%a9C+%3d+(A+%e2%88%a9C)+%e2%88%aa+(B+%e2%88%a9C)+(A+%e2%88%a9+B)+%e2%88%aaC+%3d+(A+%e2%88%aaC)+%e2%88%a9+(B+%e2%88%aaC)+DeMorgan%e2%80%99s+laws%3a+(A+%e2%88%aa+B)c+%3d+Ac+%e2%88%a9+Bc+(A+%e2%88%a9+B)c+%3d+Ac+%e2%88%aa+Bc+Disjoint+union%3a+A+%e2%88%aa+B+%3d+(A+%e2%88%a9+Bc)+%e2%88%aa+(Ac+%e2%88%a9+B)+%e2%88%aa+(A+%e2%88%a9+B)+and+A+%e2%88%a9+Bc%2c+Ac+%e2%88%a9+B+and+A+%e2%88%a9+B+are+disjoint.%0d%0a%0d%0a%0cVenn+diagrams+can+be+useful+for+thinking+about+manipulating+sets%2c+but+formal+proofs+of+set-theoretic+relationships+should+only+rely+on+use+of+the+above+laws.%0d%0a%0d%0aProbability+axioms+and+simple+counting+problems%0d%0aProbability+axioms+and+simple+properties%0d%0aNow+that+we+have+a+good+mathematical+framework+for+understanding+events+in+terms+of+sets%2c+we+need+a+corresponding+framework+for+understanding+probabilities+of+events+in+terms+of+sets.+The+real+valued+function+P(%c2%b7)+is+a+probability+measure+if+it+acts+on+subsets+of+S+and+obeys+the+following+axioms%3a%0d%0a%0d%0aI.+P(S)+%3d+1.%0d%0a%0d%0aII.+If+A+%e2%8a%86+S+then+P(A)+%e2%89%a5+0.%0d%0a%0d%0a%0c%2f+III.+If+A+and+B+are+disjoint+(A+%e2%88%a9+B+%3d+0)+then+P(A+%e2%88%aa+B)+%3d+P(A)+%2b+P(B)+.+Repeated+use+of+Axiom+III+gives+the+more+general+result+that+if+A1%2c+A2%2c+.+.+.+%2c+An+are+mutually+disjoint%2c+then%0d%0an%0d%0a%0d%0aP%0d%0ai%3d1%0d%0a%0d%0aAi%0d%0a%0d%0a%3d%0d%0a%0d%0ai%3d1%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0an%0d%0a%0d%0aP(Ai)+.%0d%0a%0d%0aIndeed%2c+we+will+assume+further+that+the+above+result+holds+even+if+we+have+a+countably+in%ef%ac%81nite+collection+of+disjoint+events+(n+%3d+%e2%88%9e).%0d%0a%0d%0aThese+axioms+seem+to+%ef%ac%81t+well+with+our+intuitive+understanding+of+probability%2c+but+there+are+a+few+additional+comments+worth+making.%0d%0a%0d%0a1.+Axiom+I+says+that+one+of+the+possible+outcomes+must+occur.+A+probability+of+1+is+assigned+to+the+event+%e2%80%9csomething+occurs%e2%80%9d.+This+%ef%ac%81ts+in+exactly+with+our+de%ef%ac%81nition+of+sample+space.+Note+however%2c+that+the+implication+does+not+go+the+other+way!+When+dealing+with+in%ef%ac%81nite+sample+spaces%2c+there+are%0d%0a%0d%0a%0coften+events+of+probability+one+which+are+not+the+sample+space+and+events+of+probability+zero+which+are+not+the+empty+set.+2.+Axiom+II+simply+states+that+we+wish+to+work+only+with+positive+probabilities%2c+because+in+some+sense%2c+probability+measures+the+size+of+the+set+(event).+3.+Axiom+III+says+that+probabilities+%e2%80%9cadd+up%e2%80%9d+%e2%80%94+if+we+want+to+know+the+probability+of+at+most+one+sibling%2c+then+this+is+the+sum+of+the+probabilities+of+zero+siblings+and+one+sibling.+Allowing+this+result+to+hold+for+countably+in%ef%ac%81nite+unions+is+slightly+controversial%2c+but+it+makes+the+mathematics+much+easier%2c+so+we+will+assume+it+throughout!+These+axioms+are+all+we+need+to+develop+a+theory+of+probability%2c+but+there+are+a+collection+of+commonly+used+properties+which+follow+directly+from+these+axioms%2c+and+which+we+make+extensive+use+of+when+carrying+out+probability+calculations.+Property+A%3a+P(Ac)+%3d+1+%e2%88%92+P(A).%0d%0a%0d%0a%0c%2f+Property+B%3a+P(0)+%3d+0.+Property+C%3a+If+A+%e2%8a%86+B%2c+then+P(A)+%e2%89%a4+P(B).+Property+D%3a+(Addition+Law)+P(A+%e2%88%aa+B)+%3d+P(A)+%2b+P(B)+%e2%88%92+P(A+%e2%88%a9+B).%0d%0a%0d%0aInterpretations+of+probability%0d%0aSomehow%2c+we+all+have+an+intuitive+feel+for+the+notion+of+probability%2c+and+the+axioms+seem+to+capture+its+essence+in+a+mathematical+form.+However%2c+for+probability+theory+to+be+anything+other+than+an+interesting+piece+of+abstract+pure+mathematics%2c+it+must+have+an+interpretation+that+in+some+way+connects+it+to+reality.+If+you+wish+only+to+study+probability+as+a+mathematical+theory%2c+then+there+is+no+need+to+have+an+interpretation.+However%2c+if+you+are+to+use+probability+theory+as+your+foundation+for+a+theory+of+statistical+inference+which+makes+probabilistic+statements+about+the+world+around+us%2c+then+there+must+be+an+interpretation+of+probability+which+makes+some+connection+between+the+mathematical+theory+and+reality.%0d%0a%0d%0a%0cWhilst+there+is+(almost)+unanimous+agreement+about+the+mathematics+of+probability%2c+the+axioms+and+their+consequences%2c+there+is+considerable+disagreement+about+the+interpretation+of+probability.+The+three+most+common+interpretations+are+given+below.+Classical+interpretation+The+classical+interpretation+of+probability+is+based+on+the+assumption+of+underlying+equally+likely+events.+That+is%2c+for+any+events+under+consideration%2c+there+is+always+a+sample+space+which+can+be+considered+where+all+atomic+events+are+equally+likely.+If+this+sample+space+is+given%2c+then+the+probability+axioms+may+be+deduced+from+set-theoretic+considerations.+This+interpretation+is+%ef%ac%81ne+when+it+is+obvious+how+to+partition+the+sample+space+into+equally+likely+events%2c+and+is+in+fact+entirely+compatible+with+the+other+two+interpretations+to+be+described+in+that+case.+The+problem+with+this+interpretation+is+that+for+many+situations+it+is+not+at+all+obvious+what+the+partition+into+equally+likely+events+is.+For+example%2c+consider+the+probability+that+it+rains+in+Newcastle+tomorrow.+This+is+clearly+a+reasonable+event+to%0d%0a%0d%0a%0cconsider%2c+but+it+is+not+at+all+clear+what+sample+space+we+should+construct+with+equally+likely+outcomes.+Consequently%2c+the+classical+interpretation+falls+short+of+being+a+good+interpretation+for+real-world+problems.+However%2c+it+provides+a+good+starting+point+for+a+mathematical+treatment+of+probability+theory%2c+and+is+the+interpretation+adopted+by+many+mathematicians+and+theoreticians.+Frequentist+interpretation+An+interpretation+of+probability+widely+adopted+by+statisticians+is+the+relative+frequency+interpretation.+This+interpretation+makes+a+much+stronger+connection+with+reality+than+the+previous+one%2c+and+%ef%ac%81ts+in+well+with+traditional+statistical+methodology.+Here+probability+only+has+meaning+for+events+from+experiments+which+could+in+principle+be+repeated+arbitrarily+many+times+under+essentially+identical+conditions.+Here%2c+the+probability+of+an+event+is+simply+the+%e2%80%9clong-run+proportion%e2%80%9d+of+times+that+the+event+occurs+under+many+repetitions+of+the+experiment.+It+is+reasonable+to+suppose+that+this+proportion+will+settle+down+to+some+limiting+value+eventually%2c+which+is+the+probability+of+the+event.+In+such+a+situation%2c+it+is+possible+to+derive+the+axioms+of+probability+from%0d%0a%0d%0a%0cconsideration+of+the+long+run+frequencies+of+various+events.+The+probability+p%2c+of+an+event+E%2c+is+de%ef%ac%81ned+by+r+p+%3d+lim+n%e2%86%92%e2%88%9e+n+where+r+is+the+number+of+times+E+occurred+in+n+repetitions+of+the+experiment.+Unfortunately+it+is+hard+to+make+precise+exactly+why+such+a+limiting+frequency+should+exist.+A+bigger+problem+however%2c+is+that+the+interpretation+only+applies+to+outcomes+of+repeatable+experiments%2c+and+there+are+many+%e2%80%9cone-off%e2%80%9d+events%2c+such+as+%e2%80%9crain+in+Newcastle+tomorrow%e2%80%9d%2c+that+we+would+like+to+be+able+to+attach+probabilities+to.+Subjective+interpretation+This+%ef%ac%81nal+common+interpretation+of+probability+is+somewhat+controversial%2c+but+does+not+suffer+from+the+problems+that+the+other+interpretations+do.+It+suggests+that+the+association+of+probabilities+to+events+is+a+personal+(subjective)+process%2c+relating+to+your+degree+of+belief+in+the+likelihood+of+the+event+occurring.+It+is+controversial+because+it+accepts+that+different+people+will%0d%0a%0d%0a%0cassign+different+probabilities+to+the+same+event.+Whilst+in+some+sense+it+gives+up+on+an+objective+notion+of+probability%2c+it+is+in+no+sense+arbitrary.+It+can+be+de%ef%ac%81ned+in+a+precise+way%2c+from+which+the+axioms+of+probability+may+be+derived+as+requirements+of+self-consistency.+A+simple+way+to+de%ef%ac%81ne+your+subjective+probability+that+some+event+E+will+occur+is+as+follows.+Your+probability+is+the+number+p+such+that+you+consider+%24p+to+be+a+fair+price+for+a+gamble+which+will+pay+you+%241+if+E+occurs+and+nothing+otherwise.+So%2c+if+you+consider+40p+to+be+a+fair+price+for+a+gamble+which+pays+you+%241+if+it+rains+in+Newcastle+tomorrow%2c+then+0.4+is+your+subjective+probability+for+the+event.+The+subjective+interpretation+is+sometimes+known+as+the+degree+of+belief+interpretation%2c+and+is+the+interpretation+of+probability+underlying+the+theory+of+Bayesian+Statistics+(MAS359%2c+MAS368%2c+MAS451)+%e2%80%94+a+powerful+theory+of+statistical+inference+named+after+Thomas+Bayes%2c+the+18th+Century+Presbyterian+Minister+who+%ef%ac%81rst+proposed+it.+Consequently%2c+this+interpretation+of+probability+is+sometimes+also+known+as+the+Bayesian+interpretation.+Summary%0d%0a%0d%0a%0cWhilst+the+interpretation+of+probability+is+philosophically+very+important%2c+all+interpretations+lead+to+the+same+set+of+axioms%2c+from+which+the+rest+of+probability+theory+is+deduced.+Consequently%2c+for+this+module%2c+it+will+be+suf%ef%ac%81cient+to+adopt+a+fairly+classical+approach%2c+taking+the+axioms+as+given%2c+and+investigating+their+consequences+independently+of+the+precise+interpretation+adopted.%0d%0a%0d%0aClassical+probability%0d%0aClassical+probability+theory+is+concerned+with+carrying+out+probability+calculations+based+on+equally+likely+outcomes.+That+is%2c+it+is+assumed+that+the+sample+space+has+been+constructed+in+such+a+way+that+every+subset+of+the+sample+space+consisting+of+a+single+element+has+the+same+probability.+If+the+sample+space+contains+n+possible+outcomes+(%23S+%3d+n)%2c+we+must+have+for+all+s+%e2%88%88+S%2c+P(%7bs%7d)+%3d+and+hence+for+all+E+%e2%8a%86+S+%23E+P(E)+%3d+.+n+1+n%0d%0a%0d%0a%0cMore+informally%2c+we+have+P(E)+%3d+number+of+ways+E+can+occur+.+total+number+of+outcomes%0d%0a%0d%0aExample+Suppose+that+a+fair+coin+is+thrown+twice%2c+and+the+results+recorded.+The+sample+space+is+S+%3d+%7bHH%2c+HT%2c+T+H%2c+T+T+%7d.+Let+us+assume+that+each+outcome+is+equally+likely+%e2%80%94+that+is%2c+each+outcome+has+a+probability+of+1%2f4.+Let+A+denote+the+event+head+on+the+%ef%ac%81rst+toss%2c+and+B+denote+the+event+head+on+the+second+toss.+In+terms+of+sets+A+%3d+%7bHH%2c+HT+%7d%2c+B+%3d+%7bHH%2c+T+H%7d.+So+P(A)+%3d+%23A+2+1+%3d+%3d+n+4+2%0d%0a%0d%0a%0cand+similarly+P(B)+%3d+1%2f2.+If+we+are+interested+in+the+event+C+%3d+A+%e2%88%aa+B+we+can+work+out+its+probability+using+from+the+set+de%ef%ac%81nition+as+%23C+%23(A+%e2%88%aa+B)+%23%7bHH%2c+HT%2c+T+H%7d+3+P(C)+%3d+%3d+%3d+%3d+4+4+4+4+or+by+using+the+addition+formula+1+1+P(C)+%3d+P(A+%e2%88%aa+B)+%3d+P(A)+%2b+P(B)+%e2%88%92+P(A+%e2%88%a9+B)+%3d+%2b+%e2%88%92+P(A+%e2%88%a9+B)+.+2+2+Now+A+%e2%88%a9+B+%3d+%7bHH%7d%2c+which+has+probability+1%2f4%2c+so+1+1+1+3+P(C)+%3d+%2b+%e2%88%92+%3d+.+2+2+4+4+In+this+simple+example%2c+it+seems+easier+to+work+directly+with+the+de%ef%ac%81nition.+However%2c+in+more+complex+problems%2c+it+is+usually+much+easier+to+work+out+how+many+elements+there+are+in+an+intersection+than+in+a+union%2c+making+the+addition+law+very+useful.%0d%0a%0d%0aThe+multiplication+principle%0d%0aIn+the+above+example+we+saw+that+there+were+two+distinct+experiments+%e2%80%94+%ef%ac%81rst+throw+and+second+throw.+There+were+two+equally+likely+outcomes+for+the+%ef%ac%81rst%0d%0a%0d%0a%0cthrow+and+two+equally+likely+outcomes+for+the+second+throw.+This+leads+to+a+combined+experiment+with+2+%c3%97+2+%3d+4+possible+outcomes.+This+is+an+example+of+the+multiplication+principle.+Multiplication+principle+If+there+are+p+experiments+and+the+%ef%ac%81rst+has+n1+equally+likely+outcomes%2c+the+second+has+n2+equally+likely+outcomes%2c+and+so+on+until+the+pth+experiment+has+n+p+equally+likely+outcomes%2c+then+there+are+n1+%c3%97+n2+%c3%97+%c2%b7+%c2%b7+%c2%b7+n+p+%3d+%e2%88%8f+ni%0d%0ai%3d1+p%0d%0a%0d%0aequally+likely+possible+outcomes+for+the+p+experiments.+Example+A+class+of+school+children+consists+of+14+boys+and+17+girls.+The+teacher+wishes+to+pick+one+boy+and+one+girl+to+star+in+the+school+play.+By+the+multiplication+principle%2c+she+can+do+this+in+14+%c3%97+17+%3d+238+different+ways.%0d%0a%0d%0a%0cExample+A+die+is+thrown+twice+and+the+number+on+each+throw+is+recorded.+There+are+clearly+6+possible+outcomes+for+the+%ef%ac%81rst+throw+and+6+for+the+second+throw.+By+the+multiplication+principle%2c+there+are+36+possible+outcomes+for+the+two+throws.+If+D+is+the+event+a+double-six%2c+then+since+there+is+only+one+possible+outcome+of+the+two+throws+which+leads+to+a+double-six%2c+we+must+have+P(D)+%3d+1%2f36.+Now+let+E+be+the+event+six+on+the+%ef%ac%81rst+throw+and+F+be+the+event+six+on+the+second+throw.+We+know+that+P(E)+%3d+P(F)+%3d+1%2f6.+If+we+are+interested+in+the+event+G%2c+at+least+one+six%2c+then+G+%3d+E+%e2%88%aa+F%2c+and+using+the+addition+law+we+have+P(G)+%3d+P(E+%e2%88%aa+F)+%3d+P(E)+%2b+P(F)+%e2%88%92+P(E+%e2%88%a9+F)+1+1+%3d+%2b+%e2%88%92+P(D)+6+6+1+1+1+%3d+%2b+%e2%88%92+6+6+36+11+%3d+.+36%0d%0a%0d%0a%0cThis+is+much+easier+than+trying+to+count+how+many+of+the+36+possible+outcomes+correspond+to+G.%0d%0a%0d%0aPermutations+and+combinations%0d%0aIntroduction%0d%0aA+repeated+experiment+often+encountered+is+that+of+repeated+sampling+from+a+%ef%ac%81xed+collection+of+objects.+If+we+are+allowed+duplicate+objects+in+our+selection%2c+then+the+procedure+is+known+as+sampling+with+replacement%2c+if+we+are+not+allowed+duplicates%2c+then+the+procedure+is+known+as+sampling+without+replacement.+Probabilists+often+like+to+think+of+repeated+sampling+in+terms+of+drawing+labelled+balls+from+an+urn+(randomly+picking+numbered+balls+from+a+large+rounded+vase+with+a+narrow+neck).+Sometimes+the+order+in+which+the+balls+are+drawn+is+important%2c+in+which+case+the+set+of+draws+made+is+referred+to+as+a+permutation%2c+and+sometimes+the+order+does+not+matter+(like+the+six+main+balls+in+the+National+Lottery)%2c+in+which+case+set+of+draws+is+referred+to+as+a%0d%0a%0d%0a%0ccombination.+We+want+a+way+of+counting+the+number+of+possible+permutations+and+combinations+so+that+we+can+understand+the+probabilities+of+different+kinds+of+drawings+occurring.%0d%0a%0d%0aPermutations%0d%0aSuppose+that+we+have+a+collection+of+n+objects%2c+C+%3d+%7bc1%2c+c2%2c+.+.+.+%2c+cn%7d.+We+want+to+make+r+selections+from+C.+How+many+possible+ordered+selections+can+we+make%3f+If+we+are+sampling+with+replacement%2c+then+we+have+r+experiments%2c+and+each+has+n+possible+(equally+likely)+outcomes%2c+and+so+by+the+multiplication+principle%2c+there+are+n+%c3%97+n+%c3%97+%c2%b7+%c2%b7+%c2%b7+%c3%97+n+%3d+nr+ways+of+doing+this.+If+we+are+sampling+without+replacement%2c+then+we+have+r+experiments.+The+%ef%ac%81rst+experiment+has+n+possible+outcomes.+The+second+experiment+only+has+n+%e2%88%92+1%0d%0a%0d%0a%0cpossible+outcomes%2c+as+one+object+has+already+been+selected.+The+third+experiment+has+n+%e2%88%92+2+outcomes+and+so+on+until+the+rth+experiment%2c+which+has+n+%e2%88%92+r+%2b+1+possible+outcomes.+By+the+multiplication+principle%2c+the+number+of+possible+selections+is+n!+n+%c3%97+(n+%e2%88%92+1)+%c3%97+(n+%e2%88%92+2)+%c3%97+%c2%b7+%c2%b7+%c2%b7+%c3%97+3+%c3%97+2+%c3%97+1+n+%c3%97+(n+%e2%88%92+1)+%c3%97+(n+%e2%88%92+2)+%c3%97+%c2%b7+%c2%b7+%c2%b7+%c3%97+(n+%e2%88%92+r+%2b+1)+%3d+%3d+.+(n+%e2%88%92+r)+%c3%97+(n+%e2%88%92+r+%e2%88%92+1)+%c3%97+%c2%b7+%c2%b7+%c2%b7+%c3%97+3+%c3%97+2+%c3%97+1+(n+%e2%88%92+r)!+This+is+a+commonly+encountered+expression+in+combinatorics%2c+and+has+its+own+notation.+The+number+of+ordered+ways+of+selecting+r+objects+from+n+is+denoted+Pn%2c+where+r+Pn+%3d+r+n!+.+(n+%e2%88%92+r)!%0d%0a%0d%0aWe+refer+to+Pn+as+the+number+of+permutations+of+r+out+of+n+objects.+If+we+are+r+interested+solely+in+the+number+of+ways+of+arranging+n+objects%2c+then+this+is+clearly+just+Pn+%3d+n!+n+Example%0d%0a%0d%0a%0cA+CD+has+12+tracks+on+it%2c+and+these+are+to+be+played+in+random+order.+There+are+12!+ways+of+selecting+them.+There+is+only+one+such+ordering+corresponding+to+the+ordering+on+the+box%2c+so+the+probability+of+the+tracks+being+played+in+the+order+on+the+box+is+1%2f12!+As+we+will+see+later%2c+this+is+considerably+smaller+than+the+probability+of+winning+the+National+Lottery!+Suppose+that+you+have+time+to+listen+to+only+5+tracks+before+you+go+out.+There+are+12!+%3d+12+%c3%97+11+%c3%97+10+%c3%97+9+%c3%97+8+%3d+95%2c+040+P12+%3d+5+7!+ways+they+could+be+played.+Again%2c+only+one+of+these+will+correspond+to+the+%ef%ac%81rst+5+tracks+on+the+box+(in+the+correct+order)%2c+so+the+probability+that+the+5+played+will+be+the+%ef%ac%81rst+5+on+the+box+is+1%2f95040.+Example+In+a+computer+practical+session+containing+40+students%2c+what+is+the+probability+that+at+least+two+students+share+a+birthday%3f%0d%0a%0d%0a%0cFirst%2c+let%e2%80%99s+make+some+simplifying+assumptions.+We+will+assume+that+there+are+365+days+in+a+year+and+that+each+day+is+equally+likely+to+be+a+birthday.+Call+the+event+we+are+interested+in+A.+We+will+%ef%ac%81rst+calculate+the+probability+of+Ac%2c+the+probability+that+no+two+people+have+the+same+birthday%2c+and+calculate+the+probability+we+want+using+P(A)+%3d+1+%e2%88%92+P(Ac).+The+number+of+ways+40+birthdays+could+occur+is+like+sampling+40+objects+from+365+with+replacement%2c+which+is+just+36540.+The+number+of+ways+we+can+have+40+distinct+birthdays+is+like+sampling+40+objects+from+365+without+replacement%2c+P365.+So%2c+the+40+probability+of+all+birthdays+being+distinct+is%0d%0a365+365!+c+)+%3d+P40+%3d+P(A+%e2%89%88+0.1+36540+325!36540%0d%0a%0d%0aand+so+P(A)+%3d+1+%e2%88%92+P(Ac)+%e2%89%88+0.9.+That+is%2c+there+is+a+probability+of+0.9+that+we+have+a+match.+In+fact%2c+the+fact+that+birthdays+are+not+distributed+uniformly+over+the+year+makes+the+probability+of+a+match+even+higher!%0d%0a%0d%0a%0cUnless+you+have+a+very+fancy+calculator%2c+you+may+have+to+expand+the+expression+a+bit%2c+and+give+it+to+your+calculator+in+manageable+chunks.+On+the+other+hand%2c+Maple+loves+expressions+like+this.+%3e+1-365!%2f(325!*365%cb%8640)%3b+%3e+evalf(%22)%3b+will+give+the+correct+answer.+However%2c+Maple+also+knows+about+combinatoric+functions.+The+following+gives+the+same+answer%3a+%3e+with(combinat)%3b+%3e+1-numbperm(365%2c40)%2f(365%cb%8640)%3b+%3e+evalf(%22)%3b+Similarly%2c+the+probability+that+there+will+be+a+birthday+match+in+a+group+of+n+people+is+P365+1+%e2%88%92+n+n.+365%0d%0a%0d%0a%0cWe+can+de%ef%ac%81ne+this+as+a+Maple+function%2c+and+evaluate+it+for+some+different+values+of+n+as+follows.+%3e+%3e+%3e+%3e+%3e+%3e+%3e+%3e+with(combinat)%3b+p+%3a%3d+n+-%3e+evalf(1+-+numbperm(365%2cn)%2f(365%cb%86n))%3b+p(10)%3b+p(20)%3b+p(22)%3b+p(23)%3b+p(40)%3b+p(50)%3b%0d%0a%0d%0aThe+probability+of+a+match+goes+above+0.5+for+n+%3d+23.+That+is%2c+you+only+need+a+group+of+23+people+in+order+to+have+a+better+than+evens+chance+of+a+match.+This+is+a+somewhat+counter-intuitive+result%2c+and+the+reason+is+that+people+think+more+intuitively+about+the+probability+that+someone+has+the+same+birthday+as+themselves.+This+is+an+entirely+different+problem.+Suppose+that+you+are+one+of+a+group+of+40+students.+What+is+the+probability+of+B%2c+where+B+is+the+event+that+at+least+one+other+person+in+the+group+has+the+same+birthday+as+you%3f%0d%0a%0d%0a%0cAgain%2c+we+will+work+out+P(Bc)+%ef%ac%81rst%2c+the+probability+that+no-one+has+your+birthday.+Now%2c+there+are+36539+ways+that+the+birthdays+of+the+the+other+people+can+occur%2c+and+we+allow+each+of+them+to+have+any+birthday+other+than+yours%2c+so+there+are+36439+ways+for+this+to+occur.+Hence+we+have%0d%0a39+c+)+%3d+364+%e2%89%88+0.9+P(B+36539%0d%0a%0d%0aand+so+36439+P(B)+%3d+1+%e2%88%92+%e2%89%88+0.1.+39+365+Here+the+probabilities+are+reversed+%e2%80%94+there+is+only+a+10%25+chance+that+someone+has+the+same+birthday+as+you.+Most+people+%ef%ac%81nd+this+much+more+intuitively+reasonable.+So%2c+how+big+a+group+of+people+would+you+need+in+order+to+have+a+better+than+evens+chance+of+someone+having+the+same+birthday+as+you%3f+The+general+formula+for+the+probability+of+a+match+with+n+people+is+364n%e2%88%921+364+n%e2%88%921+P(B)+%3d+1+%e2%88%92+%3d+1%e2%88%92+%2c+n%e2%88%921+365+365+and+as+long+as+you+enter+it+into+your+calculator+the+way+it+is+written+on+the+right%2c+it+will+be+%ef%ac%81ne.+We+%ef%ac%81nd+that+a+group+of+size+254+is+needed+for+the%0d%0a%0d%0a%0cprobability+to+be+greater+than+0.5%2c+and+that+a+group+of+800+or+more+is+needed+before+you+can+be+really+con%ef%ac%81dent+that+someone+will+have+the+same+birthday+as+you.+For+a+group+of+size+150+(the+size+of+the+lectures)%2c+the+probability+of+a+match+is+about+1%2f3.+This+problem+illustrates+quite+nicely+the+subtlety+of+probability+questions%2c+the+need+to+de%ef%ac%81ne+precisely+the+events+you+are+interested+in%2c+and+the+fact+that+some+probability+questions+have+counter-intuitive+answers.%0d%0a%0d%0aCombinations%0d%0aWe+now+have+a+way+of+counting+permutations%2c+but+often+when+selecting+objects%2c+all+that+matters+is+which+objects+were+selected%2c+not+the+order+in+which+they+were+selected.+Suppose+that+we+have+a+collection+of+objects%2c+C+%3d+%7bc1%2c+.+.+.+%2c+cn%7d+and+that+we+wish+to+make+r+selections+from+this+list+of+objects%2c+without+replacement%2c+where+the+order+does+not+matter.+An+unordered+selection+such+as+this+is+referred+to+as+a+combination.+How+many+ways+can+this+be+done%3f+Notice+that+this+is+equivalent+to+asking+how+many+different+subsets+of+C+of+size+r+there+are.%0d%0a%0d%0a%0cFrom+the+multiplication+principle%2c+we+know+that+the+number+of+ordered+samples+must+be+the+number+of+unordered+samples%2c+multiplied+by+the+number+of+orderings+of+each+sample.+So%2c+the+number+of+unordered+samples+is+the+number+of+ordered+samples%2c+divided+by+the+number+of+orderings+of+each+sample.+That+is%2c+the+number+of+unordered+samples+is+number+of+ordered+samples+of+size+r+Pn+%3d+r+number+of+orderings+of+samples+of+size+r+Pr+r+n+Pr+%3d+r!+%3d+n!+r!(n+%e2%88%92+r)!%0d%0a%0d%0aAgain%2c+this+is+a+very+commonly+found+expression+in+combinatorics%2c+so+it+has+its+own+notation.+In+fact%2c+there+are+two+commonly+used+expressions+for+this+quantity%3a%0d%0an+Cr+%3d%0d%0a%0d%0an+n!+%3d+.+r+r!(n+%e2%88%92+r)!%0d%0a%0d%0aThese+numbers+are+known+as+the+binomial+coef%ef%ac%81cients.+We+will+use+the+n+notation+as+this+is+slightly+neater%2c+and+more+commonly+used.+They+can+r+be+found+as+the+(r+%2b+1)th+number+on+the+(n+%2b+1)th+row+of+Pascal%e2%80%99s+triangle%3a%0d%0a%0d%0a%0c1+1+1+1+1+1+1+.+.+.+Example+Returning+to+the+CD+with+12+tracks.+You+arrange+for+your+CD+player+to+play+5+tracks+at+random.+How+many+different+unordered+selections+of+5+tracks+are+there%2c+and+what+is+the+probability+that+the+5+tracks+played+are+your+5+favourite+tracks+(in+any+order)%3f+The+number+of+ways+of+choosing+5+tracks+from+12+is+just+12+%3d+792.+Since+5+only+one+of+these+will+correspond+to+your+favourite+%ef%ac%81ve%2c+the+probability+of+getting+your+favourite+%ef%ac%81ve+is+1%2f792+%e2%89%88+0.001.+Example+(National+Lottery)+6+5+15+4+10+20+.+.+.+3+6+10+15+2+3+4+5+6+1+1+1+1+1+1+.+.+.%0d%0a%0d%0a%0cWhat+is+the+probability+of+winning+exactly+%2410+on+the+National+Lottery%3f+In+the+UK+National+Lottery%2c+there+are+49+numbered+balls%2c+and+six+of+these+are+selected+at+random.+A+seventh+ball+is+also+selected%2c+but+this+is+only+relevant+if+you+get+exactly+%ef%ac%81ve+numbers+correct.+The+player+selects+six+numbers+before+the+draw+is+made%2c+and+after+the+draw%2c+counts+how+many+numbers+are+in+common+with+those+drawn.+If+the+player+has+selected+exactly+three+of+the+balls+drawn%2c+then+the+player+wins+%2410.+The+order+the+balls+are+drawn+in+is+irrelevant.+We+are+interested+in+the+probability+that+exactly+3+of+the+6+numbers+we+select+are+drawn.+First+we+need+to+count+the+number+of+possible+draws+(the+number+of+different+sets+of+6+numbers)%2c+and+then+how+many+of+those+draws+correspond+to+getting+exactly+three+numbers+correct.+The+number+of+possible+draws+is+the+number+of+ways+of+choosing+6+objects+from+49.+This+is+49+%3d+13%2c+983%2c+816.+6+The+number+of+drawings+corresponding+to+getting+exactly+three+right+is+calculated+as+follows.+Regard+the+six+numbers+you+have+chosen+as+your+%e2%80%9cgood%e2%80%9d+numbers.+Then+of+the+49+balls+to+be+drawn+from%2c+6+correspond+to+your%0d%0a%0d%0a%0c%e2%80%9cgood%e2%80%9d+numbers%2c+and+43+correspond+to+your+%e2%80%9cbad%e2%80%9d+numbers.+We+want+to+know+how+many+ways+there+are+of+selecting+3+%e2%80%9cgood%e2%80%9d+numbers+and+3+%e2%80%9cbad%e2%80%9d+numbers.+By+the+multiplication+principle%2c+this+is+the+number+of+ways+of+choosing+3+from+6%2c+multiplied+by+the+number+of+ways+of+choosing+3+from+43.+That+is%2c+there+are+6+3+43+%3d+246%2c+820+3%0d%0a%0d%0aways+of+choosing+exactly+3+%e2%80%9cgood%e2%80%9d+numbers.+So%2c+the+probability+of+getting+exactly+3+numbers%2c+and+winning+%2410+is+6+3+43+3+49+6+1+.+57%0d%0a%0d%0a%e2%89%88+0.0177+%e2%89%88%0d%0a%0d%0aConditional+probability+and+the+multiplication+rule%0d%0aConditional+probability%0d%0a%0d%0a%0cWe+now+have+a+way+of+understanding+the+probabilities+of+events%2c+but+so+far+we+have+no+way+of+modifying+those+probabilities+when+certain+events+occur.+For+this%2c+we+need+an+extra+axiom+which+can+be+justi%ef%ac%81ed+under+any+of+the+interpretations+of+probability.+The+axiom+de%ef%ac%81nes+the+conditional+probability+of+A+given+B%2c+written+P(A%7cB)+as+P(A%7cB)+%3d+P(A+%e2%88%a9+B)+%2c+P(B)+for+P(B)+%3e+0.%0d%0a%0d%0aNote+that+we+can+only+condition+on+events+with+positive+probability.+Under+the+classical+interpretation+of+probability%2c+we+can+see+that+if+we+are+told+that+B+has+occurred%2c+then+all+outcomes+in+B+are+equally+likely%2c+and+all+outcomes+not+in+B+have+zero+probability+%e2%80%94+so+B+is+the+new+sample+space.+The+number+of+ways+that+A+can+occur+is+now+just+the+number+of+ways+A+%e2%88%a9+B+can+occur%2c+and+these+are+all+equally+likely.+Consequently+we+have+P(A%7cB)+%3d+%23(A+%e2%88%a9+B)+%23(A+%e2%88%a9+B)%2f%23S+P(A+%e2%88%a9+B)+%3d+%3d+.+%23B+%23B%2f%23S+P(B)%0d%0a%0d%0aBecause+conditional+probabilities+really+just+correspond+to+a+new+probability+measure+de%ef%ac%81ned+on+a+smaller+sample+space%2c+they+obey+all+of+the+properties+of%0d%0a%0d%0a%0c%e2%80%9cordinary%e2%80%9d+probabilities.+For+example%2c+we+have+P(B%7cB)+%3d+1+%2f+P(0%7cB)+%3d+0+P(A+%e2%88%aaC%7cB)+%3d+P(A%7cB)+%2b+P(C%7cB)+%2c+and+so+on.+The+de%ef%ac%81nition+of+conditional+probability+simpli%ef%ac%81es+when+one+event+is+a+special+case+of+the+other.+If+A+%e2%8a%86+B%2c+then+A+%e2%88%a9+B+%3d+A+so+P(A%7cB)+%3d+Example+A+die+is+rolled+and+the+number+showing+recorded.+Given+that+the+number+rolled+was+even%2c+what+is+the+probability+that+it+was+a+six%3f+Let+E+denote+the+event+%e2%80%9ceven%e2%80%9d+and+F+denote+the+event+%e2%80%9ca+six%e2%80%9d.+Clearly+F+%e2%8a%86+E%2c+so+P(F)+1%2f6+1+P(F%7cE)+%3d+%3d+%3d+.+P(E)+1%2f2+3+P(A)+%2c+P(B)+for+A+%e2%8a%86+B.%0d%0a%0d%0a%2f+for+A+%e2%88%a9C+%3d+0%0d%0a%0d%0a%0cThe+multiplication+rule%0d%0aThe+formula+for+conditional+probability+is+useful+when+we+want+to+calculate+P(A%7cB)+from+P(A+%e2%88%a9+B)+and+P(B).+However%2c+more+commonly+we+want+to+know+P(A+%e2%88%a9+B)+and+we+know+P(A%7cB)+and+P(B).+A+simple+rearrangement+gives+us+the+multiplication+rule.+P(A+%e2%88%a9+B)+%3d+P(B)+%c3%97+P(A%7cB)+Example+Two+cards+are+dealt+from+a+deck+of+52+cards.+What+is+the+probability+that+they+are+both+Aces%3f+We+now+have+three+different+ways+of+computing+this+probability.+First%2c+let%e2%80%99s+use+conditional+probability.+Let+A1+be+the+event+%e2%80%9c%ef%ac%81rst+card+an+Ace%e2%80%9d+and+A2+be+the+event+%e2%80%9csecond+card+an+Ace%e2%80%9d.+P(A2%7cA1)+is+the+probability+of+a+second+Ace.%0d%0a%0d%0a%0cGiven+that+the+%ef%ac%81rst+card+has+been+drawn+and+was+an+Ace%2c+there+are+51+cards+left%2c+3+of+which+are+Aces%2c+so+P(A2%7cA1)+%3d+3%2f51.+So%2c+P(A1+%e2%88%a9+A2)+%3d+P(A1)+%c3%97+P(A2%7cA1)+4+3+%3d+%c3%97+52+51+1+%3d+.+221+Now+let%e2%80%99s+compute+it+by+counting+ordered+possibilities.+There+are+P52+ways+of+2+4+of+those+ways+correspond+to+choosing+2+choosing+2+cards+from+52%2c+and+P2+Aces+from+4%2c+so+12+1+%3d+.+P(A1+%e2%88%a9+A2)+%3d+52+%3d+2652+221+P2+Now+let%e2%80%99s+compute+it+by+counting+unordered+possibilities.+There+are+52+ways+2+4+of+choosing+2+cards+from+52%2c+and+2+of+those+ways+correspond+to+choosing+2+Aces+from+4%2c+so+4+2+52+2+1+6+%3d+.+%3d+1326+221+P4+2%0d%0a%0d%0aP(A1+%e2%88%a9+A2)+%3d%0d%0a%0d%0a%0cIf+possible%2c+you+should+always+try+and+calculate+probabilities+more+than+one+way+(as+it+is+very+easy+to+go+wrong!).+However%2c+for+counting+problems+where+the+order+doesn%e2%80%99t+matter%2c+counting+the+unordered+possibilities+using+combinations+will+often+be+the+only+reasonable+way%2c+and+for+problems+which+don%e2%80%99t+correspond+to+a+sampling+experiment%2c+using+conditional+probability+will+often+be+the+only+reasonable+way.+The+multiplication+rule+generalises+to+more+than+two+events.+For+example%2c+for+three+events+we+have+P(A1+%e2%88%a9+A2+%e2%88%a9+A3)+%3d+P(A1)+P(A2%7cA1)+P(A3%7cA1+%e2%88%a9+A2)+.%0d%0a%0d%0aIndependent+events%2c+partitions+and+Bayes+Theorem%0d%0aIndependence%0d%0aRecall+the+multiplication+rule+P(A+%e2%88%a9+B)+%3d+P(B)+P(A%7cB)+.%0d%0a%0d%0a%0cFor+some+events+A+and+B%2c+knowing+that+B+has+occurred+will+not+alter+the+probability+of+A%2c+so+that+P(A%7cB)+%3d+P(A).+When+this+is+so%2c+the+multiplication+rule+becomes+P(A+%e2%88%a9+B)+%3d+P(A)+P(B)+%2c+and+the+events+A+and+B+are+said+to+be+independent+events.+Independence+is+a+very+important+concept+in+probability+theory%2c+and+is+used+a+lot+to+build+up+complex+events+from+simple+ones.+Do+not+confuse+the+independence+of+A+and+B+with+the+exclusivity+of+A+and+B+%e2%80%94+they+are+entirely+different+concepts.+If+A+and+B+both+have+positive+probability%2c+then+they+cannot+be+both+independent+and+exclusive+(exercise).+When+it+is+clear+that+the+occurrence+of+B+can+have+no+in%ef%ac%82uence+on+A%2c+we+will+assume+independence+in+order+to+calculate+P(A+%e2%88%a9+B).+However%2c+if+we+can+calculate+P(A+%e2%88%a9+B)+directly%2c+we+can+check+the+independence+of+A+and+B+by+seeing+if+it+is+true+that+P(A+%e2%88%a9+B)+%3d+P(A)+P(B)+.+We+can+generalise+independence+to+collections+of+events+as+follows.+The+set+of+events+A+%3d%0d%0a%0d%0a%0c%7bA1%2c+A2%2c+.+.+.+%2c+An%7d+are+mutually+independent+events+if+for+any+subset%2c+B+%e2%8a%86+A%2c+B+%3d+%7bB1%2c+B2%2c+.+.+.+%2c+Br+%7d%2c+r+%e2%89%a4+n+we+have+P(B1+%e2%88%a9+%c2%b7+%c2%b7+%c2%b7+%e2%88%a9+Br+)+%3d+P(B1)+%c3%97+%c2%b7+%c2%b7+%c2%b7+%c3%97+P(Br+)+.+Note+that+mutual+independence+is+much+stronger+that+pair-wise+independence%2c+where+we+only+require+independence+of+subsets+of+size+2.+That+is%2c+pair-wise+independence+does+not+imply+mutual+independence.+Example+A+playing+card+is+drawn+from+a+pack.+Let+A+be+the+event+%e2%80%9can+Ace+is+drawn%e2%80%9d+and+let+C+be+the+event+%e2%80%9ca+Club+is+drawn%e2%80%9d.+Are+the+events+A+and+C+exclusive%3f+Are+they+independent%3f+A+and+C+are+clearly+not+exclusive%2c+since+they+can+both+happen+%e2%80%94+when+the+Ace+of+Clubs+is+drawn.+Indeed%2c+since+this+is+the+only+way+it+can+happen%2c+we%0d%0a%0d%0a%0cknow+that+P(A+%e2%88%a9C)+%3d+1%2f52.+We+also+know+that+P(A)+%3d+1%2f13+and+that+P(C)+%3d+1%2f4.+Now+since+P(A)+P(C)+%3d+1+1+%c3%97+13+4+1+%3d+52+%3d+P(A+%e2%88%a9C)%0d%0a%0d%0awe+know+that+A+and+C+are+independent.+Of+course%2c+this+is+intuitively+obvious+%e2%80%94+you+are+no+more+or+less+likely+to+think+you+have+an+Ace+if+someone+tells+you+that+you+have+a+Club.%0d%0a%0d%0aPartitions%0d%0aA+partition+of+a+sample+space+is+simply+the+decomposition+of+the+sample+space+into+a+collection+of+mutually+exclusive+events+with+positive+probability.+That+is%2c+%7bB1%2c+.+.+.+%2c+Bn%7d+form+a+partition+of+S+if%0d%0an%0d%0a%0d%0a%e2%80%a2+S+%3d+B1+%e2%88%aa+B2+%e2%88%aa+%c2%b7+%c2%b7+%c2%b7+%e2%88%aa+Bn+%3d%0d%0ai%3d1%0d%0a%0d%0aBi+%2c%0d%0a%0d%0a%0c%2f+%e2%80%a2+Bi+%e2%88%a9+B+j+%3d+0%2c+%e2%88%80i+%3d+j%2c%0d%0a%0d%0a%e2%80%a2+P(Bi)+%3e+0%2c+%e2%88%80i.%0d%0a%0d%0aExample+A+card+is+randomly+drawn+from+the+pack.+The+events+%7bC%2c+D%2c+H%2c+S%7d+(Club%2c+Diamond%2c+Heart%2c+Spade)+form+a+partition+of+the+sample+space%2c+since+one+and+only+one+will+occur%2c+and+all+can+occur.%0d%0a%0d%0aTheorem+of+total+probability%0d%0aSuppose+that+we+have+a+partition+%7bB1%2c+.+.+.+%2c+Bn%7d+of+a+sample+space%2c+S.+Suppose+further+that+we+have+an+event+A.+Then+A+can+be+written+as+the+disjoint+union+A+%3d+(A+%e2%88%a9+B1)+%e2%88%aa+%c2%b7+%c2%b7+%c2%b7+%e2%88%aa+(A+%e2%88%a9+Bn)%2c%0d%0a%0d%0a%0cand+so+the+probability+of+A+is+given+by+P(A)+%3d+P((A+%e2%88%a9+B1)+%e2%88%aa+%c2%b7+%c2%b7+%c2%b7+%e2%88%aa+(A+%e2%88%a9+Bn))+%3d+P(A+%e2%88%a9+B1)+%2b+%c2%b7+%c2%b7+%c2%b7+%2b+P(A+%e2%88%a9+Bn)+%2c+by+Axiom+III+by+the+multiplication+rule+%3d+P(A%7cB1)+P(B1)+%2b+%c2%b7+%c2%b7+%c2%b7+%2b+P(A%7cBn)+P(Bn)+%2c+%3d%0d%0ai%3d1%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0an%0d%0a%0d%0aP(A%7cBi)+P(Bi)+.%0d%0a%0d%0aExample+(%e2%80%9cCraps%e2%80%9d)+Craps+is+a+game+played+with+a+pair+of+dice.+A+player+plays+against+a+banker.+The+player+throws+the+dice+and+notes+the+sum.%0d%0a%0d%0a%e2%80%a2+If+the+sum+is+7+or+11%2c+the+player+wins%2c+and+the+game+ends+(a+natural).%0d%0a%0d%0a%e2%80%a2+If+the+sum+is+2%2c+3+or+12%2c+the+player+looses+and+the+game+ends+(a+crap).%0d%0a%0d%0a%0c%e2%80%a2+If+the+sum+is+anything+else%2c+the+sum+is+called+the+players+point%2c+and+the+player+keeps+throwing+the+dice+until+his+sum+is+7%2c+in+which+case+he+looses%2c+or+he+throws+his+point+again%2c+in+which+case+he+wins.%0d%0a%0d%0aWhat+is+the+probability+that+the+player+wins%3f%0d%0a%0d%0aBayes+Theorem%0d%0aFrom+the+multiplication+rule%2c+we+know+that+P(A+%e2%88%a9+B)+%3d+P(B)+P(A%7cB)+and+that+P(A+%e2%88%a9+B)+%3d+P(A)+P(B%7cA)+%2c+so+clearly+P(B)+P(A%7cB)+%3d+P(A)+P(B%7cA)+%2c%0d%0a%0d%0a%0cand+so+P(A%7cB)+%3d+P(B%7cA)+P(A)+.+P(B)%0d%0a%0d%0aThis+is+known+as+Bayes+Theorem%2c+and+is+a+very+important+result+in+probability%2c+as+it+tells+us+how+to+%e2%80%9cturn+conditional+probabilities+around%e2%80%9d+%e2%80%94+that+is%2c+it+tells+us+how+to+work+out+P(A%7cB)+from+P(B%7cA)%2c+and+this+is+often+very+useful.+Example+A+clinic+offers+you+a+free+test+for+a+very+rare%2c+but+hideous+disease.+The+test+they+offer+is+very+reliable.+If+you+have+the+disease+it+has+a+98%25+chance+of+giving+a+positive+result%2c+and+if+you+don%e2%80%99t+have+the+disease%2c+it+has+only+a+1%25+chance+of+giving+a+positive+result.+You+decide+to+take+the+test%2c+and+%ef%ac%81nd+that+you+test+positive+%e2%80%94+what+is+the+probability+that+you+have+the+disease%3f+Let+P+be+the+event+%e2%80%9ctest+positive%e2%80%9d+and+D+be+the+event+%e2%80%9cyou+have+the+disease%e2%80%9d.+We+know+that+P(P%7cD)+%3d+0.98+and+that+P(P%7cDc)+%3d+0.01.%0d%0a%0d%0a%0cWe+want+to+know+P(D%7cP)%2c+so+we+use+Bayes%e2%80%99+Theorem.+P(P%7cD)+P(D)+P(D%7cP)+%3d+P(P)+P(P%7cD)+P(D)+%3d+P(P%7cD)+P(D)+%2b+P(P%7cDc)+P(Dc)+0.98+P(D)+%3d+.+0.98+P(D)+%2b+0.01(1+%e2%88%92+P(D))%0d%0a%0d%0a(using+the+theorem+of+total+probability)%0d%0a%0d%0aSo+we+see+that+the+probability+you+have+the+disease+given+the+test+result+depends+on+the+probability+that+you+had+the+disease+in+the+%ef%ac%81rst+place.+This+is+a+rare+disease%2c+affecting+only+one+in+ten+thousand+people%2c+so+that+P(D)+%3d+0.0001.+Substituting+this+in+gives+0.98+%c3%97+0.0001+0.01.+0.98+%c3%97+0.0001+%2b+0.01+%c3%97+0.9999+So%2c+your+probability+of+having+the+disease+has+increased+from+1+in+10%2c000+to+1+in+100%2c+but+still+isn%e2%80%99t+that+much+to+get+worried+about!+Note+the+crucial+difference+between+P(P%7cD)+and+P(D%7cP).+P(D%7cP)+%3d%0d%0a%0d%0aBayes+Theorem+for+partitions%0d%0a%0d%0a%0cAnother+important+thing+to+notice+about+the+above+example+is+the+use+of+the+theorem+of+total+probability+in+order+to+expand+the+bottom+line+of+Bayes+Theorem.+In+fact%2c+this+is+done+so+often+that+Bayes+Theorem+is+often+stated+in+this+form.+Suppose+that+we+have+a+partition+%7bB1%2c+.+.+.+%2c+Bn%7d+of+a+sample+space+S.+Suppose+further+that+we+have+an+event+A%2c+with+P(A)+%3e+0.+Then%2c+for+each+B+j+%2c+the+probability+of+B+j+given+A+is+P+B+j+%7cA+%3d+P+A%7cB+j+P+B+j+P(A)+P+A%7cB+j+P+B+j+%3d+P(A%7cB1)+P(B1)+%2b+%c2%b7+%c2%b7+%c2%b7+%2b+P(A%7cBn)+P(Bn)+P+A%7cB+j+P+B+j+P(A%7cBi)+P(Bi)%0d%0a%0d%0a%3d+n%0d%0a%0d%0ai%3d1%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0a.%0d%0a%0d%0aIn+particular%2c+if+the+partition+is+simply+%7bB%2c+Bc%7d%2c+then+this+simpli%ef%ac%81es+to+P(B%7cA)+%3d+P(A%7cB)+P(B)+c+)+P(Bc+)+.+P(A%7cB)+P(B)+%2b+P(A%7cB%0d%0a%0d%0a%0cDiscrete+Probability+Models%0d%0aIntroduction%2c+mass+functions+and+distribution+functions%0d%0aIntroduction%0d%0aWe+now+have+a+good+understanding+of+basic+probabilistic+reasoning.+We+have+seen+how+to+relate+events+to+sets%2c+and+how+to+calculate+probabilities+for+events+by+working+with+the+sets+that+represent+them.+So+far%2c+however%2c+we+haven%e2%80%99t+developed+any+special+techniques+for+thinking+about+random+quantities.+Discrete+probability+models+provide+a+framework+for+thinking+about+discrete+random+quantities%2c+and+continuous+probability+models+(to+be+considered+in+the+next+chapter)+form+a+framework+for+thinking+about+continuous+random+quantities.+Example+Consider+the+sample+space+for+tossing+a+fair+coin+twice%3a+S+%3d+%7bHH%2c+HT%2c+T+H%2c+T+T+%7d.%0d%0a%0d%0a%0cThese+outcomes+are+equally+likely.+There+are+several+random+quantities+we+could+associate+with+this+experiment.+For+example%2c+we+could+count+the+number+of+heads%2c+or+the+number+of+tails.+Formally%2c+a+random+quantity+is+a+real+valued+function+which+acts+on+elements+of+the+sample+space+(outcomes).+That+is%2c+to+each+outcome%2c+the+random+variable+assigns+a+real+number.+Random+quantities+(sometimes+known+as+random+variables)+are+always+denoted+by+upper+case+letters.+In+our+example%2c+if+we+let+X+be+the+number+of+heads%2c+we+have+X(HH)+%3d+2%2c+X(HT+)+%3d+1%2c+X(T+H)+%3d+1%2c+X(T+T+)+%3d+0.+The+observed+value+of+a+random+quantity+is+the+number+corresponding+to+the+actual+outcome.+That+is%2c+if+the+outcome+of+an+experiment+is+s+%e2%88%88+S%2c+then+X(s)+%e2%88%88+I+is+the+observed+value.+This+observed+value+is+always+denoted+with+a+R+lower+case+letter+%e2%80%94+here+x.+Thus+X+%3d+x+means+that+the+observed+value+of+the%0d%0a%0d%0a%0crandom+quantity%2c+X+is+the+number+x.+The+set+of+possible+observed+values+for+X+is+SX+%3d+%7bX(s)%7cs+%e2%88%88+S%7d.+For+the+above+example+we+have+SX+%3d+%7b0%2c+1%2c+2%7d.+Clearly+here+the+values+are+not+all+equally+likely.+Example+Roll+one+die+and+call+the+random+number+which+is+uppermost+Y+.+The+sample+space+for+the+random+quantity+Y+is+SY+%3d+%7b1%2c+2%2c+3%2c+4%2c+5%2c+6%7d+and+these+outcomes+are+all+equally+likely.+Now+roll+two+dice+and+call+their+sum+Z.+The+sample+space+for+Z+is+SZ+%3d+%7b2%2c+3%2c+4%2c+5%2c+6%2c+7%2c+8%2c+9%2c+10%2c+11%2c+12%7d%0d%0a%0d%0a%0cand+these+outcomes+are+not+equally+likely.+However%2c+we+know+the+probabilities+of+the+events+corresponding+to+each+of+these+outcomes%2c+and+we+could+display+them+in+a+table+as+follows.%0d%0a%0d%0aOutcome+Probability%0d%0a%0d%0a2+1%2f36%0d%0a%0d%0a3+2%2f36%0d%0a%0d%0a4+3%2f36%0d%0a%0d%0a5+4%2f36%0d%0a%0d%0a6+5%2f36%0d%0a%0d%0a7+6%2f36%0d%0a%0d%0a8+5%2f36%0d%0a%0d%0a9+4%2f36%0d%0a%0d%0a10+3%2f36%0d%0a%0d%0a11+2%2f36%0d%0a%0d%0a12+1%2f36%0d%0a%0d%0aThis+is+essentially+a+tabulation+of+the+probability+mass+function+for+the+random+quantity+Z.%0d%0a%0d%0aProbability+mass+functions+(PMFs)%0d%0aFor+any+discrete+random+variable+X%2c+we+de%ef%ac%81ne+the+probability+mass+function+(PMF)+to+be+the+function+which+gives+the+probability+of+each+x+%e2%88%88+SX+.+Clearly+we+have+P(X+%3d+x)+%3d%0d%0a%7bs%e2%88%88S%7cX(s)%3dx%7d%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0aP(%7bs%7d)+.%0d%0a%0d%0aThat+is%2c+the+probability+of+getting+a+particular+number+is+the+sum+of+the+probabilities+of+all+those+outcomes+which+have+that+number+associated+with%0d%0a%0d%0a%0cthem.+Also+P(X+%3d+x)+%e2%89%a5+0+for+each+x+%e2%88%88+SX+%2c+and+P(X+%3d+x)+%3d+0+otherwise.+The+set+of+all+pairs+%7b(x%2c+P(X+%3d+x))%7cx+%e2%88%88+SX+%7d+is+known+as+the+probability+distribution+of+X.+Example+For+the+example+above+concerning+the+sum+of+two+dice%2c+the+probability+distribution+is+%7b(2%2c+1%2f36)%2c+(3%2c+2%2f36)%2c+(4%2c+3%2f36)%2c+(5%2c+4%2f36)%2c+(6%2c+5%2f36)%2c+(7%2c+6%2f36)%2c+(8%2c+5%2f36)%2c+(9%2c+4%2f36)%2c+(10%2c+3%2f36)%2c+(11%2c+2%2f36)%2c+(12%2c+1%2f36)%7d+and+the+probability+mass+function+can+be+tabulated+as%0d%0a%0d%0ax+P(X+%3d+x)%0d%0a%0d%0a2+1%2f36%0d%0a%0d%0a3+2%2f36%0d%0a%0d%0a4+3%2f36%0d%0a%0d%0a5+4%2f36%0d%0a%0d%0a6+5%2f36%0d%0a%0d%0a7+6%2f36%0d%0a%0d%0a8+5%2f36%0d%0a%0d%0a9+4%2f36%0d%0a%0d%0a10+3%2f36%0d%0a%0d%0a11+2%2f36%0d%0a%0d%0a12+1%2f36%0d%0a%0d%0aand+plotted+graphically+as+follows.%0d%0a%0d%0a%0cProbability+Mass+Function%0d%0a0.15+Probability+0.00+2+0.05+0.10%0d%0a%0d%0a3%0d%0a%0d%0a4%0d%0a%0d%0a5%0d%0a%0d%0a6%0d%0a%0d%0a7+Value%0d%0a%0d%0a8%0d%0a%0d%0a9%0d%0a%0d%0a10%0d%0a%0d%0a11%0d%0a%0d%0a12%0d%0a%0d%0aCumulative+distribution+functions+(CDFs)%0d%0aFor+any+discrete+random+quantity%2c+X%2c+we+clearly+have%0d%0ax%e2%88%88SX%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0aP(X+%3d+x)+%3d+1%0d%0a%0d%0aas+every+outcome+has+some+number+associated+with+it.+It+can+often+be+useful+to+know+the+probability+that+your+random+number+is+no+greater+than+some+particular+value.+With+that+in+mind%2c+we+de%ef%ac%81ne+the+cumulative+distribution+function%2c+FX+(x)+%3d+P(X+%e2%89%a4+x)+%3d%0d%0a%7by%e2%88%88SX+%7cy%e2%89%a4x%7d%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0aP(X+%3d+y)+.%0d%0a%0d%0a%0cExample+For+the+sum+of+two+dice%2c+the+CDF+can+be+tabulated+for+the+outcomes+as%0d%0a%0d%0ax+FX+(x)%0d%0a%0d%0a2+1%2f36%0d%0a%0d%0a3+3%2f36%0d%0a%0d%0a4+6%2f36%0d%0a%0d%0a5+10%2f36%0d%0a%0d%0a6+15%2f36%0d%0a%0d%0a7+21%2f36%0d%0a%0d%0a8+26%2f36%0d%0a%0d%0a9+30%2f36%0d%0a%0d%0a10+33%2f36%0d%0a%0d%0a11+35%2f36%0d%0a%0d%0abut+it+is+important+to+note+that+the+CDF+is+de%ef%ac%81ned+for+all+real+numbers+%e2%80%94+not+just+the+possible+values.+In+our+example+we+have+FX+(%e2%88%923)+%3d+P(X+%e2%89%a4+%e2%88%923)+%3d+0%2c+FX+(4.5)+%3d+P(X+%e2%89%a4+4.5)+%3d+P(X+%e2%89%a4+4)+%3d+6%2f36%2c+FX+(25)+%3d+P(X+%e2%89%a4+25)+%3d+1.+We+may+plot+the+CDF+for+our+example+as+follows.%0d%0a%0d%0a%0cCumulative+Distribution+Function%0d%0a1.0+Cumulative+probability+0.0+0+0.2+0.4+0.6+0.8%0d%0a%0d%0a2%0d%0a%0d%0a4%0d%0a%0d%0a6+Value%0d%0a%0d%0a8%0d%0a%0d%0a10%0d%0a%0d%0a12%0d%0a%0d%0a14%0d%0a%0d%0aIt+is+clear+that+for+any+random+variable+X%2c+for+all+x+%e2%88%88+I+%2c+FX+(x)+%e2%88%88+%5b0%2c+1%5d+and+that+R+FX+(x)+%e2%86%92+0+as+x+%e2%86%92+%e2%88%92%e2%88%9e+and+FX+(x)+%e2%86%92+1+as+x+%e2%86%92+%2b%e2%88%9e.%0d%0a%0d%0aExpectation+and+variance+for+discrete+random+quantities%0d%0aExpectation%0d%0aJust+as+it+is+useful+to+summarise+data+(Chapter+1)%2c+it+is+just+as+useful+to+be+able+to+summarise+the+distribution+of+random+quantities.+The+location%0d%0a%0d%0a%0cmeasure+used+to+summarise+random+quantities+is+known+as+the+expectation+of+the+random+quantity.+It+is+the+%e2%80%9ccentre+of+mass%e2%80%9d+of+the+probability+distribution.+The+expectation+of+a+discrete+random+quantity+X%2c+written+E(X)+is+de%ef%ac%81ned+by+E(X)+%3d%0d%0ax%e2%88%88SX%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0ax+P(X+%3d+x)+.%0d%0a%0d%0aThe+expectation+is+often+denoted+by+%c2%b5X+or+even+just+%c2%b5.+Note+that+the+expectation+is+a+known+function+of+the+probability+distribution.+It+is+not+a+random+quantity%2c+and+in+particular%2c+it+is+not+the+sample+mean+of+a+set+of+data+(random+or+otherwise).+In+fact%2c+there+is+a+relationship+between+the+sample+mean+of+a+set+of+data+and+the+expectation+of+the+underlying+probability+distribution+generating+the+data%2c+but+this+is+to+be+made+precise+in+Semester+2.+Example+For+the+sum+of+two+dice%2c+X%2c+we+have+1+2+3+1+%2b+3+%c3%97+%2b+4+%c3%97+%2b+%c2%b7+%c2%b7+%c2%b7+%2b+12+%c3%97+%3d+7.+36+36+36+36+By+looking+at+the+symmetry+of+the+mass+function%2c+it+is+clear+that+in+some+sense+7+is+the+%e2%80%9ccentral%e2%80%9d+value+of+the+probability+distribution.+E(X)+%3d+2+%c3%97%0d%0a%0d%0a%0cVariance%0d%0aWe+now+have+a+method+for+summarising+the+location+of+a+given+probability+distribution%2c+but+we+also+need+a+summary+for+the+spread.+For+a+discrete+random+quantity+X%2c+the+variance+of+X+is+de%ef%ac%81ned+by+Var+(X)+%3d%0d%0ax%e2%88%88SX%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0a(x+%e2%88%92+E(X))2+P(X+%3d+x)+.%0d%0a%0d%0aThe+variance+is+often+denoted+%cf%832+%2c+or+even+just+%cf%832.+Again%2c+this+is+a+known+X+function+of+the+probability+distribution.+It+is+not+random%2c+and+it+is+not+the+sample+variance+of+a+set+of+data.+Again%2c+the+two+are+related+in+a+way+to+be+made+precise+later.+The+variance+can+be+re-written+as+Var+(X)+%3d%0d%0axi+%e2%88%88SX%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0a2+xi+P(X+%3d+xi)+%e2%88%92+%5b+E(X)%5d2%2c%0d%0a%0d%0aand+this+expression+is+usually+a+bit+easier+to+work+with.+We+also+de%ef%ac%81ne+the+standard+deviation+of+a+random+quantity+by+SD(X)+%3d+Var+(X)%2c%0d%0a%0d%0aand+this+is+usually+denoted+by+%cf%83X+or+just+%cf%83.%0d%0a%0d%0a%0cExample+For+the+sum+of+two+dice%2c+X%2c+we+have%0d%0a%0d%0axi+%e2%88%88SX%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0a2+3+1+329+1+2+xi+P(X+%3d+xi)+%3d+22+%c3%97+%2b+32+%c3%97+%2b+42+%c3%97+%2b+%c2%b7+%c2%b7+%c2%b7+%2b+122+%c3%97+%3d+36+36+36+36+6%0d%0a%0d%0aand+so+329+2+%3d+35+%2c+%e2%88%927+Var+(X)+%3d+6+6+and+SD(X)+%3d+35+.+6%0d%0a%0d%0aProperties+of+expectation+and+variance%0d%0aOne+of+the+reasons+that+expectation+is+widely+used+as+a+measure+of+location+for+probability+distributions+is+the+fact+that+it+has+many+desirable+mathematical+properties+which+make+it+elegant+and+convenient+to+work+with.+Indeed%2c+many%0d%0a%0d%0a%0cof+the+nice+properties+of+expectation+lead+to+corresponding+nice+properties+for+variance%2c+which+is+one+of+the+reasons+why+variance+is+widely+used+as+a+measure+of+spread.%0d%0a%0d%0aExpectation+of+a+function+of+a+random+quantity%0d%0aSuppose+that+X+is+a+discrete+random+quantity%2c+and+that+Y+is+another+random+quantity+that+is+a+known+function+of+X.+That+is%2c+Y+%3d+g(X)+for+some+function+g(%c2%b7).+What+is+the+expectation+of+Y+%3f+Example+Throw+a+die%2c+and+let+X+be+the+number+showing.+We+have+SX+%3d+%7b1%2c+2%2c+3%2c+4%2c+5%2c+6%7d+and+each+value+is+equally+likely.+Now+suppose+that+we+are+actually+interested+in+the+square+of+the+number+showing.+De%ef%ac%81ne+a+new+random+quantity+Y+%3d+X+2.+Then+SY+%3d+%7b1%2c+4%2c+9%2c+16%2c+25%2c+36%7d%0d%0a%0d%0a%0cand+clearly+each+of+these+values+is+equally+likely.+We+therefore+have+1+1+91+1+E(Y+)+%3d+1+%c3%97+%2b+4+%c3%97+%2b+%c2%b7+%c2%b7+%c2%b7+%2b+36+%c3%97+%3d+.+6+6+6+6+The+above+example+illustrates+the+more+general+result%2c+that+for+Y+%3d+g(X)%2c+we+have+E(Y+)+%3d%0d%0ax%e2%88%88SX%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0ag(x)+P(X+%3d+x)+.%0d%0a%0d%0aNote+that+in+general+E(g(X))+%3d+g(+E(X)).+For+the+above+example%2c+E+X+2+%3d+91%2f6+15.2%2c+and+E(X)2+%3d+3.52+%3d+12.25.+We+can+use+this+more+general+notion+of+expectation+in+order+to+rede%ef%ac%81ne+variance+purely+in+terms+of+expectation+as+follows%3a+Var+(X)+%3d+E+%5bX+%e2%88%92+E(X)%5d2+%3d+E+X+2+%e2%88%92+E(X)2+.+Having+said+that+E(g(X))+%3d+g(+E(X))+in+general%2c+it+does+in+fact+hold+in+the+(very)+special%2c+but+important+case+where+g(%c2%b7)+is+a+linear+function.%0d%0a%0d%0aExpectation+of+a+linear+transformation%0d%0a%0d%0a%0cIf+we+have+a+random+quantity+X%2c+and+a+linear+transformation%2c+Y+%3d+aX+%2b+b%2c+where+a+and+b+are+known+real+constants%2c+then+we+have+that+E(aX+%2b+b)+%3d+a+E(X)+%2b+b.+We+can+show+this+as+follows%3a+E(aX+%2b+b)+%3d+%3d%0d%0ax%e2%88%88SX+x%e2%88%88SX%0d%0a%0d%0a%e2%88%91+(ax+%2b+b)+P(X+%3d+x)%0d%0aax+P(X+%3d+x)+%2b%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0a%3da%0d%0a%0d%0ax%e2%88%88SX%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0ax%e2%88%88SX%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0ab+P(X+%3d+x)+P(X+%3d+x)%0d%0a%0d%0ax+P(X+%3d+x)+%2b+b%0d%0a%0d%0ax%e2%88%88SX%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0a%3d+a+E(X)+%2b+b.%0d%0a%0d%0aExpectation+of+the+sum+of+two+random+quantities%0d%0aFor+two+random+quantities+X+and+Y+%2c+the+expectation+of+their+sum+is+given+by+E(X+%2bY+)+%3d+E(X)+%2b+E(Y+)+.%0d%0a%0d%0a%0cNote+that+this+result+is+true+irrespective+of+whether+or+not+X+and+Y+are+independent.+Let+us+see+why.+First%2c+SX%2bY+%3d+%7bx+%2b+y%7c(x+%e2%88%88+SX+)+%e2%88%a9+(y+%e2%88%88+SY+)%7d%2c%0d%0a%0d%0a%0cand+so+E(X+%2bY+)+%3d+%3d+%3d%0d%0a%0d%0a(x%2by)%e2%88%88SX%2bY+x%e2%88%88SX+y%e2%88%88SY+x%e2%88%88SX+y%e2%88%88SY%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0a(x+%2b+y)+P((X+%3d+x)+%e2%88%a9+(Y+%3d+y))%0d%0a%0d%0a%e2%88%91+%e2%88%91+(x+%2b+y)+P((X+%3d+x)+%e2%88%a9+(Y+%3d+y))%0d%0ax+P((X+%3d+x)+%e2%88%a9+(Y+%3d+y))+y+P((X+%3d+x)+%e2%88%a9+(Y+%3d+y))%0d%0a%0d%0a%e2%88%91+%e2%88%91%0d%0a%2b%0d%0a%0d%0a%3d%0d%0a%0d%0ax%e2%88%88SX+y%e2%88%88SY%0d%0a%0d%0a%e2%88%91+%e2%88%91%0d%0a%2b%0d%0a%0d%0ax%e2%88%88SX+y%e2%88%88SY%0d%0a%0d%0a%e2%88%91+%e2%88%91%0d%0a%0d%0ax+P(X+%3d+x)+P(Y+%3d+y%7cX+%3d+x)+y+P(Y+%3d+y)+P(X+%3d+x%7cY+%3d+y)%0d%0a%0d%0a%3d%0d%0a%0d%0ax%e2%88%88SX%0d%0a%0d%0a%e2%88%91+%e2%88%91%0d%0a%0d%0ay%e2%88%88SY+x%e2%88%88SX%0d%0a%0d%0a%e2%88%91+%e2%88%91+%e2%88%91%0d%0a%0d%0ax+P(X+%3d+x)%0d%0a%0d%0ay%e2%88%88SY%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0aP(Y+%3d+y%7cX+%3d+x)%0d%0a%0d%0a%2b+%3d%0d%0a%0d%0ay+P(Y+%3d+y)%0d%0a%0d%0ay%e2%88%88SY%0d%0a%0d%0ax+P(X+%3d+x)+%2b%0d%0a%0d%0ax%e2%88%88SX%0d%0a%0d%0ay%e2%88%88SY%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0ax%e2%88%88SX%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0aP(X+%3d+x%7cY+%3d+y)%0d%0a%0d%0ay+P(Y+%3d+y)%0d%0a%0d%0a%3d+E(X)+%2b+E(Y+)+.%0d%0a%0d%0a%0cExpectation+of+an+independent+product%0d%0aIf+X+and+Y+are+independent+random+quantities%2c+then+E(XY+)+%3d+E(X)+E(Y+)+.+To+see+why%2c+note+that+SXY+%3d+%7bxy%7c(x+%e2%88%88+SX+)+%e2%88%a9+(y+%e2%88%88+SY+)%7d%2c+and+so+E(XY+)+%3d+%3d+%3d%0d%0axy%e2%88%88SXY%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0axy+P((X+%3d+x)+%e2%88%a9+(Y+%3d+y))+xy+P(X+%3d+x)+P(Y+%3d+y)%0d%0a%0d%0ax%e2%88%88SX+y%e2%88%88SY+x%e2%88%88SX%0d%0a%0d%0a%e2%88%91+%e2%88%91+%e2%88%91%0d%0a%0d%0ax+P(X+%3d+x)%0d%0a%0d%0ay%e2%88%88SY%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0ay+P(Y+%3d+y)%0d%0a%0d%0a%3d+E(X)+E(Y+)+Note+that+here+it+is+vital+that+X+and+Y+are+independent%2c+or+the+result+does+not+hold.%0d%0a%0d%0aVariance+of+an+independent+sum%0d%0a%0d%0a%0cIf+X+and+Y+are+independent+random+quantities%2c+then+Var+(X+%2bY+)+%3d+Var+(X)+%2b+Var+(Y+)+.+To+see+this%2c+write+Var+(X+%2bY+)+%3d+E+%5bX+%2bY+%5d2+%e2%88%92+%5b+E(X+%2bY+)%5d2+%3d+E+X+2+%2b+2XY+%2bY+2+%e2%88%92+%5b+E(X)+%2b+E(Y+)%5d2+%3d+E+X+2+%2b+2+E(XY+)+%2b+E+Y+2+%e2%88%92+E(X)2+%e2%88%92+2+E(X)+E(Y+)+%e2%88%92+E(Y+)2+%3d+E+X+2+%2b+2+E(X)+E(Y+)+%2b+E+Y+2+%e2%88%92+E(X)2+%e2%88%92+2+E(X)+E(Y+)+%e2%88%92+E(Y+)2+%3d+E+X+2+%e2%88%92+E(X)2+%2b+E+Y+2+%e2%88%92+E(Y+)2+%3d+Var+(X)+%2b+Var+(Y+)+Again%2c+it+is+vital+that+X+and+Y+are+independent%2c+or+the+result+does+not+hold.+Notice+that+this+implies+a+slightly+less+attractive+result+for+the+standard+deviation+of+the+sum+of+two+independent+random+quantities%2c+SD(X+%2bY+)+%3d+SD(X)2+%2b+SD(Y+)2%2c%0d%0a%0d%0awhich+is+why+it+is+often+more+convenient+to+work+with+variances.%0d%0a%0d%0a%0cThe+binomial+distribution%0d%0aIntroduction%0d%0aNow+that+we+have+a+good+understanding+of+discrete+random+quantities+and+their+properties%2c+we+can+go+on+to+look+at+a+few+of+the+standard+families+of+discrete+random+variables.+One+of+the+most+commonly+encountered+discrete+distributions+is+the+binomial+distribution.+This+is+the+distribution+of+the+number+of+%e2%80%9csuccesses%e2%80%9d+in+a+series+of+independent+%e2%80%9csuccess%e2%80%9d%2f%e2%80%9cfail%e2%80%9d+trials.+Before+we+look+at+this%2c+we+need+to+make+sure+we+understand+the+case+of+a+single+trial.%0d%0a%0d%0aBernoulli+random+quantities%0d%0aSuppose+that+we+have+an+event+E+in+which+we+are+interested%2c+and+we+write+its+sample+space+as+S+%3d+%7bE%2c+E+c%7d.+We+can+associate+a+random+quantity+with+this+sample+space%2c+traditionally+denoted+I%2c+as+I(E)+%3d+1%2c+I(E+c)+%3d+0.+So%2c+if+P(E)+%3d+p%2c+we+have+SI+%3d+%7b0%2c+1%7d%2c%0d%0a%0d%0a%0cand+P(I+%3d+1)+%3d+p%2c+P(I+%3d+0)+%3d+1+%e2%88%92+p.+This+random+quantity%2c+I+is+known+as+an+indicator+variable%2c+and+is+often+useful+for+constructing+more+complex+random+quantities.+We+write+I+%e2%88%bc+Bern(p).+We+can+calculate+its+expectation+and+variance+as+follows.+E(I)+%3d+0+%c3%97+(1+%e2%88%92+p)+%2b+1+%c3%97+p+%3d+p+E+I+2+%3d+02+%c3%97+(1+%e2%88%92+p)+%2b+12+%c3%97+p+%3d+p+Var+(I)+%3d+E+I+2+%e2%88%92+E(I)2+%3d+p+%e2%88%92+p2+%3d+p(1+%e2%88%92+p)+With+these+results%2c+we+can+now+go+on+to+understand+the+binomial+distribution.%0d%0a%0d%0aThe+binomial+distribution%0d%0aThe+binomial+distribution+is+the+distribution+of+the+number+of+%e2%80%9csuccesses%e2%80%9d+in+a+series+of+n+independent+%e2%80%9ctrials%e2%80%9d%2c+each+of+which+results+in+a+%e2%80%9csuccess%e2%80%9d+(with%0d%0a%0d%0a%0cprobability+p)+or+a+%e2%80%9cfailure%e2%80%9d+(with+probability+1+%e2%88%92+p).+If+the+number+of+successes+is+X%2c+we+would+write+X+%e2%88%bc+B(n%2c+p)+to+indicate+that+X+is+a+binomial+random+quantity+based+on+n+independent+trials%2c+each+occurring+with+probability+p.+Examples%0d%0a%0d%0a1.+Toss+a+fair+coin+100+times+and+let+X+be+the+number+of+heads.+Then+X+%e2%88%bc+B(100%2c+0.5).+2.+A+certain+kind+of+lizard+lays+8+eggs%2c+each+of+which+will+hatch+independently+with+probability+0.7.+Let+Y+denote+the+number+of+eggs+which+hatch.+Then+Y+%e2%88%bc+B(8%2c+0.7).+Let+us+now+derive+the+probability+mass+function+for+X+%e2%88%bc+B(n%2c+p).+Clearly+X+can+take+on+any+value+from+0+up+to+n%2c+and+no+other.+Therefore%2c+we+simply+have+to%0d%0a%0d%0a%0ccalculate+P(X+%3d+k)+for+k+%3d+0%2c+1%2c+2%2c+.+.+.+%2c+n.+The+probability+of+k+successes+followed+by+n+%e2%88%92+k+failures+is+clearly+pk+(1+%e2%88%92+p)n%e2%88%92k+.+Indeed%2c+this+is+the+probability+of+any+particular+sequence+involving+k+successes.+There+are+n+such+sequences%2c+so+k+by+the+multiplication+principle%2c+we+have+n+k+p+(1+%e2%88%92+p)n%e2%88%92k+%2c+P(X+%3d+k)+%3d+k+Now%2c+using+the+binomial+theorem%2c+we+have+n+k+p+(1+%e2%88%92+p)n%e2%88%92k+%3d+(p+%2b+%5b1+%e2%88%92+p%5d)n+%3d+1n+%3d+1%2c+%e2%88%91+%e2%88%91+k+k%3d0+k%3d0+and+so+this+does+de%ef%ac%81ne+a+valid+probability+distribution.+P(X+%3d+k)+%3d+Examples+For+the+lizard+eggs%2c+Y+%e2%88%bc+B(8%2c+0.7)+we+have+P(Y+%3d+k)+%3d+8+0.7k+0.38%e2%88%92k+%2c+k+%3d+0%2c+1%2c+2%2c+.+.+.+%2c+8.+k%0d%0an+n%0d%0a%0d%0ak+%3d+0%2c+1%2c+2%2c+.+.+.+%2c+n.%0d%0a%0d%0aWe+can+therefore+tabulate+and+plot+the+probability+mass+function+and+cumulative+distribution+function+as+follows.%0d%0a%0d%0a%0ck+P(Y+%3d+k)+FY+(k)%0d%0a%0d%0a0+0.00+0.00%0d%0a%0d%0a1+0.00+0.00%0d%0a%0d%0a2+0.01+0.01%0d%0a%0d%0a3+0.05+0.06%0d%0a%0d%0a4+0.14+0.19%0d%0a%0d%0a5+0.25+0.45%0d%0a%0d%0a6+0.30+0.74%0d%0a%0d%0a7+0.20+0.94%0d%0a%0d%0a8+0.06+1.00%0d%0a%0d%0aProbability+Mass+Function%0d%0a1.0%0d%0a%0d%0aCumulative+Distribution+Function%0d%0a%0d%0a0.25%0d%0a%0d%0a0.20%0d%0a%0d%0aCumulative+probability+0+1+2+3+4+Value+5+6+7+8%0d%0a%0d%0aProbability%0d%0a%0d%0a0.15%0d%0a%0d%0a0.10%0d%0a%0d%0a0.00%0d%0a%0d%0a0.05%0d%0a%0d%0a0.0%0d%0a%0d%0a0.2%0d%0a%0d%0a0.4%0d%0a%0d%0a0.6%0d%0a%0d%0a0.8%0d%0a%0d%0a0%0d%0a%0d%0a2%0d%0a%0d%0a4+Value%0d%0a%0d%0a6%0d%0a%0d%0a8%0d%0a%0d%0aSimilarly%2c+the+PMF+and+CDF+for+X+%e2%88%bc+B(100%2c+0.5)+(number+of+heads+from+100+coin+tosses)+can+be+plotted+as+follows.%0d%0aProbability+Mass+Function%0d%0a1.0%0d%0a%0d%0aCumulative+Distribution+Function%0d%0a%0d%0a0.06%0d%0a%0d%0aCumulative+probability+0+5+10+16+22+28+34+40+46+52+58+64+70+76+82+88+94+Value%0d%0a%0d%0aProbability%0d%0a%0d%0a0.04%0d%0a%0d%0a0.02%0d%0a%0d%0a0.00%0d%0a%0d%0a0.0%0d%0a%0d%0a0.2%0d%0a%0d%0a0.4%0d%0a%0d%0a0.6%0d%0a%0d%0a0.8%0d%0a%0d%0a0%0d%0a%0d%0a20%0d%0a%0d%0a40+Value%0d%0a%0d%0a60%0d%0a%0d%0a80%0d%0a%0d%0a100%0d%0a%0d%0a%0cExpectation+and+variance+of+a+binomial+random+quantity%0d%0aIt+is+possible+(but+a+little+messy)+to+derive+the+expectation+and+variance+of+the+binomial+distribution+directly+from+the+PMF.+However%2c+we+can+deduce+them+rather+more+elegantly+if+we+recognise+the+relationship+between+the+binomial+and+Bernoulli+distributions.+If+X+%e2%88%bc+B(n%2c+p)+then+X%3d%0d%0a%0d%0aj%3d1%0d%0a%0d%0a%e2%88%91+Ij%0d%0a%0d%0an%0d%0a%0d%0awhere+I+j+%e2%88%bc+Bern(p)%2c+j+%3d+1%2c+2%2c+.+.+.+%2c+n%2c+and+the+I+j+are+mutually+independent.+So+we+then+have+E(X)+%3d+E+%3d+%3d%0d%0a%0d%0aj%3d1%0d%0a%0d%0a%e2%88%91+Ij%0d%0a(expectation+of+a+sum)%0d%0a%0d%0an%0d%0a%0d%0aj%3d1+n%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0an%0d%0a%0d%0aE+Ij%0d%0a%0d%0aj%3d1%0d%0a%0d%0a%e2%88%91p%0d%0a%0d%0a%3d+np%0d%0a%0d%0a%0cand+similarly%2c+Var+(X)+%3d+Var%0d%0an%0d%0a%0d%0aj%3d1%0d%0a%0d%0a%e2%88%91+Ij%0d%0aIj+(variance+of+independent+sum)%0d%0a%0d%0an%0d%0a%0d%0a%3d+%3d%0d%0a%0d%0aj%3d1+n+j%3d1%0d%0a%0d%0a%e2%88%91+Var%0d%0a%0d%0a%e2%88%91+p(1+%e2%88%92+p)%0d%0a%0d%0a%3d+np(1+%e2%88%92+p).+Examples+For+the+coin+tosses%2c+X+%e2%88%bc+B(100%2c+0.5)%2c+E(X)+%3d+np+%3d+100+%c3%97+0.5+%3d+50%2c+Var+(X)+%3d+np(1+%e2%88%92+p)+%3d+100+%c3%97+0.52+%3d+25%2c+and+so+SD(X)+%3d+5.%0d%0a%0d%0a%0cSimilarly%2c+for+the+lizard+eggs%2c+Y+%e2%88%bc+B(8%2c+0.7)%2c+E(Y+)+%3d+np+%3d+8+%c3%97+0.7+%3d+5.6%2c+Var+(Y+)+%3d+np(1+%e2%88%92+p)+%3d+8+%c3%97+0.7+%c3%97+0.3+%3d+1.68+and+so+SD(Y+)+%3d+1.30.%0d%0a%0d%0aThe+geometric+distribution%0d%0aPMF%0d%0aThe+geometric+distribution+is+the+distribution+of+the+number+of+independent+Bernoulli+trials+until+the+%ef%ac%81rst+success+is+encountered.+If+X+is+the+number+of+trials+until+a+success+is+encountered%2c+and+each+independent+trial+has+probability+p+of+being+a+success%2c+we+write+X+%e2%88%bc+Geom(p).+Clearly+X+can+take+on+any+positive+integer%2c+so+to+deduce+the+PMF%2c+we+need+to+calculate+P(X+%3d+k)+for+k+%3d+1%2c+2%2c+3%2c+.+.+.+.+In+order+to+have+X+%3d+k%2c+we+must+have+an%0d%0a%0d%0a%0cordered+sequence+of+k+%e2%88%92+1+failures+followed+by+one+success.+By+the+multiplication+rule+therefore%2c+P(X+%3d+k)+%3d+(1+%e2%88%92+p)k%e2%88%921+p%2c+k+%3d+1%2c+2%2c+3%2c+.+.+.+.%0d%0a%0d%0aCDF%0d%0aFor+the+geometric+distribution%2c+it+is+possible+to+calculate+an+analytic+form+for+the+CDF+as+follows.+If+X+%e2%88%bc+Geom(p)%2c+then+FX+(k)+%3d+P(X+%e2%89%a4+k)+%3d%0d%0aj%3d1+k%0d%0a%0d%0a%e2%88%91+(1+%e2%88%92+p)+j%e2%88%921+p%0d%0aj%3d1%0d%0a%0d%0ak%0d%0a%0d%0a%3dp%0d%0a%0d%0a%e2%88%91+(1+%e2%88%92+p)+j%e2%88%921%0d%0a(geometric+series)%0d%0a%0d%0a1+%e2%88%92+(1+%e2%88%92+p)k+%3d+p%c3%97+1+%e2%88%92+(1+%e2%88%92+p)+%3d+1+%e2%88%92+(1+%e2%88%92+p)k+.%0d%0a%0d%0a%0cConsequently+there+is+no+need+to+tabulate+the+CDF+of+the+geometric+distribution.+Also+note+that+the+CDF+tends+to+one+as+k+increases.+This+con%ef%ac%81rms+that+the+PMF+we+de%ef%ac%81ned+does+determine+a+valid+probability+distribution.+Example+Suppose+that+we+are+interested+in+playing+a+game+where+the+probability+of+winning+is+0.2+on+any+particular+turn.+If+X+is+the+number+of+turns+until+the+%ef%ac%81rst+win%2c+then+X+%e2%88%bc+Geom(0.2).+The+PMF+and+CDF+for+X+are+plotted+below.%0d%0a0.20%0d%0a%0d%0aProbability+Mass+Function%0d%0a1.0%0d%0a%0d%0aCumulative+Distribution+Function%0d%0a%0d%0a0.15%0d%0a%0d%0aCumulative+probability+1+4+7+10+13+16+19+22+25+28+Value+31+34+37+40+43+46+49%0d%0a%0d%0aProbability%0d%0a%0d%0a0.10%0d%0a%0d%0a0.05%0d%0a%0d%0a0.00%0d%0a%0d%0a0.0%0d%0a%0d%0a0.2%0d%0a%0d%0a0.4%0d%0a%0d%0a0.6%0d%0a%0d%0a0.8%0d%0a%0d%0a0%0d%0a%0d%0a10%0d%0a%0d%0a20+Value%0d%0a%0d%0a30%0d%0a%0d%0a40%0d%0a%0d%0a50%0d%0a%0d%0aUseful+series+in+probability%0d%0a%0d%0a%0cNotice+that+we+used+the+sum+of+a+geometric+series+in+the+derivation+of+the+CDF.+There+are+many+other+series+that+crop+up+in+the+study+of+probability.+A+few+of+the+more+commonly+encountered+series+are+listed+below.%0d%0a%0d%0ai%3d1+%e2%88%9e+i%3d1+%e2%88%9e%0d%0a%0d%0a%e2%88%91+%e2%88%91%0d%0a%0d%0an%0d%0a%0d%0an+i%e2%88%921+%3d+1+%e2%88%92+a+a%0d%0a%0d%0a1%e2%88%92a%0d%0a%0d%0a(a+%3e+0)+(0+%3c+a+%3c+1)+(0+%3c+a+%3c+1)+(0+%3c+a+%3c+1)%0d%0a%0d%0aai%e2%88%921+%3d%0d%0a%0d%0a1+1%e2%88%92a+1+(1+%e2%88%92+a)2+1%2ba+(1+%e2%88%92+a)3%0d%0a%0d%0ai%3d1%0d%0a%0d%0a%e2%88%91+i2ai%e2%88%921+%3d%0d%0an%0d%0a%0d%0ai%3d1+%e2%88%9e%0d%0a%0d%0a%e2%88%91+i+ai%e2%88%921+%3d%0d%0a%0d%0an(n+%2b+1)+%e2%88%91i%3d+2+i%3d1%0d%0ai%3d1%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0an%0d%0a%0d%0a2+%3d+1+n(n+%2b+1)(2n+%2b+1).+i%0d%0a%0d%0a6%0d%0a%0d%0aWe+will+use+two+of+these+in+the+derivation+of+the+expectation+and+variance+of+the+geometric+distribution.%0d%0a%0d%0aExpectation+and+variance+of+geometric+random+quantities%0d%0a%0d%0a%0cSuppose+that+X+%e2%88%bc+Geom(p).+Then+E(X)+%3d+%3d%0d%0a%0d%0ai%3d1+%e2%88%9e%0d%0a%0d%0a%e2%88%91+i+P(X+%3d+i)+%e2%88%91+i(1+%e2%88%92+p)i%e2%88%921+p%0d%0ai%3d1%0d%0a%0d%0a%e2%88%9e%0d%0a%0d%0a%3d+p+%e2%88%91+i(1+%e2%88%92+p)i%e2%88%921+%3d+p%c3%97+p+%3d+2+p+1+%3d+.+p+1+(1+%e2%88%92+%5b1+%e2%88%92+p%5d)2%0d%0a%0d%0ai%3d1+%e2%88%9e%0d%0a%0d%0a%0cSimilarly%2c+E+X2+%3d+%3d%0d%0a%0d%0ai%3d1+%e2%88%9e%0d%0a%0d%0a%e2%88%91+i2+P(X+%3d+i)+%e2%88%91+i2(1+%e2%88%92+p)i%e2%88%921+p%0d%0ai%3d1%0d%0a%0d%0a%e2%88%9e%0d%0a%0d%0a%3d+p+%e2%88%91+i2(1+%e2%88%92+p)i%e2%88%921+%3d+p%c3%97+1+%2b+%5b1+%e2%88%92+p%5d+(1+%e2%88%92+%5b1+%e2%88%92+p%5d)3+2%e2%88%92+p+%3d+p%c3%97+3+p+2%e2%88%92+p+%3d+2+%2c+p%0d%0a%0d%0ai%3d1+%e2%88%9e%0d%0a%0d%0a%0cand+so+Var+(X)+%3d+E+X+2+%e2%88%92+E(X)2+2%e2%88%92+p+1+%3d+2+%e2%88%92+2+p+p+1%e2%88%92+p+%3d+2+.+p+Example+For+X+%e2%88%bc+Geom(0.2)+we+have+1+1+E(X)+%3d+%3d+%3d5+p+0.2+1%e2%88%92+p+0.8+Var+(X)+%3d+2+%3d+%3d+20.+2+p+0.2%0d%0a%0d%0aThe+Poisson+distribution%0d%0aThe+Poisson+distribution+is+a+very+important+discrete+probability+distribution%2c+which+arises+in+many+different+contexts+in+probability+and+statistics.+Typically%2c%0d%0a%0d%0a%0cPoisson+random+quantities+are+used+in+place+of+binomial+random+quantities+in+situations+where+n+is+large%2c+p+is+small%2c+and+the+expectation+np+is+stable.+Example+Consider+the+number+of+calls+made+in+a+1+minute+interval+to+an+Internet+service+provider+(ISP).+The+ISP+has+thousands+of+subscribers%2c+but+each+one+will+call+with+a+very+small+probability.+The+ISP+knows+that+on+average+5+calls+will+be+made+in+the+interval.+The+actual+number+of+calls+will+be+a+Poisson+random+variable%2c+with+mean+5.+A+Poisson+random+variable%2c+X+with+parameter+%ce%bb+is+written+as+X+%e2%88%bc+P(%ce%bb)%0d%0a%0d%0aPoisson+as+the+limit+of+a+binomial%0d%0aLet+X+%e2%88%bc+B(n%2c+p).+Put+%ce%bb+%3d+E(X)+%3d+np+and+let+n+increase+and+p+decrease+so+that+%ce%bb+remains+constant.+P(X+%3d+k)+%3d+n+k+p+(1+%e2%88%92+p)n%e2%88%92k+%2c+k+k+%3d+0%2c+1%2c+2%2c+.+.+.+%2c+n.%0d%0a%0d%0a%0cReplacing+p+by+%ce%bb%2fn+gives+n+P(X+%3d+k)+%3d+k+%ce%bb+k+%ce%bb+n%e2%88%92k+1%e2%88%92+n+n%0d%0a%0d%0an!+%ce%bb+k+%ce%bb+n%e2%88%92k+%3d+1%e2%88%92+k!(n+%e2%88%92+k)!+n+n+%ce%bbk+n!+(1+%e2%88%92+%ce%bb%2fn)n+%3d+k!+(n+%e2%88%92+k)!nk+(1+%e2%88%92+%ce%bb%2fn)k+%ce%bbk+n+(n+%e2%88%92+1)+(n+%e2%88%92+2)+(n+%e2%88%92+k+%2b+1)+(1+%e2%88%92+%ce%bb%2fn)n+%c2%b7%c2%b7%c2%b7+%3d+k!+n+n+n+n+(1+%e2%88%92+%ce%bb%2fn)k+%ce%bbk+e%e2%88%92%ce%bb+%e2%86%92+%c3%971%c3%971%c3%971%c3%97%c2%b7%c2%b7%c2%b7%c3%971%c3%97+%2c+as+n+%e2%86%92+%e2%88%9e+k!+1+%ce%bbk+%e2%88%92%ce%bb+%3d+e+.+k!+To+see+the+limit%2c+note+that+(1+%e2%88%92+%ce%bb%2fn)n+%e2%86%92+e%e2%88%92%ce%bb+as+n+increases+(compound+interest+formula).%0d%0a%0d%0aPMF%0d%0a%0d%0a%0cIf+X+%e2%88%bc+P(%ce%bb)%2c+then+the+PMF+of+X+is+%ce%bbk+%e2%88%92%ce%bb+P(X+%3d+k)+%3d+e+%2c+k!+Example+The+PMF+and+CDF+of+X+%e2%88%bc+P(5)+are+given+below.%0d%0aProbability+Mass+Function%0d%0a1.0%0d%0a%0d%0ak+%3d+0%2c+1%2c+2%2c+3%2c+.+.+.+.%0d%0a%0d%0aCumulative+Distribution+Function%0d%0a%0d%0a0.15%0d%0a%0d%0aCumulative+probability+0+1+2+3+4+5+6+7+8+9+10+Value+12+14+16+18+20%0d%0a%0d%0a0.10%0d%0a%0d%0aProbability%0d%0a%0d%0a0.05%0d%0a%0d%0a0.00%0d%0a%0d%0a0.0%0d%0a%0d%0a0.2%0d%0a%0d%0a0.4%0d%0a%0d%0a0.6%0d%0a%0d%0a0.8%0d%0a%0d%0a0%0d%0a%0d%0a5%0d%0a%0d%0a10+Value%0d%0a%0d%0a15%0d%0a%0d%0a20%0d%0a%0d%0aNote+that+the+CDF+does+seem+to+tend+to+1+as+n+increases.+However%2c+we+do+need+to+verify+that+the+PMF+we+have+adopted+for+X+%e2%88%bc+P(%ce%bb)+does+indeed+de%ef%ac%81ne%0d%0a%0d%0a%0ca+valid+probability+distribution%2c+by+ensuring+that+the+probabilities+do+sum+to+one%3a+P(SX+)+%3d+%3d%0d%0a%0d%0ak%3d0+%e2%88%9e+%ce%bbk+k%3d0%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0a%e2%88%9e%0d%0a%0d%0aP(X+%3d+k)+e%e2%88%92%ce%bb+%3d+e%e2%88%92%ce%bbe%ce%bb+%3d+1.%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0ak!%0d%0a%0d%0a%3d+e%e2%88%92%ce%bb%0d%0a%0d%0ak%3d0%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0a%e2%88%9e+%ce%bbk%0d%0a%0d%0ak!%0d%0a%0d%0aExpectation+and+variance+of+Poisson%0d%0a%0d%0a%0cIf+X+%e2%88%bc+P(%ce%bb)%2c+we+have+E(X)+%3d+%3d%0d%0a%0d%0ak%3d0+%e2%88%9e%0d%0a%0d%0a%e2%88%91+k+P(X+%3d+k)+%e2%88%91+k+P(X+%3d+k)%0d%0ak!%0d%0a%0d%0a%e2%88%9e%0d%0a%0d%0ak%3d1+%e2%88%9e+%ce%bbk+k+e%e2%88%92%ce%bb+%3d+k%3d1+%e2%88%9e%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0a%ce%bbk+e%e2%88%92%ce%bb+%3d+%e2%88%91+(k+%e2%88%92+1)!+k%3d1+%ce%bbk%e2%88%921+%e2%88%92%ce%bb+%3d%ce%bb+%e2%88%91+e+(k+%e2%88%92+1)!+k%3d1%0d%0a%e2%88%9e+%ce%bbj+%3d%ce%bb+e%e2%88%92%ce%bb+j%3d0+j!+%e2%88%9e+%e2%88%9e%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0a(putting+j+%3d+k+%e2%88%92+1)%0d%0a%0d%0a%3d%ce%bb%0d%0a%0d%0aj%3d0%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0aP(X+%3d+j)%0d%0a%0d%0a%3d+%ce%bb.%0d%0a%0d%0a%0cSimilarly%2c+E+X2+%3d+%3d+%3d%0d%0a%0d%0ak%3d0+%e2%88%9e+k%3d1+%e2%88%9e%0d%0a%0d%0a%e2%88%91+k2+P(X+%3d+k)%0d%0a%0d%0a%e2%88%9e%0d%0a%0d%0a%e2%88%91+k2+P(X+%3d+k)%0d%0ak+2+%ce%bb+e%e2%88%92%ce%bb+k%0d%0a%0d%0a%ce%bbk%e2%88%921+%e2%88%92%ce%bb+e+%3d%ce%bb+%e2%88%91+k+(k+%e2%88%92+1)!+k%3d1+%ce%bb+j+%e2%88%92%ce%bb+%3d+%ce%bb+%e2%88%91+(+j+%2b+1)+e+j!+j%3d0%0d%0a%e2%88%9e+%ce%bbj+%ce%bb+j+%e2%88%92%ce%bb+%3d+%ce%bb+%e2%88%91+j+e+%2b+%e2%88%91+e%e2%88%92%ce%bb+j%3d0+j!+j%3d0+j!+%e2%88%9e+%e2%88%9e%0d%0a%0d%0ak%3d1+%e2%88%9e%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0ak!%0d%0a%0d%0a(putting+j+%3d+k+%e2%88%92+1)%0d%0a%0d%0a%3d%ce%bb%0d%0a%0d%0aj%3d0%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0a%e2%88%9e%0d%0a%0d%0aj+P(X+%3d+j)+%2b%0d%0a%0d%0aj%3d0%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0a%e2%88%9e%0d%0a%0d%0aP(X+%3d+j)%0d%0a%0d%0a%3d+%ce%bb+%5b+E(X)+%2b+1%5d+%3d+%ce%bb(%ce%bb+%2b+1)+%3d+%ce%bb2+%2b+%ce%bb.%0d%0a%0d%0a%0cSo%2c+Var+(X)+%3d+E+X+2+%e2%88%92+E(X)2+%3d+%5b%ce%bb2+%2b+%ce%bb%5d+%e2%88%92+%ce%bb2+%3d+%ce%bb.+That+is%2c+the+mean+and+variance+are+both+%ce%bb.%0d%0a%0d%0aSum+of+Poisson+random+quantities%0d%0aOne+of+the+particularly+convenient+properties+of+the+Poisson+distribution+is+that+the+sum+of+two+independent+Poisson+random+quantities+is+also+a+Poisson+random+quantity.+If+X+%e2%88%bc+P(%ce%bb)+and+Y+%e2%88%bc+P(%c2%b5)+and+X+and+Y+are+independent%2c+then+Z+%3d+X+%2bY+%e2%88%bc+P(%ce%bb+%2b+%c2%b5).+Clearly+this+result+extends+to+the+sum+of+many+independent+Poisson+random+variables.+The+proof+is+straightforward%2c+but+is+a+little+messy%2c+and+hence+omitted+from+this+course.+Example+Returning+to+the+example+of+calls+received+by+an+ISP.+The+number+of+calls+in+1+minute+is+X+%e2%88%bc+P(5).+Suppose+that+the+number+of+calls+in+the+following+minute+is%0d%0a%0d%0a%0cY+%e2%88%bc+P(5)%2c+and+that+Y+is+independent+of+X.+Then%2c+by+the+above+result%2c+Z+%3d+X+%2bY+%2c+the+number+of+calls+in+the+two+minute+period+is+Poisson+with+parameter+10.+Extending+this+in+the+natural+way%2c+we+see+that+the+number+of+calls+in+t+minutes+is+Poisson+with+parameter+5t.+This+motivates+the+following+de%ef%ac%81nition.%0d%0a%0d%0aThe+Poisson+process%0d%0aA+sequence+of+timed+observations+is+said+to+follow+a+Poisson+process+with+rate+%ce%bb+if+the+number+of+observations%2c+X%2c+in+any+interval+of+length+t+is+such+that+X+%e2%88%bc+P(%ce%bbt).+Example+For+the+ISP+example%2c+the+sequence+of+incoming+calls+follow+a+Poisson+process+with+rate+5+(per+minute).%0d%0a%0d%0a%0cContinuous+Probability+Models%0d%0aIntroduction%2c+PDF+and+CDF%0d%0aIntroduction%0d%0aWe+now+a+have+a+fairly+good+understanding+of+discrete+probability+models%2c+but+as+yet+we+haven%e2%80%99t+developed+any+techniques+for+handling+continuous+random+quantities.+These+are+random+quantities+with+a+sample+space+which+is+neither+%ef%ac%81nite+nor+countably+in%ef%ac%81nite.+The+sample+space+is+usually+taken+to+be+the+real+line%2c+or+a+part+thereof.+Continuous+probability+models+are+appropriate+if+the+result+of+an+experiment+is+a+continuous+measurement%2c+rather+than+a+count+of+a+discrete+set.+If+X+is+a+continuous+random+quantity+with+sample+space+SX+%2c+then+for+any+particular+a+%e2%88%88+SX+%2c+we+generally+have+that+P(X+%3d+a)+%3d+0.+This+is+because+the+sample+space+is+so+%e2%80%9clarge%e2%80%9d+and+every+possible+outcome+so+%e2%80%9csmall%e2%80%9d+that+the+probability+of+any+particular+value+is+vanishingly+small.%0d%0a%0d%0a%0cTherefore+the+probability+mass+function+we+de%ef%ac%81ned+for+discrete+random+quantities+is+inappropriate+for+understanding+continuous+random+quantities.+In+order+to+understand+continuous+random+quantities%2c+we+need+a+little+calculus.%0d%0a%0d%0aThe+probability+density+function%0d%0aIf+X+is+a+continuous+random+quantity%2c+then+there+exists+a+function+fX+(x)%2c+called+the+probability+density+function+(PDF)%2c+which+satis%ef%ac%81es+the+following%3a%0d%0a%0d%0a1.+fX+(x)+%e2%89%a5+0%2c%0d%0a%e2%88%9e+%e2%88%92%e2%88%9e%0d%0a%0d%0a%e2%88%80x+%3b%0d%0a%0d%0a2.%0d%0a%0d%0afX+(x)+dx+%3d+1%3b%0d%0a%0d%0a3.+P(a+%e2%89%a4+X+%e2%89%a4+b)+%3d%0d%0a%0d%0ab+a%0d%0a%0d%0afX+(x)+dx+for+any+a+and+b.%0d%0a%0d%0a%0cConsequently+we+have+P(x+%e2%89%a4+X+%e2%89%a4+x+%2b+%ce%b4x)+%3d%0d%0ax%2b%ce%b4x+x%0d%0a%0d%0afX+(y)+dy+(for+small+%ce%b4x)%0d%0a%0d%0a%e2%87%92+fX+(x)+and+so+we+may+interpret+the+PDF+as%0d%0a%0d%0afX+(x)%ce%b4x%2c+P(x+%e2%89%a4+X+%e2%89%a4+x+%2b+%ce%b4x)+%ce%b4x%0d%0a%0d%0aP(x+%e2%89%a4+X+%e2%89%a4+x+%2b+%ce%b4x)+fX+(x)+%3d+lim+.+%ce%b4x+%ce%b4x%e2%86%920+Example+The+manufacturer+of+a+certain+kind+of+light+bulb+claims+that+the+lifetime+of+the+bulb+in+hours%2c+X+can+be+modelled+as+a+random+quantity+with+PDF+%ef%a3%b1+%ef%a3%b20%2c+x+%3c+100+fX+(x)+%3d+c+%ef%a3%b3+2+%2c+x+%e2%89%a5+100%2c+x+where+c+is+a+constant.+What+value+must+c+take+in+order+for+this+to+de%ef%ac%81ne+a+valid+PDF%3f+What+is+the+probability+that+the+bulb+lasts+no+longer+than+150+hours%3f%0d%0a%0d%0a%0cGiven+that+a+bulb+lasts+longer+than+150+hours%2c+what+is+the+probability+that+it+lasts+longer+than+200+hours%3f+Notes%0d%0a%0d%0a1.+Remember+that+PDFs+are+not+probabilities.+For+example%2c+the+density+can+take+values+greater+than+1+in+some+regions+as+long+as+it+still+integrates+to+1.%0d%0a%0d%0a2.+It+is+sometimes+helpful+to+think+of+a+PDF+as+the+limit+of+a+relative+frequency+histogram+for+many+realisations+of+the+random+quantity%2c+where+the+number+of+realisations+is+very+large+and+the+bin+widths+are+very+small.%0d%0a%0d%0a3.+Because+P(X+%3d+a)+%3d+0%2c+we+have+P(X+%e2%89%a4+k)+%3d+P(X+%3c+k)+for+continuous+random+quantities.%0d%0a%0d%0aThe+distribution+function%0d%0a%0d%0a%0cIn+the+last+chapter%2c+we+de%ef%ac%81ned+the+cumulative+distribution+function+of+a+random+variable+X+to+be+FX+(x)+%3d+P(X+%e2%89%a4+x)+%2c+%e2%88%80x.%0d%0a%0d%0aThis+de%ef%ac%81nition+works+just+as+well+for+continuous+random+quantities%2c+and+is+one+of+the+many+reasons+why+the+distribution+function+is+so+useful.+For+a+discrete+random+quantity+we+had+FX+(x)+%3d+P(X+%e2%89%a4+x)+%3d%0d%0a%7by%e2%88%88SX+%7cy%e2%89%a4x%7d%0d%0a%0d%0a%e2%88%91%0d%0a%0d%0aP(X+%3d+y)+%2c%0d%0a%0d%0abut+for+a+continuous+random+quantity+we+have+the+continuous+analogue+FX+(x)+%3d+P(X+%e2%89%a4+x)+%3d+P(%e2%88%92%e2%88%9e+%e2%89%a4+X+%e2%89%a4+x)%0d%0ax%0d%0a%0d%0a%3d%0d%0a%0d%0a%e2%88%92%e2%88%9e%0d%0a%0d%0afX+(z)+dz.%0d%0a%0d%0aJust+as+in+the+discrete+case%2c+the+distribution+function+is+de%ef%ac%81ned+for+all+x+%e2%88%88+I+%2c+R+even+if+the+sample+space+SX+is+not+the+whole+of+the+real+line.+Properties%0d%0a%0d%0a%0c1.+Since+it+represents+a+probability%2c+FX+(x)+%e2%88%88+%5b0%2c+1%5d.+2.+FX+(%e2%88%92%e2%88%9e)+%3d+0+and+FX+(%e2%88%9e)+%3d+1.+3.+If+a+%3c+b%2c+then+FX+(a)+%e2%89%a4+FX+(b).+ie.+FX+(%c2%b7)+is+a+non-decreasing+function.+4.+When+X+is+continuous%2c+FX+(x)+is+continuous.+Also%2c+by+the+Fundamental+Theorem+of+Calculus%2c+we+have+d+F+(x)+%3d+fX+(x)%2c+dx+X+and+so+the+slope+of+the+CDF+FX+(x)+is+the+PDF+fX+(x).+Example+For+the+light+bulb+lifetime%2c+X%2c+the+distribution+function+is+%ef%a3%b1+%ef%a3%b20%2c+x+%3c+100+FX+(x)+%3d+100+%ef%a3%b31+%e2%88%92+%2c+x+%e2%89%a5+100.+x%0d%0a%0d%0a%0cMedian+and+quartiles%0d%0aThe+median+of+a+random+quantity+is+the+value+m+which+is+the+%e2%80%9cmiddle%e2%80%9d+of+the+distribution.+That+is%2c+it+is+the+value+m+such+that+1+P(X+%e2%89%a4+m)+%3d+P(X+%e2%89%a5+m)+%3d+.+2+Equivalently%2c+it+is+the+value%2c+m+such+that+FX+(m)+%3d+0.5.+Similarly%2c+the+lower+quartile+of+a+random+quantity+is+the+value+l+such+that+FX+(l)+%3d+0.25%2c+and+the+upper+quartile+is+the+value+u+such+that+FX+(u)+%3d+0.75.+Example+For+the+light+bulb+lifetime%2c+X%2c+what+is+the+median%2c+upper+and+lower+quartile+of+the+distribution%3f%0d%0a%0d%0a%0cProperties+of+continuous+random+quantities%0d%0aExpectation+and+variance+of+continuous+random+quantities%0d%0aThe+expectation+or+mean+of+a+continuous+random+quantity+X+is+given+by+E(X)+%3d%0d%0a%e2%88%9e+%e2%88%92%e2%88%9e%0d%0a%0d%0ax+fX+(x)+dx%2c%0d%0a%0d%0awhich+is+just+the+continuous+analogue+of+the+corresponding+formula+for+discrete+random+quantities.+Similarly%2c+the+variance+is+given+by+Var+(X)+%3d+%3d%0d%0a%e2%88%9e+%e2%88%92%e2%88%9e+%e2%88%9e+%e2%88%92%e2%88%9e%0d%0a%0d%0a%5bx+%e2%88%92+E(X)%5d2+fX+(x)+dx+x2+fX+(x)+dx+%e2%88%92+%5b+E(X)%5d2.%0d%0a%e2%88%9e+%e2%88%92%e2%88%9e%0d%0a%0d%0aNote+that+the+expectation+of+g(X)+is+given+by+E(g(X))+%3d+and+so+the+variance+is+just+Var+(X)+%3d+E+%5bX+%e2%88%92+E(X)%5d2+%3d+E+X+2+%e2%88%92+%5b+E(X)%5d2+g(x)+fX+(x)+dx%0d%0a%0d%0a%0cas+in+the+discrete+case.+Note+also+that+all+of+the+properties+of+expectation+and+variance+derived+for+discrete+random+quantities+also+hold+true+in+the+continuous+case.+Example+Consider+the+random+quantity+X%2c+with+PDF+fX+(x)+%3d%0d%0a3+(2x+%e2%88%92+x2+)%2c+4%0d%0a%0d%0a0%2c%0d%0a%0d%0a0%3cx%3c2+otherwise.%0d%0a%0d%0aCheck+that+this+is+a+valid+PDF+(it+integrates+to+1).+Calculate+the+expectation+and+variance+of+X.+Evaluate+the+distribution+function.+What+is+the+median+of+this+distribution%3f%0d%0a%0d%0aPDF+and+CDF+of+a+linear+transformation%0d%0aLet+X+be+a+continuous+random+quantity+with+PDF+fX+(x)+and+CDF+FX+(x)%2c+and+let+Y+%3d+aX+%2b+b+where+a+%3e+0.+What+is+the+PDF+and+CDF+of+Y+%3f+It+turns+out+to+be%0d%0a%0d%0a%0ceasier+to+work+out+the+CDF+%ef%ac%81rst%3a+FY+(y)+%3d+P(Y+%e2%89%a4+y)+%3d+P(aX+%2b+b+%e2%89%a4+y)+y%e2%88%92b+%3d+P+X%e2%89%a4+a+y%e2%88%92b+%3d+FX+.+a+So%2c+FY+(y)+%3d+FX+y%e2%88%92b+%2c+a%0d%0a%0d%0a(since+a+%3e+0)%0d%0a%0d%0aand+by+differentiating+both+sides+with+respect+to+y+we+get+1+fY+(y)+%3d+fX+a+Example+For+the+light+bulb+lifetime%2c+X%2c+what+is+the+density+of+Y+%3d+X%2f24%2c+the+lifetime+of+the+bulb+in+days%3f+y%e2%88%92b+.+a%0d%0a%0d%0a%0cThe+uniform+distribution%0d%0aNow+that+we+understand+the+basic+properties+of+continuous+random+quantities%2c+we+can+look+at+some+of+the+important+standard+continuous+probability+models.+The+simplest+of+these+is+the+uniform+distribution.+The+random+quantity+X+has+a+uniform+distribution+over+the+range+%5ba%2c+b%5d%2c+written+X+%e2%88%bc+U(a%2c+b)+if+the+PDF+is+given+by+%ef%a3%b1+%ef%a3%b2+1+%2c+a+%e2%89%a4+x+%e2%89%a4+b%2c+fX+(x)+%3d+b+%e2%88%92+a+%ef%a3%b30%2c+otherwise.%0d%0a%0d%0a%0cThus+if+x+%e2%88%88+%5ba%2c+b%5d%2c%0d%0ax%0d%0a%0d%0aFX+(x)+%3d+%3d%0d%0a%0d%0a%e2%88%92%e2%88%9e+a+%e2%88%92%e2%88%9e%0d%0a%0d%0afX+(y)+dy%0d%0ax%0d%0a%0d%0afX+(y)+dy+%2b%0d%0ax%0d%0a%0d%0aa%0d%0a%0d%0afX+(y)+dy%0d%0a%0d%0a1+%3d+0%2b+dy+b%e2%88%92a+a+y+x+%3d+b%e2%88%92a+a+x%e2%88%92a+.+%3d+b%e2%88%92a+Therefore%2c+%ef%a3%b1+%ef%a3%b40%2c+%ef%a3%b4+%ef%a3%b2x+%e2%88%92+a+x+%3c+a%2c+%2c+a+%e2%89%a4+x+%e2%89%a4+b%2c+x+%3e+b.%0d%0a%0d%0aFX+(x)+%3d%0d%0a%0d%0aWe+can+plot+the+PDF+and+CDF+in+order+to+see+the+%e2%80%9cshape%e2%80%9d+of+the+distribution.+Below+are+plots+for+X+%e2%88%bc+U(0%2c+1).%0d%0a%0d%0a%ef%a3%b4b+%e2%88%92+a+%ef%a3%b4+%ef%a3%b3+1%2c%0d%0a%0d%0a%0cPDF+for+X+%7e+U(0%2c1)%0d%0a1.0+1.0%0d%0a%0d%0aCDF+for+X+%7e+U(0%2c1)%0d%0a%0d%0a0.8%0d%0a%0d%0a0.6%0d%0a%0d%0a0.4%0d%0a%0d%0aF(x)+0.2+0.0+%e2%80%930.5+0.0+0.5+x+1.0+1.5+0.0+%e2%80%930.5+0.2+0.4%0d%0a%0d%0af(x)%0d%0a%0d%0a0.6%0d%0a%0d%0a0.8%0d%0a%0d%0a0.0%0d%0a%0d%0a0.5+x%0d%0a%0d%0a1.0%0d%0a%0d%0a1.5%0d%0a%0d%0aClearly+the+lower+quartile%2c+median+and+upper+quartile+of+the+uniform+distribution+are+3+1+a%2bb+1+3+a+%2b+b%2c+%2c+a+%2b+b%2c+4+4+2+4+4%0d%0a%0d%0a%0crespectively.+The+expectation+of+a+uniform+random+quantity+is+E(X)+%3d+%3d%0d%0a%e2%88%9e+%e2%88%92%e2%88%9e+a+%e2%88%92%e2%88%9e%0d%0a%0d%0ax+fX+(x)+dx%0d%0ab%0d%0a%0d%0ax+fX+(x)+dx+%2b%0d%0ab%0d%0a%0d%0aa%0d%0a%0d%0ax+fX+(x)+dx+%2b%0d%0a%0d%0a%e2%88%9e+b%0d%0a%0d%0ax+fX+(x)+dx%0d%0a%0d%0a%3d+0%2b+%3d%0d%0a%0d%0ax+dx+%2b+0+b%e2%88%92a+a+x2%0d%0ab+a%0d%0a%0d%0a2(b+%e2%88%92+a)%0d%0a%0d%0ab2+%e2%88%92+a2+%3d+2(b+%e2%88%92+a)+a%2bb+%3d+.+2%0d%0a%0d%0a%0cWe+can+also+calculate+the+variance+of+X.+First+we+calculate+E+X+2+as+follows%3a+E+X2+%3d+%3d%0d%0ab+x2+a+b%e2%88%92a+x3+b+a%0d%0a%0d%0a3(b+%e2%88%92+a)%0d%0a%0d%0ab3+%e2%88%92+a3+%3d+3(b+%e2%88%92+a)+b2+%2b+ab+%2b+a2+%3d+.+3%0d%0a%0d%0a%0cNow%2c+Var+(X)+%3d+E+X+2+%e2%88%92+E(X)2+b2+%2b+ab+%2b+a2+(a+%2b+b)2+%3d+%e2%88%92+3+4+4b2+%2b+4ab+%2b+4a2+%e2%88%92+3b2+%e2%88%92+6ab+%e2%88%92+3a2+%3d+12+1+2+%3d+%5bb+%e2%88%92+2ab+%2b+a2%5d+12+(b+%e2%88%92+a)2+%3d+.+12+The+uniform+distribution+is+rather+too+simple+to+realistically+model+actual+experimental+data%2c+but+is+very+useful+for+computer+simulation%2c+as+random+quantities+from+many+different+distributions+can+be+obtained+from+U(0%2c+1)+random+quantities.%0d%0a%0d%0aThe+exponential+distribution%0d%0aDe%ef%ac%81nition+and+properties%0d%0a%0d%0a%0cThe+random+variable+X+has+an+exponential+distribution+with+parameter+%ce%bb+%3e+0%2c+written+X+%e2%88%bc+Exp(%ce%bb)+if+it+has+PDF+fX+(x)+%3d+%ce%bbe%e2%88%92%ce%bbx%2c+x+%e2%89%a5+0%2c+0%2c+otherwise.%0d%0a%0d%0aThe+distribution+function%2c+FX+(x)+is+therefore+given+by+FX+(x)+%3d+0%2c+x+%3c+0%2c+1+%e2%88%92+e%e2%88%92%ce%bbx%2c+x+%e2%89%a5+0.%0d%0aCDF+for+X+%7e+Exp(1)%0d%0a1.0+F(x)+0.4+0.0+0.2+0+2+4+x+6+8+0.0+0.2+0.4+0.6+0.8%0d%0a%0d%0aThe+PDF+and+CDF+for+an+Exp(1)+are+shown+below.%0d%0aPDF+for+X+%7e+Exp(1)%0d%0a1.0+f(x)+0.6+0.8%0d%0a%0d%0a0%0d%0a%0d%0a2%0d%0a%0d%0a4+x%0d%0a%0d%0a6%0d%0a%0d%0a8%0d%0a%0d%0a%0cThe+expectation+of+the+exponential+distribution+is+E(X)+%3d%0d%0a%e2%88%9e+0%0d%0a%0d%0ax%ce%bbe%e2%88%92%ce%bbxdx+(by+parts)%0d%0a%0d%0a%e2%88%9e+%e2%88%92%ce%bbx+%e2%88%9e+%2b+%3d+%e2%88%92xe+e%e2%88%92%ce%bbxdx+0+0+%e2%88%9e+e%e2%88%92%ce%bbx%0d%0a%0d%0a%3d+0%2b%0d%0a%0d%0a%e2%88%92%ce%bb%0d%0a%0d%0a0%0d%0a%0d%0a1+%3d+.+%ce%bb+Also%2c+E+X2+%3d%0d%0a%e2%88%9e+0%0d%0a%0d%0ax2%ce%bbe%e2%88%92%ce%bbxdx%0d%0a%0d%0a2+%3d+2%2c+%ce%bb+and+so+2+1+Var+(X)+%3d+2+%e2%88%92+2+%ce%bb+%ce%bb+1+%3d+2.+%ce%bb+Note+that+this+means+the+expectation+and+standard+deviation+are+both+1%2f%ce%bb.%0d%0a%0d%0a%0cNotes+1.+As+%ce%bb+increases%2c+the+probability+of+small+values+of+X+increases+and+the+mean+decreases.%0d%0a%0d%0a2.+The+median+m+is+given+by+m%3d+log+2+%3d+log+2+E(X)+%3c+E(X)+.+%ce%bb%0d%0a%0d%0a3.+The+exponential+distribution+is+often+used+to+model+lifetime+and+times+between+random+events.+The+reasons+are+given+below.%0d%0a%0d%0aRelationship+with+the+Poisson+process%0d%0aThe+exponential+distribution+with+parameter+%ce%bb+is+the+time+between+events+of+a+Poisson+process+with+rate+%ce%bb.+Let+X+be+the+number+of+events+in+the+interval%0d%0a%0d%0a%0c(0%2ct).+We+have+seen+previously+that+X+%e2%88%bc+P(%ce%bbt).+Let+T+be+the+time+to+the+%ef%ac%81rst+event.+Then+FT+(t)+%3d+P(T+%e2%89%a4+t)+%3d+1+%e2%88%92+P(T+%3e+t)+%3d+1+%e2%88%92+P(X+%3d+0)+(%ce%bbt)0e%e2%88%92%ce%bbt+%3d+1%e2%88%92+0!+%3d+1+%e2%88%92+e%e2%88%92%ce%bbt+.+This+is+the+distribution+function+of+an+Exp(%ce%bb)+random+quantity%2c+and+so+T+%e2%88%bc+Exp(%ce%bb).+Example+Consider+again+the+Poisson+process+for+calls+arriving+at+an+ISP+at+rate+5+per+minute.+Let+T+be+the+time+between+two+consecutive+calls.+Then+we+have+T+%e2%88%bc+Exp(5)+and+so+E(T+)+%3d+SD(T+)+%3d+1%2f5.%0d%0a%0d%0a%0cThe+memoryless+property%0d%0a%0d%0a%0cIf+X+%e2%88%bc+Exp(%ce%bb)%2c+then+P(X+%3e+(s+%2b+t)%7cX+%3e+t)+%3d+P(%5bX+%3e+(s+%2b+t)%5d+%e2%88%a9+%5bX+%3e+t%5d)+P(X+%3e+t)+P(X+%3e+(s+%2b+t))+%3d+P(X+%3e+t)+1+%e2%88%92+P(X+%e2%89%a4+(s+%2b+t))+%3d+1+%e2%88%92+P(X+%e2%89%a4+t)+1+%e2%88%92+FX+(s+%2b+t)+%3d+1+%e2%88%92+FX+(t)+1+%e2%88%92+%5b1+%e2%88%92+e%e2%88%92%ce%bb(s%2bt)%5d+%3d+1+%e2%88%92+%5b1+%e2%88%92+e%e2%88%92%ce%bbt+%5d+e%e2%88%92%ce%bb(s%2bt)+%3d+e%e2%88%92%ce%bbt+%3d+e%e2%88%92%ce%bbs+%3d+1+%e2%88%92+%5b1+%e2%88%92+e%e2%88%92%ce%bbs%5d+%3d+1+%e2%88%92+FX+(s)+%3d+1+%e2%88%92+P(X+%e2%89%a4+s)+%3d+P(X+%3e+s)+.%0d%0a%0d%0a%0cSo+in+the+context+of+lifetimes%2c+the+probability+of+surviving+a+further+time+s%2c+having+survived+time+t+is+the+same+as+the+original+probability+of+surviving+a+time+s.+This+is+called+the+%e2%80%9cmemoryless%e2%80%9d+property+of+the+distribution.+It+is+therefore+the+continuous+analogue+of+the+geometric+distribution%2c+which+also+has+such+a+property.%0d%0a%0d%0aThe+normal+distribution%0d%0aDe%ef%ac%81nition+and+properties%0d%0aA+random+quantity+X+has+a+normal+distribution+with+parameters+%c2%b5+and+%cf%832%2c+written+X+%e2%88%bc+N(%c2%b5%2c+%cf%832)+if+it+has+probability+density+function+1+x%e2%88%92%c2%b5+2+1+%2c+fX+(x)+%3d+%e2%88%9a+exp+%e2%88%92+2+%cf%83+%cf%83+2%cf%80+%e2%88%92%e2%88%9e+%3c+x+%3c+%e2%88%9e%2c%0d%0a%0d%0afor+%cf%83+%3e+0.+Note+that+fX+(x)+is+symmetric+about+x+%3d+%c2%b5%2c+and+so+(provided+the+density+integrates+to+1)%2c+the+median+of+the+distribution+will+be+%c2%b5.+Checking+that%0d%0a%0d%0a%0cthe+density+integrates+to+one+requires+the+computation+of+a+slightly+tricky+integral.+However%2c+it+follows+directly+from+the+known+%e2%80%9cGaussian%e2%80%9d+integral%0d%0a%e2%88%9e+%e2%88%92%e2%88%9e+%e2%88%92%ce%b1x2+dx+%3d+e%0d%0a%0d%0a%cf%80+%2c+%ce%b1%0d%0a%0d%0a%ce%b1+%3e+0%2c%0d%0a%0d%0asince+then+1+x%e2%88%92%c2%b5+2+1+%e2%88%9a+exp+%e2%88%92+dx+fX+(x)+dx+%3d+2+%cf%83+%e2%88%92%e2%88%9e+%e2%88%92%e2%88%9e+%cf%83+2%cf%80+%e2%88%9e+1+1+2+%e2%88%9a+%3d+exp+%e2%88%92+2+z+dz+2%cf%83+%cf%83+2%cf%80+%e2%88%92%e2%88%9e+1+%cf%80+%e2%88%9a+%3d+%cf%83+2%cf%80+1%2f2%cf%832+1+%3d+%e2%88%9a+2%cf%80%cf%832+%cf%83+2%cf%80+%3d+1.%0d%0a%e2%88%9e+%e2%88%9e%0d%0a%0d%0a(putting+z+%3d+x+%e2%88%92+%c2%b5)%0d%0a%0d%0aNow+we+know+that+the+given+PDF+represents+a+valid+density%2c+we+can+calculate%0d%0a%0d%0a%0cthe+expectation+and+variance+of+the+normal+distribution+as+follows%3a+E(X)+%3d%0d%0a%e2%88%9e+%e2%88%92%e2%88%9e+%e2%88%9e%0d%0a%0d%0ax+fX+(x)+dx%0d%0a%0d%0a1+x%e2%88%92%c2%b5+2+1+dx+%3d+x+%e2%88%9a+exp+%e2%88%92+2+%cf%83+%e2%88%92%e2%88%9e+%cf%83+2%cf%80+%3d%c2%b5+after+a+little+algebra.+Similarly%2c+Var+(X)+%3d+%3d%0d%0a%e2%88%9e+%e2%88%92%e2%88%9e+%e2%88%9e+%e2%88%92%e2%88%9e%0d%0a%0d%0a(x+%e2%88%92+%c2%b5)2+fX+(x)+dx+1+(x+%e2%88%92+%c2%b5)2+%e2%88%9a+1+x%e2%88%92%c2%b5+2+exp+%e2%88%92+dx+2+%cf%83+%cf%83+2%cf%80%0d%0a%0d%0a%3d+%cf%832.+The+PDF+and+CDF+for+a+N(0%2c+1)+are+shown+below.%0d%0a%0d%0a%0cPDF+for+X+%7e+N(0%2c1)%0d%0a0.4+1.0%0d%0a%0d%0aCDF+for+X+%7e+N(0%2c1)%0d%0a%0d%0a0.3%0d%0a%0d%0aF(x)+%e2%80%934+%e2%80%932+0+x+2+4+0.0+0.2+0.4%0d%0a%0d%0af(x)%0d%0a%0d%0a0.0%0d%0a%0d%0a0.1%0d%0a%0d%0a0.2%0d%0a%0d%0a0.6%0d%0a%0d%0a0.8%0d%0a%0d%0a%e2%80%934%0d%0a%0d%0a%e2%80%932%0d%0a%0d%0a0+x%0d%0a%0d%0a2%0d%0a%0d%0a4%0d%0a%0d%0aThe+standard+normal+distribution%0d%0aA+standard+normal+random+quantity+is+a+normal+random+quantity+with+zero+mean+and+variance+equal+to+one.+It+is+usually+denoted+Z%2c+so+that+Z+%e2%88%bc+N(0%2c+1).+Therefore%2c+the+density+of+Z%2c+which+is+usually+denoted+%cf%86(z)%2c+is+given+by+1+1+%cf%86(z)+%3d+%e2%88%9a+exp+%e2%88%92+z2+%2c+%e2%88%92%e2%88%9e+%3c+z+%3c+%e2%88%9e.+2+2%cf%80+It+is+important+to+note+that+the+PDF+of+the+standard+normal+is+symmetric+about+zero.+The+distribution+function+of+a+standard+normal+random+quantity+is+denoted+%ce%a6(z)%2c+that+is+%ce%a6(z)+%3d%0d%0az+%e2%88%92%e2%88%9e%0d%0a%0d%0a%cf%86(x)dx.%0d%0a%0d%0a%0cThere+is+no+neat+analytic+expression+for+%ce%a6(z)%2c+so+tables+of+the+CDF+are+used.+Of+course%2c+we+do+know+that+%ce%a6(%e2%88%92%e2%88%9e)+%3d+0+and+%ce%a6(%e2%88%9e)+%3d+1%2c+as+it+is+a+distribution+function.+Also%2c+because+of+the+symmetry+of+the+PDF+about+zero%2c+it+is+clear+that+we+must+also+have+%ce%a6(0)+%3d+1%2f2%2c+and+this+can+prove+useful+in+calculations.+The+standard+normal+distribution+is+important+because+it+is+easy+to+transform+any+normal+random+quantity+to+a+standard+normal+random+quantity+by+means+of+a+simple+linear+scaling.+Consider+Z+%e2%88%bc+N(0%2c+1)+and+put+X+%3d+%c2%b5+%2b+%cf%83+Z%2c+for+%cf%83+%3e+0.+Then+X+%e2%88%bc+N(%c2%b5%2c+%cf%832).+To+show+this%2c+we+must+show+that+the+PDF+of+X+is+the+PDF+for+a+N(%c2%b5%2c+%cf%832)+random+quantity.+Using+the+result+for+the+PDF+of+a+linear+transformation%2c+we+have+1+x%e2%88%92%c2%b5+fX+(x)+%3d+%cf%86+%cf%83+%cf%83+1+1+x%e2%88%92%c2%b5+2+%3d+%e2%88%9a+exp+%e2%88%92+%2c+2+%cf%83+%cf%83+2%cf%80+which+is+the+PDF+of+a+N(%c2%b5%2c+%cf%832)+distribution.+Conversely%2c+if+X+%e2%88%bc+N(%c2%b5%2c+%cf%832)%0d%0a%0d%0a%0cthen+X+%e2%88%92%c2%b5+%e2%88%bc+N(0%2c+1).+Z%3d+%cf%83+Even+more+importantly%2c+the+distribution+function+of+X+is+given+by+FX+(x)+%3d+%ce%a6+x%e2%88%92%c2%b5+%2c+%cf%83%0d%0a%0d%0aand+so+the+cumulative+probabilities+for+any+normal+random+quantity+can+be+calculated+using+tables+for+the+standard+normal+distribution.+Example+Suppose+that+X+%e2%88%bc+N(3%2c+22)%2c+and+we+are+interested+in+the+probability+that+X+does+not+exceed+5.+Then+P(X+%3c+5)+%3d+%ce%a6+5%e2%88%923+2+%3d+%ce%a6(1)+%3d+0.84134.%0d%0a%0d%0aNotes%0d%0a%0d%0a%0cThe+normal+distribution+is+probably+the+most+important+probability+distribution+in+statistics.+In+practice%2c+many+measured+variables+may+be+assumed+to+be+approximately+normal.+For+example%2c+weights%2c+heights%2c+IQ+scores%2c+blood+pressure+measurements+etc.+are+all+usually+assumed+to+follow+a+normal+distribution.+The+ubiquity+of+the+normal+distribution+is+due+in+part+to+the+Central+Limit+Theorem.+Essentially%2c+this+says+that+sample+means+and+sums+of+independent+random+quantities+are+approximately+normally+distributed+whatever+the+distribution+of+the+original+quantities%2c+as+long+as+the+sample+size+is+reasonably+large+%e2%80%94+more+on+this+in+Semester+2.%0d%0a%0d%0aNormal+approximation+of+binomial+and+Poisson%0d%0aNormal+approximation+of+the+binomial%0d%0aWe+saw+in+the+last+chapter+that+X+%e2%88%bc+B(n%2c+p)+could+be+regarded+as+the+sum+of+n+independent+Bernoulli+random+quantities+X%3d%0d%0a%0d%0ak%3d1%0d%0a%0d%0a%e2%88%91+Ik%2c%0d%0a%0d%0an%0d%0a%0d%0a%0cwhere+Ik+%e2%88%bc+Bern(p).+Then%2c+because+of+the+central+limit+theorem%2c+this+will+be+well+approximated+by+a+Normal+distribution+if+n+is+large%2c+and+p+is+not+too+extreme+(if+p+is+very+small+or+very+large%2c+a+Poisson+approximation+will+be+more+appropriate).+A+useful+guide+is+that+if+9(1+%e2%88%92+p)+9p+0.1+%e2%89%a4+p+%e2%89%a4+0.9+and+n+%3e+max+%2c+p+1%e2%88%92+p+then+the+binomial+distribution+may+be+adequately+approximated+by+a+normal+distribution.+It+is+important+to+understand+exactly+what+is+meant+by+this+statement.+No+matter+how+large+n+is%2c+the+binomial+will+always+be+a+discrete+random+quantity+with+a+PMF%2c+whereas+the+normal+is+a+continuous+random+quantity+with+a+PDF.+These+two+distributions+will+always+be+qualitatively+different.+The+similarity+is+measured+in+terms+of+the+CDF%2c+which+has+a+consistent+de%ef%ac%81nition+for+both+discrete+and+continuous+random+quantities.+It+is+the+CDF+of+the+binomial+which+can+be+well+approximated+by+a+normal+CDF.+Fortunately%2c+it+is+the+CDF+which+matters+for+typical+computations+involving+cumulative+probabilities.+When+the+n+and+p+of+a+binomial+distribution+are+appropriate+for+approximation+by+a+normal+distribution%2c+the+approximation+is+done+by+matching+expectation%0d%0a%0d%0a%0cand+variance.+That+is+B(n%2c+p)+Example+Reconsider+the+number+of+heads+X+in+100+tosses+of+an+unbiased+coin.+There+X+%e2%88%bc+B(100%2c+0.5)%2c+which+may+be+well+approximated+as+X+N(50%2c+52).+N(np%2c+np%5b1+%e2%88%92+p%5d).%0d%0a%0d%0aSo%2c+using+normal+tables+we+%ef%ac%81nd+that+P(40+%e2%89%a4+X+%e2%89%a4+60)+0.955+and+P(30+%e2%89%a4+X+%e2%89%a4+70)+1.000%2c+and+these+are+consistent+with+the+exact+calculations+we+undertook+earlier%3a+0.965+and+1.000+respectively.%0d%0a%0d%0aNormal+approximation+of+the+Poisson%0d%0aSince+the+Poisson+is+derived+from+the+binomial%2c+it+is+unsurprising+that+in+certain+circumstances%2c+the+Poisson+distribution+may+also+be+approximated+by+the+normal.+It+is+generally+considered+appropriate+to+make+the+approximation%0d%0a%0d%0a%0cif+the+mean+of+the+Poisson+is+bigger+than+20.+Again+the+approximation+is+done+by+matching+mean+and+variance%3a+X+%e2%88%bc+P(%ce%bb)+Example+Reconsider+the+Poisson+process+for+calls+arriving+at+an+ISP+at+rate+5+per+minute.+Consider+the+number+of+calls+X%2c+received+in+1+hour.+We+have+X+%e2%88%bc+P(5+%c3%97+60)+%3d+P(300)+N(300%2c+300).+N(%ce%bb%2c+%ce%bb)+for+%ce%bb+%3e+20.%0d%0a%0d%0aWhat+is+the+approximate+probability+that+the+number+of+calls+is+between+280+and+310%3f%0d%0a%0d%0a%0c