Tải bản đầy đủ - 0 (trang)
Hack 45. Amaze Your 23 Closest Friends

Hack 45. Amaze Your 23 Closest Friends

Tải bản đầy đủ - 0trang

GettingStarted

Todeterminethechancesofatleasttwopeoplesharinga

birthday,wehavetomakeacoupleofreasonableassumptions

abouthowbirthdaysaredistributed.First,let'sassumethat

birthdaysareuniformlydistributedinthepopulation.This

meansthatapproximatelythesamenumberofpeopleareborn

oneverysingledayoftheyear.

Thisisnotnecessarilyperfectlytrue,butit'scloseenoughfor

ustostilltrustourresults.However,thereisonebirthdayfor

whichthisisdefinitelynottrue:February29,whichoccursonly

everyfouryearsonLeapYear.Thegoodnewsisthatfew

enoughpeoplearebornonFebruary29thatitiseasyforusto

justignoreitandstillgetaccurateestimates.

Oncewe'vemadethesetwoassumptions,wecansolvethe

birthdayproblemwithrelativeease.



ApplyingtheLawofTotalProbability

Inourproblem,thereareonlytwomutuallyexclusivepossible

outcomes:

Atleasttwopeopleshareabirthday.

Noonesharesabirthday.

Sinceoneofthesetwothingsmustoccur,thesumofthetwo

probabilitieswillalwaysbeequaltoone.Statisticianscallthis

theLawofTotalProbability,anditcomesinhandyforthis

problem.



Thetermmutuallyexclusivemeansthatifoneeventoccurs,theother

onecannotoccur,andviceversa.



Asimplecoin-flippingexamplecanhelppicturehowthisworks.

Withafaircoin,theprobabilityofgettingaheadsis0.5,justas

theprobabilityofgettingatailsis0.5(whichisanother

exampleofmutuallyexclusiveevents,becausethecoincan't

comeupheadsandtailsinthesameflip!).Onceyouflipthe

coin,oneoftwothingshastohappen.Itmustlandeitherheads

uportailsup,sotheprobabilityofheadsortailsoccurringis1

(0.5+0.5).Conversely,wecanthinkoftheprobabilityof

headsasoneminustheprobabilityoftails(1-0.5=0.5),and

viceversa.

Sometimes,it'seasiertodeterminetheprobabilityofanevent

notoccurringandthenusethatinformationtodeterminethe

probabilitythatitwilloccur.Theprobabilityofnoonesharinga

birthdayisabiteasiertofigureout,anditdependsonlyonhow

manypeopleareinthegroup.

Imaginethatourgroupcontainsonlytwopeople.What'sthe

probabilitythattheyshareabirthday?Well,theprobabilitythat

theydon'tshareabirthdayiseasytofigure:person#1has

somebirthday,andthereare364otherbirthdaysperson#2

mighthavethatwouldresultinthemnotsharingabirthday.So,

mathematically,it's364dividedby365(thetotalnumberof

possiblebirthdays),or0.997.

Sincetheprobabilityofthetwopeoplenotsharingabirthdayis

0.997(averyhighprobability),theprobabilityofthemactually

sharingabirthdayisequalto1-0.997(0.003,averylow

probability).Thismeansthatonly3outofevery1,000

randomlyselectedpairsofpeoplewillshareabirthday.Sofar,

thismakesperfectlogicalsense.However,thingschange(and

changequickly)oncewestartaddingmorepeopletoourgroup!



CalculatingtheProbabilityofIndependent

Events

Theothertrickweneedtosolveourproblemisapplyingthe

ideaofindependentevents.Two(ormore)eventsaresaidtobe

independentiftheprobabilityoftheirco-occurrenceisequalto

theproductoftheirindividualprobabilities.

Onceagain,thisissimpletounderstandwithanice,easycoinflippingexample.Ifyouflipacointwice,theprobabilityof

gettingheadstwiceisequaltotheprobabilityofheads

multipliedbytheprobabilityofheads(0.5x0.5=0.25),because

theoutcomeofonecoinfliphasnoinfluenceontheoutcomeof

theother(hence,theyareindependentevents).

So,whenyouflipacointwice,oneoutofeveryfourtimesthe

resultswillbetwoheadsinarow.Ifyouwantedtoknowthe

probabilityofflippingthreeheadsinarow,theansweris0.125

(0.5x0.5x0.5),whichmeansthatthreeheadsinarowhappens

onlyonetimeoutofeveryeight.

Inourbirthdayproblem,everytimeweaddanotherpersonto

thegroup,we'veaddedanotherindependentevent(sinceone

person'sbirthdaydoesn'tinfluenceanyoneelse'sbirthday),and

thuswe'llbeabletofigureouttheprobabilityofatleasttwoof

thosepeoplesharingabirthday,regardlessofhowmanypeople

weadd;we'lljustkeeponmultiplyingprobabilitiestogether.

Toreview,nomatterhowmanypeopleareinourgroup,only

oneoftwomutuallyexclusiveeventscanoccur:atleasttwo

peopleshareabirthdayornoonesharesabirthday.Becauseof

theLawofTotalProbability,weknowthatwecandeterminethe

probabilityofnoonesharingabirthday,andoneminusthat

valuewillbeequaltotheprobabilitythatatleasttwosharea

birthday.Lastly,wealsoknowthateachperson'sbirthdayis

independentoftheothergroupmembers.Gotallthat?Good,



let'sproceed!



SolvingtheBirthdayProblem

We'vealreadydeterminedthattheprobabilityoftwopeoplenot

sharingabirthdayinagroupoftwoisequalto0.997.Let'ssay

weaddanotherpersontothegroup.Whatistheprobabilityof

noonesharingabirthday?Thereare363otherbirthdays

person#3couldhavethatwouldresultinnoneofthemsharing

abirthday.Theprobabilityofperson#3notsharingabirthday

withtheothertwoistherefore363/365,or0.995(slightly

lower).

Butremember,we'reinterestedintheprobabilitythatnoone

sharesabirthday,soweusetheruleofindependenteventsand

multiplytheprobabilitythatthefirsttwowon'tshareabirthday

bytheprobabilitythatthethirdpersonwon'tshareabirthday

withtheothertwo:0.997x0.995=0.992.So,inagroupof

threepeople,theprobabilitythatnoneofthemshareabirthday

is0.992,whichmeansthattheprobabilitythatatleasttwoof

themshareabirthdayis0.008(1-0.992).

Thismeansthatonly8outofevery1,000randomlyselected

groupsof3peoplewillresultinatleast2ofthemsharinga

birthday.Thisisstillaprettysmallchance,butnotethatthe

probabilityhasmorethandoubledbymovingfromtwopeople

tothree(0.003comparedto0.008)!

Oncewestartaddingmoreandmorepeopletoourgroup,the

probabilityofatleasttwopeoplesharingabirthdaystartsto

increaseveryquickly.Bythetimeourgroupofpeopleisupto

10,theprobabilityofatleast2sharingabirthdayisupto

0.117.Howdowedeterminethisingeneral?Foreveryperson

addedtothegroup,anotherfractionismultipliedbythe

previousproduct.Eachadditionalfractionwillhave365asthe

denominator,andthenumeratorwillbe365minusthenumber



ofadditionalpeoplebeyondthefirst.

So,forourpreviouslymentionedgroupof10people,the

numeratorforthelastfractionis356(365-9),determinedlike

so:

Thistellsusthattheprobabilityofnoonesharingabirthdayin

agroupof10peopleisequalto0.883(muchlowerthanwhat

wesawfor2or3people),sotheprobabilitythatatleast2of

themwillshareabirthdayis0.117(1-0.883).

Thefirstfractionistheprobabilitythatthesecondpersonwon't

shareabirthdaywiththefirstperson.Thesecondfractionisthe

probabilitythatthethirdpersonwon'tshareabirthdaywiththe

firsttwo.Thethirdfractionistheprobabilitythatthefourth

personwon'tshareabirthdaywiththefirstthree,andsoon.

Theninthandfinalfractionistheprobabilitythatthetenth

personwon'tshareabirthdaywithanyoftheothernine.



Inorderfornoonetoshareabirthday,everysingleoneoftheevents

inthechainhastoco-occur,sowedeterminetheprobabilityofallof

themhappeninginthesamegroupofpeoplebymultiplyingallofthe

individualprobabilitiestogether.Everytimeweaddanotherperson,we

includeanotherfractionintotheequation,whichmakesthefinal

productgetsmallerandsmaller.



SolvingforAlmostAnyGroupSize

Asthegroupsizeincreases,itbecomesincreasinglymorelikely

thatatleasttwopeoplewillshareabirthday.Thismakes

perfectsense,butwhatsurprisesmostpeopleishowquickly

theprobabilityincreasesasthegroupgetsbigger.Figure4-3

illustratestherateatwhichtheprobabilitygoesupwhenyou



addmoreandmorepeople.



Figure4-3.Chancesofmatchingbirthdays



For20people,theprobabilityis0.411;for30people,it's0.706

(meaningthat7timesoutof10youwillwinmoneyonyour

bet,whichareprettygoododds).Ifyouhave23peopleinyour

group,thechancesarejustslightlybetterthan50/50thatat

least2peoplewillshareabirthday(theprobabilityisequalto

0.507).

Whenallissaidanddone,thisisaprettyneattrickthatnever

ceasestosurprisepeople.Butremembertomakethebarbet

onlyifyouhaveatleast23peopleintheroom(andyou're

willingtoaccept50/50odds).Itworksevenbetterwithmore

people,becauseyourchancesofwinninggoupdramatically

everytimeanotherpersonisadded.Tohaveabetterthan90

percentchanceofwinningyourbet,you'llneed41peopleinthe

room(probabilityofatleast2peoplesharingabirthday=

0.903).With50people,there'sa97percentchanceyou'llwin

yourmoney.Onceyouhave60peopleormore,youare

practicallyguaranteedtohaveatleast2peopleintheroom



whoshareabirthdayand,ofcourse,ifyouhave366people

present,thereisa100percentchanceofatleast2people

sharingabirthday.Thosearegreatoddsifyoucanget

someonetotakethebet!

WilliamSkorupski







Hack46.DesignYourOwnBarBet



Withafewcalculations,andperhapssomespreadsheet

software,youcanfiguretheprobabilitiesassociatedwith

allsortsof"spontaneous"friendlywagers.

Severalofthestatisticshackselsewhereinthischapteruse

decksofcards[Hack#42]ordice[Hack#43]aspropsto

demonstratehowsomeseeminglyrareandunusualoutcomes

arefairlycommon.Assomeonewho'sinterestedineducating

theworldonstatisticalprinciples,younodoubtwillwishtouse

theseteachingexamplestoimpressandinstructothers.Hey,if

youhappentowinalittlemoneyalongtheway,that'sjustone

ofthebenefitsofateacher'slife.

Butthere'snoneedtorelyonthespecificexamplesprovided

here,oreventocarrycardsanddicearound(though,knowing

youthewayIthinkIdo,youmighthaveplentyofother

reasonstocarrycardsanddicearound).Hereareacoupleof

basicprinciplesyoucanusetomakeupyourownbarbetwith

anyknowndistributionofdata,suchasthealphabet,numbers

from1to100,andsoon:



Principle1

Anunlikelyeventincreasesinlikelihoodifthereare

repeatedopportunitiesforittooccur.



Principle2



Iftherearealargenumberofpossibleevents,thechance

ofanyspecificeventoccurringseemssmall.

Therestofthishackwillshowyouhowtousetheseprinciples

toyouradvantageinyourowncustom-madebarbets.



Principle1

Theprobabilityofanygiveneventoccurringisequaltothe

numberofoutcomes,whichequaltheeventdividedbythe

numberofpossibleoutcomes.Forexample,whatarethe

chancesthatyouandIwereborninthesamemonth?

Pretendingforasecondthatbirthsaredistributedequally

acrossallmonths,theprobabilityis1/12.Thereisonlyone

outcomethatcountsasamatch(yourbirthmonth),andthere

are12possibleoutcomes(the12monthsoftheyear).

Whatabouttheprobabilitythatanyoneoftwopeoplereading

thisbookhasthesamebirthmonthasme?Intuitively,that

shouldbeabitmorelikelythan1outof12.Theformulato

figurethisoutisnotquiteassimpleasonewouldlike,

unfortunately.Itisnot1/12timesitself,forexample.That

wouldproduceasmallerprobabilitythanwebeganwith(i.e.,

1/24).Noristheformula1/12+1/12.Though2/12seemsto

havepromiseastherightanswerbecauseitisbiggerthan1/12,

indicatingagreaterlikelihoodthanbeforethesesortsof

probabilitiesarenotadditive.Toprovetoyourselfthatsimply

addingthetwofractionstogetherwon'twork,imaginethatyou

had12peopleintheproblem.Thechanceoffindingamatch

withmybirthmonthamongthe12isobviouslynot12/12,

becausethatwouldguaranteeamatch.

Theactualformulaforcomputingthechancesofanevent

occurringacrossmultipleopportunitiesisbasedonthenotionof

takingtheproportionalchancethataneventwillnothappen

andmultiplyingthatproportionbyitselfforeachadditional"roll



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Hack 45. Amaze Your 23 Closest Friends

Tải bản đầy đủ ngay(0 tr)

×