/
ACollectionofDiceProblemswithsolutionsandusefulappendices(aworkcontinu ACollectionofDiceProblemswithsolutionsandusefulappendices(aworkcontinu

ACollectionofDiceProblemswithsolutionsandusefulappendices(aworkcontinu - PDF document

luanne-stotts
luanne-stotts . @luanne-stotts
Follow
385 views
Uploaded On 2016-03-14

ACollectionofDiceProblemswithsolutionsandusefulappendices(aworkcontinu - PPT Presentation

MatthewMConroydoctormatt ID: 255159

MatthewM.Conroydoctormatt

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "ACollectionofDiceProblemswithsolutionsan..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

ACollectionofDiceProblemswithsolutionsandusefulappendices(aworkcontinuallyinprogress)versionApril1,2020 MatthewM.Conroydoctormatt“at”madandmoonlydotcomwww.matthewconroy.com ACollectionofDiceProblemsMatthewM.ConroyThanksAnumberofpeoplehavesentcorrections,commentsandsuggestions,includingRyanAllen,JulienBeasley,RasherBilbo,MichaelBuse,StephenB,PaulElvidge,AmitKumarGoel,StevenHanes,NickHobson,MarcHoltz,ManuelKlein,DavidKorsnack,PeterLandweber,JasonCheuk-ManLeung,PaulMicelli,AlbertNatian,Jo˜aoNeto,KhizarQureshi,MichalStajszczak,DaveTeBokkel,YichuanXuandElieWolfe.Thanks,everyone.2 Chapter1IntroductionandNotesThisisa(slowly)growingcollectionofdice-relatedmathematicalproblems,withaccompanyingsolu-tions.Somearesimpleexercisessuitableforbeginners,whileothersrequiremoresophisticatedtechniques.Manydiceproblemshaveanadvantageoversomeotherproblemsofprobabilityinthattheycanbeinvestigatedexperimentally.Thisgivesthesetypesofproblemsacertainhelpfuldown-to-earthfeel.Pleasefeelfreetocomment,criticize,orcontributeadditionalproblems.1.0.1Whataredice?Intherealworld,dice(thepluralofdie)arepolyhedramadeofplastic,wood,ivory,orotherhardmaterial.Eachfaceofthedieisnumbered,ormarkedinsomeway,sothatwhenthedieiscastontoasmooth,atsurfaceandallowedtocometorest,aparticularnumberisspecied.Mathematically,wecanconsideradietobearandomvariablethattakesononlynitelymanydistinctvalues.Usually,thesevalueswillconstituteasetofpositiveintegers1;2;:::;n;insuchcases,wewillrefertothedieasn-sided.1.0.2TerminologyAfairdieisoneforwhicheachfaceappearswithequallikelihood.Anon-fairdieiscalledxed.Thephrasestandarddiewillrefertoafair,six-sideddie,whosefacesarenumberedonethroughsix.Ifnototherwisespecied,thetermdiewillrefertoastandarddie.3 Chapter2Problems2.1StandardDice1.Onaverage,howmanytimesmusta6-sideddieberolleduntila6turnsup?2.Onaverage,howmanytimesmusta6-sideddieberolleduntila6turnsuptwiceinarow?3.Onaverage,howmanytimesmusta6-sideddieberolleduntilthesequence65appears(i.e.,a6followedbya5)?4.Onaverage,howmanytimesmusta6-sideddieberolleduntiltherearetworollsinarowthatdifferby1(suchasa2followedbya1or3,ora6followedbya5)?Whatifwerolluntiltherearetworollsinarowthatdifferbynomorethan1(sowestopatarepeatedroll,too)?5.Werolla6-sideddientimes.Whatistheprobabilitythatallfaceshaveappeared?6.Werolla6-sideddientimes.Whatistheprobabilitythatallfaceshaveappearedinorder,insomesixconsecutiverolls(i.e.,whatistheprobabilitythatthesubsequence123456appearsamongthenrolls)?7.PersonArollsndiceandpersonBrollsmdice.Whatistheprobabilitythattheyhaveacommonfaceshowing(e.g.,personArolleda2andpersonBalsorolleda2,amongalltheirdice)?8.Onaverage,howmanytimesmusta6-sideddieberolleduntilallsidesappearatleastonce?Whataboutforann-sideddie?9.Onaverage,howmanytimesmusta6-sideddieberolleduntilallsidesappearatleasttwice?10.Onaverage,howmanytimesmustapairof6-sideddiceberolleduntilallsidesappearatleastonce?11.Supposewerollndice.Whatistheexpectednumberofdistinctfacesthatappear?12.Supposewerollndiceandkeepthehighestone.Whatisthedistributionofvalues?13.Supposewecanrolla6-sideddieuptontimes.Atanypointwecanstop,andthatrollbecomesour“score”.Ourgoalistogetthehighestpossiblescore,onaverage.Howshouldwedecidewhentostop?14.Howmanydicemustberolledtohaveatleasta95%chanceofrollingasix?4 ACollectionofDiceProblemsMatthewM.Conroy15.Howmanydicemustberolledtohaveatleasta95%chanceofrollingaoneandatwo?Whataboutaone,atwo,andathree?Whataboutaone,atwo,athree,afour,aveandasix?16.Howmanydiceshouldberolledtomaximizetheprobabilityofrollingexactlyonesix?twosixes?nsixes?17.Supposewerollafairdie100times.Whatistheprobabilityofarunofatleast10sixes?18.Supposewerollafairdieuntilsomefacehasappearedtwice.Forinstance,wemighthavearunofrolls12545or636.Howmanyrollsonaveragewouldwemake?Whatifwerolluntilafacehasappearedthreetimes?19.Supposewerollafairdie10times.Whatistheprobabilitythatthesequenceofrollsisnon-decreasing(i.e.,thenextrollisneverlessthanthecurrentroll)?20.Supposeapairofdicearethrown,andthenthrownagain.Whatistheprobabilitythatthefacesappearingonthesecondthrowarethesameastherst?Whatifthreediceareused?Orsix?21.Asingledieisrolleduntilarunofsixdifferentfacesappears.Forexample,onemightrollthese-quence535463261536435344151612534withonlythelastsixrollsalldistinct.Whatistheexpectednumberofrolls?22.Whatisthemostprobable:rollingatleastonesixwithsixdice,atleasttwosixeswithtwelvedice,oratleastthreesixeswitheighteendice?(Thisisanoldproblem,frequentlyconnectedwithIsaacNewton.)23.Supposewerollndice,removeallthedicethatcomeup1,androlltherestagain.Ifwerepeatthisprocess,eventuallyallthedicewillbeeliminated.Howmanyrolls,onaverage,willwemake?Show,forinstance,thatonaveragefewerthanO(logn)throwsoccur.24.Supposewerolladie6ktimes.Whatistheprobabilitythateachpossiblefacecomesupanequalnumberoftimes(i.e.,ktimes)?Findanasymptoticexpressionforthisprobabilityintermsofk.25.Calla“consecutivedifference”theabsolutevalueofthedifferencebetweentwoconsecutiverollsofadie.Forexample,thesequenceofrolls14351hasthecorrespondingsequenceofconsecutivedifferences3;1;2;4.Whatistheexpectednumberoftimesweneedtorolladieuntilall6consecutivedifferenceshaveappeared?2.2DiceSums26.Showthattheprobabilityofrolling14isthesamewhetherwethrow3diceor5dice.Arethereotherexamplesofthisphenomenon?27.Showthattheprobabilityofrollingasumof9withapairof5-sideddiceisthesameasrollingasumof9withapairof10-sideddice.Arethereotherexamplesofthisphenomenon?Canweprovethereareinnitelymanysuch?28.Supposewerollndiceandsumthehighest3.Whatistheprobabilitythatthesumis18?5 ACollectionofDiceProblemsMatthewM.Conroy29.Fourfair,6-sideddicearerolled.Thehighestthreearesummed.Whatisthedistributionofthesum?30.Threefair,n-sideddicearerolled.Whatistheprobabilitythatthesumoftwoofthefacesrolledequalsthevalueoftheotherrolledface?31.Afair,n-sideddieisrolleduntilarollofkorgreaterappears.Allrollsaresummed.Whatistheexpectedvalueofthesum?32.Apairofdiceisrolledrepeatedly.Whatistheexpectednumberofrollsuntilallelevenpossiblesumshaveappeared?Whatifthreedicearerolleduntilallsixteenpossiblesumshaveappeared?33.Adieisrolledrepeatedlyandsummed.Whatcanyousayabouttheexpectednumberofrollsuntilthesumisgreaterthanorequalton?34.Adieisrolledrepeatedlyandsummed.Showthattheexpectednumberofrollsuntilthesumisamultipleofnisn.35.Afair,n-sideddieisrolledandsummeduntilthesumisatleastn.Whatistheexpectednumberofrolls?36.Adieisrolledandsummedrepeatedly.Whatistheprobabilitythatthesumwilleverbeagivenvaluex?Whatisthelimitofthisprobabilityasx!1?37.Adieisrolledandsummedrepeatedly.Letxbeapositiveinteger.Whatistheprobabilitythatthesumwilleverbexorx+1?Whatistheprobabilitythatthesumwilleverbex,x+1,orx+2?Etc.?38.Adieisrolledonce;calltheresultN.ThenNdicearerolledonceandsummed.Whatisthedistributionofthesum?Whatistheexpectedvalueofthesum?Whatisthemostlikelyvalue?Whattheheck,takeitonemorestep:rolladie;calltheresultN.RollNdiceonceandsumthem;calltheresultM.RollMdiceonceandsum.What'sthedistributionofthesum,expectedvalue,mostlikelyvalue?39.Adieisrolledonce.CalltheresultN.Then,thedieisrolledNtimes,andthoserollswhichareequaltoorgreaterthanNaresummed(otherrollsarenotsummed).Whatisthedistributionoftheresultingsum?Whatistheexpectedvalueofthesum?40.Supposensix-sideddicearerolledandsummed.Foreachsixthatappears,wesumthesix,andrerollthatdieandsum,andcontinuetorerollandsumuntilwerollsomethingotherthanasixwiththatdie.Whatistheexpectedvalueofthesum?Whatisthedistributionofthesum?41.Adieisrolleduntilallsumsfrom1toxareattainablefromsomesubsetofrolledfaces.Forexample,ifx=3,thenwemightrolluntila1and2arerolled,oruntilthree1sappear,oruntiltwo1sanda3.Whatistheexpectednumberofrolls?42.Howlong,onaverage,doweneedtorolladieandsumtherollsuntilthesumisaperfectsquare(1;4;9;16;:::)?43.Howlong,onaverage,doweneedtorolladieandsumtherollsuntilthesumisprime?Whatifwerolluntilthesumiscomposite?6 ACollectionofDiceProblemsMatthewM.Conroy2.3Non-StandardDice44.Showthattheprobabilityofrollingdoubleswithanon-fair(“xed”)dieisgreaterthanwithafairdie.45.Isitpossibletohaveanon-fairsix-sideddiesuchthattheprobabilityofrolling2;3;4;5;and6isthesamewhetherwerollitonceortwice(andsum)?Whataboutforothernumbersofsides?46.Findapairof6-sideddice,labelledwithpositiveintegersdifferentlyfromthestandarddice,sothatthesumprobabilitiesarethesameasforapairofstandarddice.47.Isitpossibletohavetwonon-fairn-sideddice,withsidesnumbered1throughn,withthepropertythattheirsumprobabilitiesarethesameasfortwofairn-sideddice?48.Isitpossibletohavetwonon-fair6-sideddice,withsidesnumbered1through6,withauniformsumprobability?Whataboutn-sideddice?49.Supposethatwerenumberthreefair6-sideddice(A;B;C)asfollows:A=f2;2;4;4;9;9g,B=f1;1;6;6;8;8g,andC=f3;3;5;5;7;7g.(a)FindtheprobabilitythatdieAbeatsdieB;dieBbeatsdieC;dieCbeatsdieA.(b)Discuss.50.Findeverysix-sideddiewithsidesnumberedfromthesetf1,2,3,4,5,6gsuchthatrollingthedietwiceandsummingthevaluesyieldsallvaluesbetween2and12(inclusive).Forinstance,thedienumbered1,2,4,5,6,6isonesuchdie.Considerthesumprobabilitiesofthesedice.Doanyofthemgivesumprobabilitiesthatare“moreuniform”thanthesumprobabilitiesforastandarddie?Whatifwerenumbertwodicedifferently-canwegetauniform(ormoreuniformthanstandard)sumprobability?51.Let'smakepairsofdicethatonlysumtoprimevalues.Ifweminimizethesumofallthevaluesonthefaces,whatdicedowegetfor2-sideddice,3-sideddice,etc.?52.ShowthatyoucannothaveapairofdicewithmorethantwosidesthatonlygivessumsthatareFibonaccinumbers.2.4GameswithDice53.Twoplayerseachrolladie.Player1rollsafairm-sideddie,whileplayer2rollsafairnsideddie,withm�n.Thewinneristheonewiththehigherroll.WhatistheprobabilitythatPlayer1wins?Whatistheprobabilityofatie?Iftheplayerscontinuerollinginthecaseofatieuntiltheydonottie,whichplayerhasthehigherprobabilityofwinning?IfthetiemeansawinforPlayer1(orplayer2),whatistheirprobabilityofwinning?54.CrapsThegameofcrapsisperhapsthemostfamousofalldicegames.Theplayerbeginbythrowingtwostandarddice.Ifthesumofthesediceis7or11,theplayerwins.Ifthesumis2,3or12,theplayerloses.Otherwise,thesumbecomestheplayer'spoint.Theplayercontinuestorolluntileitherthepointcomesupagain,inwhichcasetheplayerwins,ortheplayerthrows7,inwhichcasetheylose.Thenaturalquestionis:whatisaplayer'sprobabilityofwinning?7 ACollectionofDiceProblemsMatthewM.Conroy55.Non-StandardCrapsWecangeneralizethegamesofcrapstoallowdicewithotherthansixsides.Supposeweusetwo(fair)n-sideddice.Thenwecandeneagameanalogoustocrapsinthefollowingway.Theplayerrollstwon-sideddice.Ifthesumofthesediceisn+1or2n�1,theplayerwins.Ifthesumofthesediceis2;3or2n,thentheplayerloses.Otherwisethesumbecomestheplayer'spoint,andtheywiniftheyrollthatsumagainbeforerollingn+1.Wemayagainask:whatistheplayer'sprobabilityofwinning?56.YahtzeeTherearemanyprobabilityquestionswemayaskwithregardtothegameofYahtzee.Forstarters,whatistheprobabilityofrolling,inasingleroll,(a)Yahtzee(b)Fourofakind(butnotYahtzee)(c)Threeofakind(butnotfourofakindorYahtzee)(d)Afullhouse(e)Alongstraight(f)Asmallstraight57.MoreYahtzeeWhatistheprobabilityofgettingYahtzee,assumingthatwearetryingjusttogetYahtzee,wemakereasonablechoicesaboutwhichdicetore-roll,andwehavethreerolls?Thatis,assumewe'reinthesituationwhereallwehavelefttogetinagameofYahtzeeisYahtzee,sothatallotheroutcomesareirrelevant.58.DropDeadInthegameofDropDead,theplayerstartsbyrollingvestandarddice.Ifthereareno2'sor5'samongthevedice,thenthedicearesummedandthisistheplayer'sscore.Ifthereare2'sor5's,thesedicebecome“dead”andtheplayergetsnoscore.Ineithercase,theplayercontinuesbyrollingallnon-deaddice,addingpointsontothescore,untilalldicearedead.Forexample,theplayermightrollf1;3;3;4;6gandscore17.Thentheyrollallthediceagainandgetf1;1;2;3;5gwhichresultsinnopointsandtwoofthedicedying.Rollingthethreeremainingdice,theymightgetf2;3;6gforagainnoscore,andonemoredeaddie.Rollingtheremainingtwotheymightgetf4;6gwhichgivesthem10points,bringingthescoreto27.Theyrollthetwodiceagain,andgetf2;3gwhichgivesnopointsandanotherdeaddie.Rollingtheremainingdie,theymightgetf3gwhichbringsthescoreto30.Rollingagain,theygetf5gwhichbringsthisplayer'sroundtoanendwith30points.Somenaturalquestionstoaskare:(a)Whatistheexpectedvalueofaplayer'sscore?(b)Whatistheprobabilityofgettingascoreof0?1?20?etc.59.ThreesInthegameofThrees,theplayerstartsbyrollingvestandarddice.Inthegame,thethreescountaszero,whiletheotherfacescountnormally.Thegoalistogetaslowasumaspossible.Oneachroll,atleastonediemustbekept,andanydicethatarekeptareaddedtotheplayer'ssum.Thegamelastsatmostverolls,andthescorecanbeanywherefrom0to30.Forexampleagamemightgolikethis.Ontherstrolltheplayerrolls2�3�3�4�68 ACollectionofDiceProblemsMatthewM.ConroyTheplayerdecidestokeepthe3s,andsohasascoreofzero.Theotherthreedicearerolled,andtheresultis1�5�5Heretheplayerkeepsthe1,sotheirscoreis1,andre-rollstheothertwodice.Theresultis1�2Here,theplayerdecidestokeepbothdice,andtheirnalscoreis4.Ifaplayerplaysoptimally(i.e.,usingastrategywhichminimizestheexpectedvalueoftheirscore),whatistheexpectedvalueoftheirscore?60.Supposeweplayagamewithadiewherewerollandsumourrollsaslongaswekeeprollinglargervalues.Forinstance,wemightrollasequencelike1-3-4andthenrolla2,sooursumwouldbe8.Ifwerolla6rst,thenwe'rethroughandoursumis6.Threequestionsaboutthisgame:(a)Whatistheexpectedvalueofthesum?(b)Whatistheexpectedvalueofthenumberofrolls?(c)Ifthegameisplayedwithann-sideddie,whathappenstotheexpectednumberofrollsasnapproachesinnity?61.Supposeweplayagamewithadiewherewerollandsumourrolls.Wecanstopanytime,andthesumisourscore.However,ifoursumiseveramultipleof10,ourscoreiszero,andourgameisover.Whatstrategywillyieldthegreatestexpectedscore?Whataboutthesamegameplayedwithvaluesotherthan10?62.Supposeweplayagamewithadieinwhichweusetworollsofthedietocreateatwodigitnumber.Theplayerrollsthedieonceanddecideswhichofthetwodigitstheywantthatrolltorepresent.Then,theplayerrollsasecondtimeandthisdeterminestheotherdigit.Forinstance,theplayermightrolla5,anddecidethisshouldbethe“tens”digit,andthenrolla6,sotheirresultingnumberis56.Whatstrategyshouldbeusedtocreatethelargestnumberonaverage?Whataboutthethreedigitversionofthegame?63.Supposewerollasingledie,repeatedlyifwelike,andsum.Wecanstopatanypoint,andthesumbecomesourscore;however,ifweexceeed10,ourscoreiszero.Whatshouldourstrategybetomaximizetheexpectedvalueofourscore?Whatistheexpectedscorewiththisoptimalstrategy?Whataboutlimitsbesides10?9 Chapter3Discussion,Hints,andSolutions3.1SingleDieProblems1.Onaverage,howmanytimesmusta6-sideddieberolleduntila6turnsup?Thisproblemisaskingfortheexpectednumberofrollsuntila6appears.LetXbetherandomvariablerepresentingthenumberofrollsuntila6appears.ThentheprobabilitythatX=1is1=6;theprobabilitythatX=2is(5=6)(1=6)=5=36.Ingeneral,theprobabilitythatX=kis5 6k�11 6(3.1)since,inorderforXtobek,theremustbek�1rollswhichcanbeanyofthenumbers1through5,andthena6,whichappearswithprobability1=6.WeseektheexpectationofX.ThisisdenedtobeE=1Xn=1nP(X=n)(3.2)whereP(X=n)istheprobabilitythatXtakesonthevaluen.Thus,E=1Xn=1n5 6n�11 6=6 51 61Xn=1n5 6n(3.3)UsingEquationB.3fromAppendixB,wecanconcludethatE=6 51 65=6 (1�(5=6))2=6:(3.4)Thus,onaverage,ittakes6throwsofadiebeforea6appears.Here'sanother,quitedifferentwaytosolvethisproblem.Whenrollingadie,thereisa1=6chancethata6willappear.Ifa6doesn'tappear,thenwe'reinessencestartingover.Thatistosay,thenumberoftimesweexpecttothrowthediebeforea6showsupisthesameasthenumberofadditionaltimesweexpecttothrowthedieafterthrowinganon-6.Sowehavea1=6chanceofrollinga6(andstopping),10 ACollectionofDiceProblemsMatthewM.Conroyanda5=6chanceofnotrollingasix,afterwhichthenumberofrollsweexpecttothrowisthesameaswhenwestarted.WecanformulatethisasE=1 6+5 6(E+1):(3.5)SolvingforE,wendE=6.NotethatEquation3.5implicitlyassumesthatEisanitenumber,whichissomethingthat,apriori,wedonotnecessarilyknow.2.Onaverage,howmanytimesmusta6-sideddieberolleduntila6turnsuptwiceinarow?Wecansolvethisusingarecurrencerelationon,E,theexpectednumberofrolls.Whenwestartrolling,weexpect,onaverage6rollsuntila6showsup.Oncethathappens,thereisa1/6chancethatwewillrolloncemore,anda5/6chancethatwewillbe,effectively,startingalloveragain,andsohaveasmanyadditionalexpectedrollsaswhenwestarted.Asaresult,wecansayE=6+1 61+5 6(E+1):Solvingthis,wendthatE=42.3.Onaverage,howmanytimesmusta6-sideddieberolleduntilthesequence65appears(i.e.,a6followedbya5)?Thisappearstobequitesimilartoproblem2,butthereisadifference.Inproblem2,oncewerolla6,thereareonlytwopossibilities:eitherwerolla6,orwestartalloveragain.Inthisproblem,oncewerolla6,therearethreepossibilities:(a)werolla5,(b),werolla6,or(c)westartalloveragain.Wecanagainsolveitusingrecursion,butwe'llneedtwoequations.LetEbetheexpectednumberofrollsuntil65andletE6betheexpectednumberofrollsuntil65whenwestartwitharolled6.Then:E6=1 6(E6+1)+4 6(E+1)+1 6(1)E=1 6(E6+1)+5 6(E+1)Thisgivesusasystemoftwolinearequationsintwounknowns,whichwecansolvetondE=36;E6=30:Soittakesfewerrollsonaveragetoseea6followedbya5thanitdoestoseea6followedbya6.4.Onaverage,howmanytimesmusta6-sideddieberolleduntiltherearetworollsinarowthatdifferby1(suchasa2followedbya1or3,ora6followedbya5)?Whatifwerolluntiltherearetworollsinarowthatdifferbynomorethan1(sowestopatarepeatedroll,too)?LetEbetheexpectednumberofrolls.LetEibetheexpectednumberofrollsafterrollingani(notfollowingarollofi�1ori+1).ThenwehaveE=1+1 6(E1+E2+E3+E4+E5+E6):Bysymmetry,weknowthatE1=E6,E2=E5andE3=E4,soE=1+2 6(E1+E2+E3):11 ACollectionofDiceProblemsMatthewM.ConroyWecanexpressE1asE1=1+2 6E1+1 6E2+2 6E3sincetherewilldenitelybeanadditionalroll,thereisa1 6chancethatthiswillbethelastroll(i.e.,werolla2)andtheveotherpossibilitiesareequallylikely.Similarly,E2=1+1 6E1+2 6E2+1 6E3andE3=1+2 6E1+1 6E2+1 6E3:Thisgivesusasystemofthreelinearequationsinthreeunknowns.Solving,wendE1=70 17;E2=58 17;andE3=60 17andsoE=239 51=4:68627450980::::Ifwestopwhenwehavearepeatedroll,too,thesituationissimilar.DeningE;E1;E2;andE3asabove,wehavethesystemE=1+2 6(E1+E2+E3)E1=1+1 6E1+1 6E2+2 6E3E2=1+1 6E1+1 6E2+1 6E3E3=1+2 6E1+1 6E2:Solvingthis,wendE1=288 115;E2=246 115;andE3=252 115:andsoE=377 115=3:278260869565::::5.Werolla6-sideddientimes.Whatistheprobabilitythatallfaceshaveappeared?LetP(n)standfortheprobabilitythatallfaceshaveappearedinnrolls.TodetermineP(n),wecanusetheprincipleofinclusion-exclusion.Wewishtocountthenumberofrollsequencesthatdonotcontainallfaces.Thereare6nwaystorolladientimes.Ofthese,5nhaveno1,5nhaveno2,etc.Simplyaddingthosewillnotyieldwhatweseek,sincetherearerollsequencesthatcontainno1andno2(forexample),sowewouldbecountingthosetwice.Asaresult,wetakethatsumandsubtractalltherollsequenceswithbothno1andno2,orbothno1andno3,etc.12 ACollectionofDiceProblemsMatthewM.ConroyAgain,wewillnothavequitewhatwewish,sincewewillhaveremovedsequencesthatcontain,say,bothno1andno2,andno1andno3,twice.Hence,wehavetoaddbackinthenumberofsequencesthatfailtohavethreefaces.Wecontinueinthisway,alternatingsubtractingandaddingnumbersofsequences,untilwereachthenalcount:nosequencecanfailtohaveall6faces.Alltogether,then,wendthatthenumberofsequencesthatfailtohaveall6facesis615n�624n+633n�642n+651n:Hence,theprobabilityofhavingall6facesappearinnrollsofthedieis1�615 6n+624 6n�633 6n+642 6n�651 6n=1�65 6n+152 3n�201 2n+151 3n�61 6n=6n�65n+154n�203n+152n�6 6n:Hereisashorttableofvaluesofthisprobability.n P(n)exactly P(n)approximately 1 0 0 2 0 0 3 0 0 4 0 0 5 0 0 6 5/324 0.01543210 7 35/648 0.05401235 8 665/5832 0.11402606 9 245/1296 0.18904321 10 38045/139968 0.27181213 11 99715/279936 0.35620642 12 1654565/3779136 0.43781568 13 485485/944784 0.51385819 14 317181865/544195584 0.58284535 15 233718485/362797056 0.64421274 16 2279105465/3265173504 0.69800440 17 4862708305/6530347008 0.74463245 18 553436255195/705277476864 0.78470712 19 1155136002965/1410554953728 0.81892308 20 2691299309615/3173748645888 0.84798754 36 0.99154188 6.Werolla6-sideddientimes.Whatistheprobabilitythatallfaceshaveappearedinorder,insomesixconsecutiverolls(i.e.,whatistheprobabilitythatthesubsequence123456appearsamongthenrolls)?Thisisarathertediouscalculation,butanicewaytohandleitisasaMarkovchain.Wedeneazerostate(thestatewestartin,andthestateweareinifthecurrentrollsvaluewasnotprecededbythesmallervaluesinorder(e.g.,ifthecurrentrollisa2,butthepreviousrollwasnota1),andthensixstatescorrespondingtohavingacurrent“streak”of1;12;123;1234;12345;123456.Callthesestates13 ACollectionofDiceProblemsMatthewM.Conroyonethroughsix.Thelaststateisanabsorbingstate.Wethanhavethefollowingtransitionmatrix:M=0BBBBBBBBBBBBBBB@5 61 6000002 31 61 600002 31 601 60002 31 6001 6002 31 60001 602 31 600001 600000011CCCCCCCCCCCCCCCAThen,theprobabilitypweseekisthelastentryintherstrowofMn.Usingacomputeralgebrasystem,theseprobabilitiescanbecalculatedexactly.Hereisashorttableofvalues,calculatedexactlyandthenconvertedtodecimalapproximations.np,approx.60:0000214334705170:0000428669410280:0000643004115290:00008573388203100:0001071673525110:0001286008230120:0001500338342130:0001714663859140:0001928984782150:0002143301111160:0002357612847170:0002571919988180:0002786222536190:0003000520490200:0003214813850300:0005357494824400:0007499716542500:00096414791021000:0020343407992000:0041712885505000:0105547158510000:0211029602120000:0418632906850000:1015397384100000:1928556782200000:3485878704300000:4742727525400000:5757077184500000:6575715999600000:7236404850700000:7769618947800000:8199953550900000:85472584521000000:88275535862000000:98625516743000000:9983886648Itmaybeusefultonotethat,forn�1000,say,p1�1�1 66nisaquitegoodapproximation.7.PersonArollsndiceandpersonBrollsmdice.Whatistheprobabilitythattheyhaveacommonfaceshowing(e.g.,personArolleda2andpersonBalsorolleda2,amongalltheirdice)?Wewillassume6-sideddice.LetXbethemultisetoffacesthatpersonArolls,andYbethemultisetoffacesthatpersonBrolls.WewanttheprobabilityP((12Xand12Y)or(22Xand22Y)or:::):14 ACollectionofDiceProblemsMatthewM.ConroyLetAibetheevent“i2Xandi2Y”.Then,wewant,byanapplicationoftheinclusion-exclusionprinciple,P 6[i=1Ai!=XSf1;:::;6gS6=?(�1)jSj�1P \i2SAi!:Now,supposeSf1;:::;6g,withS=fj1;:::;jjSjg.ThenP \i2SAi!=P(j1;:::;jjSj2X)P(j1;:::;jjSj2Y):Let r=P(j1;:::;jr2X).Then,applyinginclusion-exclusionagain, r=P(j1;:::;jr2X)=1�P(j162Xorj262Xor:::)=1�P r[i=1ji62X!=1�XSf1;:::;rgS6=?(�1)jSj�1P \i2Sji62X!=1�XSf1;:::;rgS6=?(�1)jSj�11�jSj 6n=1�rXi=1(�1)i�11�i 6nri:Similarly,letting r=P(j1;:::;jr2Y),wehave r=1�rXi=1(�1)i�11�i 6mri:andsoP \i2SAi!=XSf1;:::;6gS6=?(�1)jSj�1 jSj jSj=6Xi=1(�1)i�1 i i6i:HereareafewcalculatedvaluesofP,theprobabilityofacommonface,forvariousnandm.15 ACollectionofDiceProblemsMatthewM.ConroynmPP,approx.111=60:16666661211=360:30555552237=720:51388881391=2160:421296223851=12960:6566358336151=77760:791023614671=12960:5177469241957=25920:75501543440571=466560:86957734486557=933120:9276084559856951=100776960:978095666120194317=1209323520:99389718.Onaverage,howmanytimesmusta6-sideddieberolleduntilallsidesappearatleastonce?Whataboutforann-sideddie?Torolluntileverysideofthedieappears,webeginbyrollingonce.Wethenrolluntiladifferentsideappears.Sincethereare5differentsideswecouldroll,thistakes,onaverage,1 5=6=6 5rolls.Thenwerolluntilasidedifferentfromthetwoalreadyrolledappears.Thisrequires,onaverage,1 4=6=6 4rolls.Continuingthisprocess,andusingtheadditivenatureofexpectation,weseethat,onaverage,1+6 5+6 4+6 3+6 2+6 1=147 10=14:7rollsareneededuntilall6sidesappearatleastonce.Forann-sideddie,thenumberofrollsneeded,onaverage,is1+n n�1+n n�2++n 1=nXi=1n i=nnXi=11 i:Forlargen,thisisapproximatelynlogn.(ThisproblemisanexampleofwhatisoftenreferredtoasaCouponCollector'sproblem.Wecanimaginethatapersonistryingtocollectasetofndistinctcoupons.Eachday(say)theygetanewcoupon,whichhasaxedprobabilityofbeingoneofthentypes.Wemaythenaskfortheexpectednumberofdaysuntilallncouponshavebeencollected.Thisproblemisanalogoustothesituationinwhichallncoupontypesareequallylikely.Foramorecomplicatedversion,seeproblem32.)9.Onaverage,howmanytimesmusta6-sideddieberolleduntilallsidesappearatleasttwice?Thisisquiteabitmorecomplicatedthanthepreviousproblem(wherewerolluntileachsideappearsatleastonce).ModelingtheproblemwithaMarkovchainishelpfulhere.Aswerollthedie,weneedtokeeptrackofhowmanytimeseachsidehasappeared.Aftereachroll,then,wecancapturethestateofourrollingwithavector,hx1;x2;x3;x4;x5;x6i,wherexiisthenumberoftimessideihasappearedsofar.Sinceweareonlyinterestedinrollingallsidestwice,wecantakexi2f0;1;2g(thatis,evenifwerollasidemorethantwice,wekeepxiat2-itdoesnotmatterhowmanytimeswehaverolleditaslongasitisatleast2).WecouldmakeaMarkovchainusingthesevectorsasourstates.Thiswouldgiveusachainwith36=729states,hencerequiringa729729transitionmatrix.16 ACollectionofDiceProblemsMatthewM.ConroyHowever,wecanutilizethesymmetryofourdicetoreducethenumberofstatesconsiderably.Be-causeallsidesofthedieareequallylikely,wedonotactuallyneedthevectortorepresentthestate,butonlythecorrespondingmultisetofvalues.Forexample,thevectorsh0;1;1;2;0;0irepresents,inessence,thesamestateash2;0;1;0;1;0i.Bothcorrespondtothemultisetf0;0;0;1;1;2g.Further,sinceeachmultisethassixelements,wecanrepresentoneofthesemultisetswithanorderedpair(a;b)whereaisthenumberof1'sandbisthenumberof2'sintheset.Thus,forexample,thestatevectorh1;0;1;0;0;0icanbedenotedby(2;0),andthevectorh2;1;0;1;0;0icanbedenotedby(2;1).Therollingbegins,then,inthestate(0;0)andendsinthestate(0;6).Thus,oursetofstatesconsistsofallorderedpairs(a;b)wherea;b2f0;1;:::;6ganda+b6.Thisgivesus28states.Wethencancalculatetransitionprobabilitiesasfollows.Thetransitionfrom(a;b)to(a+1;b)occurswithprobabilityp=1�a+b 6.Thisisbecause6�(a+b)isthecurrentnumberofzeros,andsopgivestheprobabilityofrollingoneofthesidesthathavenotappearedyet.Ifb6,thenthetransitionfrom(a;b)to(a�1;b+1)occurswithprobabilityp=a 6.Thisisbecauseaisthenumberofsideswhichhaveappearedexactlyoncesofar,andpgivestheprobabilityofrollingoneofthesesides,convertingthecorresponding1intoa2,andhenceincreasingthenumberof2'sandreducingthenumberof1'sbyoneeach.Thetransitionfrom(a;b)to(a;b)occurswithprobabilityp=b 6.Thisisbecausebisthenumberof2's,andsopgivestheprobabilityofrollingoneofthecorrespondingsides,whichdoesnotchangethecountsatall.Thetransitionprobabilitiesgiveasingleabsorbingstate,(0;6).Orderingthesestates(0;0);(1;0);(2;0);:::;(0;5);(1;5);(0;6),wehavethefollowingtransitionmatrix:17 ACollectionofDiceProblemsMatthewM.ConroyP=1 60BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB@06000000000000000000000000000050000100000000000000000000000400002000000000000000000000003000030000000000000000000000020000400000000000000000000000100005000000000000000000000000000060000000000000000000000150000000000000000000000000001400010000000000000000000000013000200000000000000000000000120003000000000000000000000001100040000000000000000000000010000500000000000000000000000240000000000000000000000000002300100000000000000000000000022002000000000000000000000000210030000000000000000000000002000400000000000000000000000033000000000000000000000000000320100000000000000000000000003102000000000000000000000000030030000000000000000000000000420000000000000000000000000004110000000000000000000000000040200000000000000000000000000510000000000000000000000000005100000000000000000000000000061CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCAApplyingthemethodsofAppendixD,wecandeterminefromthismatrixthattheexpectednumberofrollsuntilallsideshaveappearedatleastonceis390968681 16200000=24:1338692::::WecanalsousematrixPtocalculatetheprobabilityqthatafterjrollsallsideshaveappearedatleasttwice.Herearesomevalues:18 ACollectionofDiceProblemsMatthewM.Conroyj q 11 012 0:003438285:::13 0:014899238:::14 0:037661964:::15 0:072748752:::16 0:119155589:::17 0:174576398:::18 0:236147670:::19 0:301007601:::20 0:366633348:::21 0:430995652:::22 0:492589321:::23 0:550391734:::30 0:828548154:::34 0:906280939:::39 0:957121359:::49 0:991461443:::62 0:999009173:::ThisproblemisanexampleofwhatisoftenreferredtoasaCouponCollector'sproblem.10.Onaverage,howmanytimesmustapairof6-sideddiceberolleduntilallsidesappearatleastonce?WecansolvethisbytreatingtherollingofthediceasaMarkovprocess.Thismeansthatweviewourgameasbeingalwaysinoneofanumberofstates,withaxedprobabilityofmovingfromonestatetoeachotherstateinonerollofthedice.Wecandeneourstatesbythenumberofsideswehaveseenappearsofar.Thus,westartsinState0,andwewishtoendupinState6,reachingsome,orall,ofStates1,2,3,4and5alongtheway.Ontheveryrstroll,wewillmovefromState0toeitherState1orState2.WemovetoState1withprobability6 36,sincethishappensexactlyifweroll“doubles”.Otherwise,wemovetoState2,sowemovetoState2fromState0withprobability30 36.Thus,ourquestioncanbestatedthus:startinginState0,whatistheexpectednumberofrollsuntilwereachState6?Wedeterminethetransitionprobabilities,theprobabilityoftransitioningfromonestatetoanotherinoneroll.Wecancreateadiagramlikethisthatshowstheprobabilityofmovingfromonestatetoeachotherstateinoneroll: 0 1 2 3 4 5 6 6 36 30 36 1 36 15 36 20 36 4 36 20 36 12 36 9 36 21 36 6 36 16 36 18 36 2 36 25 36 11 36 1 Tosolvetheproblem,wecreateatransitionmatrixforthisprocessasfollows.Weletrow1representState0,row2representstate1,etc.Thenthei,j-thentryinthematrixistheprobabilityoftransitionfromtherowistatetotherowjstateinoneroll(thatis,fromstatei�1tostatej�1).19 ACollectionofDiceProblemsMatthewM.ConroyForthisprocess,ourtransitionmatrixisP=0BBBBBBBBBBBBBBB@01 65 6000001 365 125 9000001 95 91 3000001 47 121 6000004 91 21 180000025 3611 3600000011CCCCCCCCCCCCCCCAThematrixQasdescribedinAppendixDisthenQ=0BBBBBBBBBBBB@01 65 600001 365 125 900001 95 91 300001 47 121 600004 91 20000025 361CCCCCCCCCCCCAThematrixN=(I�Q)�1asdescribedAppendixDisthen0BBBBBBBBBBBB@16 3557 5637 4243 28461 154036 3527 5647 4241 28463 154009 85 631 20329 1100004 37 5166 5500009 5162 550000036 111CCCCCCCCCCCCASummingtherstrowwendtheexpectednumberofrollsuntilallsixsideshaveappeared=1+6 35+57 56+37 42+43 28+461 154=70219 9240=7:59945887445::::BylookingatthelastentryoftherstrowofpowersofthematrixP,wecanndtheprobabilityofreachingstate6inagivennumberofrolls:20 ACollectionofDiceProblemsMatthewM.Conroyrolls probabilityofreachingthisstateinexactlythisnumberofrolls probabilityofreachingthisstateonorbe-forethisnumberofrolls 1 0 0 2 0 0 3 5=3240:015432099 5=3240:015432099 4 575=58320:098593964 665=58320:11402606 5 22085=1399680:15778607 38045=1399680:27181213 6 313675=18895680:16600355 1654565=37791360:43781568 7 78924505=5441955840:14502967 317181865=5441955840:58284535 8 376014275=32651735040:11515905 2279105465=32651735040:69800440 9 61149474755=7052774768640:086702719 553436255195=7052774768640:78470712 10 401672322475=63474972917760:063280424 2691299309615=31737486458880:84798754 11 0.045328994 0.89331653 12 0.032098630 0.92541516 13 0.022567579 0.94798274 14 0.015795289 0.96377803 15 0.011023854 0.97480189 16 0.0076798753 0.98248176 17 0.0053441053 0.98782587 18 0.0037160115 0.99154188 19 0.0025827093 0.99412459 20 0.0017945018 0.99591909 21 0.0012466057 0.99716570 22 0.00086588683 0.99803158 23 0.00060139404 0.99863298 24 0.00041767196 0.99905065 Soweseethatthereisalessthanoneinathousandchancethatmorethan24rollswouldbeneeded,forinstance.Additionalquestion:Whatifweroll3(orgreaternumber)diceatatime?Wecananswerthatwithanothersix-stateMarkovprocess;onlythetransitionprobabilitieswouldchange.(SpecialthankstoSteveHanesandGabeforsendingmethisniceproblem.)11.Supposewerollndice.Whatistheexpectednumberofdistinctfacesthatappear?LetEbethesoughtexpectation.Iwillgivethreedistinctsolutions.LetXbethenumberofdistinctfacesappearinginnrollsofadie.Usingtheinclusion-exclusionprinciple,wehavethefollowingprobabilities:P(X=1)=611 6nP(X=2)=622 6n�211 6nP(X=3)=633 6n�322 6n+311 6nP(X=4)=644 6n�433 6n+422 6n�411 6nP(X=5)=655 6n�544 6n+533 6n�522 6n+511 6n21 ACollectionofDiceProblemsMatthewM.ConroyP(X=6)=666 6n�655 6n+644 6n�633 6n+622 6n�611 6nTheseexpressionsdeterminethedistributionofthenumberofdistinctfacesinnrolls.Tondtheexpectation,wewantE=6Xi=1iP(X=i)and,aftersomechewing,thissimpliestoE=6�65 6n:Here'sadifferentapproach.Theprobabilitythatthej-throllwillyieldafacedistinctfromallpreviousfacesrolledis65j�1 6j=5 6j�1since,thinkinginreverse,thereare6facesthej-throllcouldbe,andthen5j�1waystorollj�1rollsnotincludingthatface,outofatotal6jwaystorolljdice.Asaresult,theexpectedcontributionfromthej-throlltothetotalnumberofdistinctfacesisjusttheprobabilitythatthej-throllisdistinct:therollcontributes1withthatprobability,and0otherwise.Usingtheadditivityofexpectation,wethushaveE=nXj=15 6j�1=6 50@nXj=05 6j�11A=6 5 1��5 6n+1 1�5 6�1!=6�65 6n:Forathirdsolution,letXibearandomvariabledenedbyXi=(1ifthefaceiappearsinnrollsofadie,0otherwise.LetXbethenumberofdistinctfacesappearinginnrollsofadie.ThenX=X1+X2+X3++X6andsotheexpectedvalueofXisE(X)=E(X1)+E(X2)++E(X6)=6E(X1)bysymmetry.Now,theprobabilitythata1hasappearedinnrollsisP(X1=1)=1�5 6nandsoE(X1)=1P(X1=1)=1�5 6n22 ACollectionofDiceProblemsMatthewM.ConroyandthustheexpectednumberofdistinctfacesappearinginnrollsofadieisE=6E(X1)=61�5 6n:Here'sashorttableofvaluesofE.n E 1 12 1:833 2:5274 3:106 4815 3.588734...6 3.990612...7 4.325510...8 4.604591...9 4.837159...10 5.030966...14 5.532680...23 5.909430...27 5.956322...36 5.991535...48 5.999050...12.Supposewerollndiceandkeepthehighestone.Whatisthedistributionofvalues?Let'sndtheprobabilitythatthehighestnumberrolledisk.Amongthendicerolled,theymustallshowkorless.Theprobabilityofthisoccurringiskn 6n:However,ifk�1,someoftheserollsdonotactuallyhaveanyk's.Thatis,theyaremadeupofonlythenumbers1throughk�1.Theprobabilityofthisoccurring,foranyk2f1;:::;ng,is(k�1)n 6nsotheprobabilitythatthehighestnumberrollediskiskn�(k�1)n 6n:So,forinstance,theprobabilitythat,if7dicearerolled,thehighestnumbertoturnupwillbe3is37�27 67=2059 670:007355:13.Supposewecanrolla6-sideddieuptontimes.Atanypointwecanstop,andthatrollbecomesour“score”.Ourgoalistogetthehighestpossiblescore,onaverage.Howshouldwedecidewhentostop?Ifn=1,thereisnodecisiontomake;onaverageourscoreis7/2.23 ACollectionofDiceProblemsMatthewM.ConroyIfn=2,wewanttostickiftherstrollisgreaterthan7/2;thatis,ifitis4orgreater.Otherwise,werollagain.Thus,withn=2,ouraveragescoreis1 64+1 65+1 66+3 67 2=17 4=4:25:Ifn=3,wewanttostickontherstrollifitisgreaterthan4.25;thatis,ifitis5or6.Otherwise,weareinthen=2case.Thus,withn=3,ouraveragescoreis1 65+1 66+4 617 4=4:666::::Ingeneral,ifweletf(n)betheexpectedvalueofourscorewithnrollsleft,usings-sideddice,wehavetherecursionf(n)=bf(n�1)c sf(n�1)+sXj=bf(n�1)c+1j swithf(1)=(s+1)=2.Wemaythencalculate,fors=6,thefollowingtable:n f(n) 1 7/2=3.5 2 17/4=4.25 3 14/3=4.666.. 4 89/18=4.944... 5 277/54=5.1296... 10 5.6502... 21 5.95292... 30 5.9908762... 43 5.9991472... Thus,fora6-sideddie,wecansummarizethestrategyasfollows:Ifthereareatleast5rollsleft,stickonlyon6.Ifthereare4,3,or2rollsleft,stickon5or6.Ifthereisonly1rollleft,stickon4,5or6.14.Howmanydicemustberolledtohaveatleasta95%chanceofrollingasix?99%?99.9%?Supposewerollndice.Theprobabilitythatnoneofthemturnupsixis5 6nandsotheprobabilitythatatleastoneisasixis1�5 6n:Tohavea95%chanceofrollingasix,weneed1�5 6n0:9524 ACollectionofDiceProblemsMatthewM.Conroywhichyieldsnlog0:05 log(5=6)=16:43:::�16:Hence,n17willgiveatleasta95%chanceofrollingatleastonesix.Sincelog(0:01)=log(5=6)=25:2585:::,26diceareneededtohavea99%chanceofrollingatleastonesix.Similarly,sincelog(0:001)=log(5=6)=37:8877:::,38diceareneededfora99:9%chance.15.Howmanydicemustberolledtohaveatleasta95%chanceofrollingaoneandatwo?Whataboutaone,atwo,andathree?Whataboutaone,atwo,athree,afour,aveandasix?Solvingthisproblemrequirestheuseoftheinclusion-exclusionprinciple.Ofthe6npossiblerollsofndice,5nhavenoone's,and5nhavenotwo's.Thenumberthathaveneitherone'snortwo'sisnot5n+5nsincethiswouldcountsomerollsmorethanonce:ofthose5nrollswithnoone's,somehavenotwo'seither.Thenumberthathaveneitherone'snortwo'sis4n,sothenumberofrollsthatdon'thaveatleastoneone,andatleastonetwois5n+5n�4n=25n�4nandsotheprobabilityofrollingaoneandatwowithndiceis1�25n�4n 6n:Thisisanincreasingfunctionofn,andbydirectcalculationwecanshowthatit'sgreaterthan0:95forn21.Thatis,ifwerollatleast21dice,thereisatleasta95%chancethattherewillbeaoneandatwoamongthefacesthatturnup.Toincludethree's,weneedtoextendthemethod.Ofthe6npossiblerolls,thereare5nrollsthathavenoone's,5nthathavenotwo's,and5nthathavenothree's.Thereare4nthathaveneitherone'snortwo's,4nthathaveneitherone'snorthree's,and4nthathaveneithertwo'snorthree's.Inaddition,thereare3nthathavenoone's,two's,orthree's.So,thenumberofrollsthatdon'thaveaone,atwo,andathreeis5n+5n+5n�4n�4n�4n+3n=35n�34n+3n:Hence,theprobabilityofrollingatleastoneone,onetwo,andonethreeis1�35n�34n+3n 6n:Thisisagainanincreasingfunctionofn,anditisgreaterthan0:95whenn23.Finally,todeterminetheprobabilityofrollingatleastoneone,two,three,four,veandsix,weextendthemethodevenfurther.Theresultisthattheprobabilityp(n)ofrollingatleastoneofeverypossiblefaceisp(n)=1�5Xj=1(�1)(j+1)6j6�j 6n=1�61 6n+151 3n�201 2n+152 3n�65 6n:Thisexceeds0:95whenn27.Belowisatableshowingsomeoftheprobabilitiesforvariousn.25 ACollectionofDiceProblemsMatthewM.Conroy n p(n) 6 0.0154... 7 0.0540... 8 0.1140... 9 0.1890... 10 0.2718... 11 0.3562... 12 0.4378... 13 0.5138... 14 0.5828... 15 0.6442... 16 0.6980... 17 0.7446... 18 0.7847... 19 0.8189... 20 0.8479... 21 0.8725... 22 0.8933... 23 0.9107... 24 0.9254... 25 0.9376... 26 0.9479... 27 0.9565... 30 0.9748... 35 0.9898... 40 0.9959... 16.Howmanydiceshouldberolledtomaximizetheprobabilityofrollingexactlyonesix?twosixes?nsixes?Supposewerollndice.Theprobabilitythatexactlyoneisasixis�n15n�1 6n=n5n�1 6n:Thequestionis:forwhatvalueofnisthismaximal?Ifn�6then(n+1)5n 6n+1n5n�1 6n,sothemaximummustoccurforsomen6.Here'satablethatgivestheprobabilities:nn5n�1 6n11/6=0.1666...25/18=0.2777...325/72=0.3472...4125/324=0.3858...53125/7776=0.4018...63125/7776=0.4018...Thisshowsthatthemaximumprobabilityis3125 7776,anditoccursforbothn=5andn=6.Fortwosixes,thecalculationissimilar.Theprobabilityofexactlytwosixeswhenrollingndiceis�n25n�2 6n=n(n�1)5n�2 26n26 ACollectionofDiceProblemsMatthewM.ConroyAquickcalculationshowsthatthisismaximalforn=12orn=11.Itseemsthatfornsixes,themaximalprobabilityoccurswith6nand6n�1dice.I'llletyouprovethat.17.Supposewerollafairdie100times.Whatistheprobabilityofarunofatleast10sixes?Wewillconsiderthisproblemgenerally.Letpnbetheprobabilityofarunofatleastrsuccessesinnthrows.Let betheprobabilityofsuccessonanyonethrow(sowhenthrowingasinglefairdie, =1=6.)Clearlypn=0ifnr.Wecandeterminepn+1intermsofpnandpn�r.Therearetwowaysthatarunofrcanhappeninn+1throws.Either(a)thereisarunofrintherstnthrows,or(b)thereisnot,andthenalrthrowsofthen+1areallsuccesses.Theprobabilityof(a)occurringispn.Tocalculatetheprobabilityof(b),rstnotethatfor(b)tooccur,threethingshavetohappen:(a)Thereisnorunoflengthrintherstn�rthrows;thishappenswithprobability1�pn�r.(b)Onthrownumbern�r+1,wedonotgetasuccess.Ifwedid,thenwewouldhavearunofrsuccessesintherstnthrows(sincethenalrthrowsareallsuccesses).Theprobabilityhereis1� .(c)Thenalrthrowsareallsuccesses.Theprobabilityofthisis r.Sincethesethreeeventsareindependent,wendthatpn+1=pn+(1�pn�r)(1� ) r:Sincerand arexed,thisisalinearrecurrenceequation,andwehaveinitialconditionsp0=p1=:::=pr�1=0;andpr= r:Ifwetaken=r,wendpr+1=pr+(1�p0)(1� ) r= r+(1� ) r= r(2� ):andthenpr+2=pr+1+(1�p1)(1� ) r= r(3�2 ):Similarly,ifr&#x-278;2thenpr+3=pr+2+(1�p2)(1� ) r= r(3�2 )+(1� ) r= r(4�3 ):So,forinstance,theprobabilityofarunofatleast3sixeswhenadieisthrown5timesis(withr=3and =1=6)p5=1 633�2 6=1 81andifthedieisthrown6timestheprobabilityisp6=1 634�3 6=7 432=1 61:714::::27 ACollectionofDiceProblemsMatthewM.ConroyWiththisrecurrenceequation,wecancalculateanexpressionforpr+3;pr+4;etc.Toanswerthequestion“whatistheprobabilityofarunof10sixesin100throwsofafairdie?”wewishtocalculatep100with =1=6andr=10.Usingafreecomputeralgebrasystem(likePARI/GP),wecandeterminethat,withr=10and =1=6,p100=�10 99+135 98�720 97+2100 96�3780 95+4410 94�3360 93+1620 92�450 91+55 90�125970 88+1085280 87�4069800 86+8682240 85�11531100 84+9767520 83�5155080 82+1550400 81�203490 80�2035800 77+14844375 76�46314450 75+80159625 74�83128500 73+51658425 72�17813250 71+2629575 70�3838380 66+23688288 65�60865740 64+83347680 63�64155780 62+26320320 61�4496388 60�2118760 55+10824100 54�22108800 53+22569400 52�11515000 51+2349060 50�487635 44+1984760 43�3028470 42+2053200 41�521855 40�54740 33+166635 32�169050 31+57155 30�3160 22+6400 21�3240 20�90 11+91 10=2138428277869029245997109282919411017852189744280011307296262359092389 1701350582031434651293464237390775574315478412689986644643416579087232139264=0:00000125690042984:::=1 795607:97::::18.Supposewerollafairdieuntilsomefacehasappearedtwice.Forinstance,wemighthavearunofrolls12545or636.Howmanyrollsonaveragewouldwemake?Whatifwerolluntilafacehasappearedthreetimes?Fortherstpartofthequestion,wecanenumerateeasilythepossibilities.LetXbethenumberofrollsmadeuntilafacehasappearedtwice.WewouldliketoknowP(X=x)for2x7.IntheX=2case,ourrunofrollsmusthavetheformAA,where1A6.Sothereare6suchruns,outof62possible.Hence,P(X=2)=6 62=1 6:IntheX=3case,ourrunofrollsmusthavetheformABAorBAA,andsoP(X=3)=265 63=5 18:IntheX=4case,ourrunofrollsmusthavetheformABCA,BACA,orBCAA,andsoP(X=4)=3654 64=5 18:Similarly,wehaveP(X=5)=46543 65=5 27P(X=6)=565432 66=25 324P(X=7)=6654321 67=5 32428 ACollectionofDiceProblemsMatthewM.ConroyThusweseethatX=3andX=4aretiedasthemostlikely,andtheexpectednumberofrollsis7Xi=2iP(X=i)=1223 324=3:7746913580246::::Whenrollinguntilafaceappearsthreetimes,thingsarealittlemorecomplex.Forfun,IthoughtoftreatingthisasaMarkovchain.Thenumberofstatesisquitelarge:asweroll,wekeeptrackofthenumberof1's,2's,etc.thathavebeenrolled.Hencetherewillbe36=729statestoconsider,plustheabsorbingstate,foratotalof730states.Wecanmapthenumberofappearancesofeachfacetoastatebyafunctionasfollows.Supposethenumberofappearancesoffaceiisai.ThenwecannumberthecurrentstateasS=1+a1+3a2+32a3+33a4+34a5+35a6Then,wecreateatransitionmatrixtoexpresstheprobabilityofgoingfromstateStostateT,forallpossiblestates.HereissomeGP/PARIcodewhichdoesthis:\\defineafunctiontomapthevectoroffacecountstoastatenumberstate(a,b,c,d,e,f)=1+a+3*b+9*c+27*d+81*e+243*f;\\\initializeamatrixforthetransitionprobabilitiesA=matrix(730,730);\\\generatetheprobabilitiesandputtheminthematrixfor(a1=0,2,for(a2=0,2,for(a3=0,2,for(a4=0,2,for(a5=0,2,for(a6=0,2,\print(a1);\\\visthevectorofcountsv=vector(6);v[1]=a1;v[2]=a2;v[3]=a3;v[4]=a4;v[5]=a5;v[6]=a6;\\\sisthestates=state(a1,a2,a3,a4,a5,a6);\\\lookathowmanyfacecountsareequalto2,\\sincethereisa1/6chanceforeach\\suchfacethatwe'llgototheabsorbingstatefromherec=0;for(i=1,6,if(v[i]==2,c=c+1));\print(c);\\\createanewvectorwofthecounts,\\thenincreaseeachface(withcount)byone,\\andseewherewego,give1/6probabilityofgoingtothatstatew=vector(6);for(i=1,6,w[i]=v[i]);\A[s+1,0+1]=c/6;\for(i=1,6,for(j=1,6,w[j]=v[j]);\if(w[i]()\A[s+1,ss+1]=1/6;\))\))))))OncewehavethetransitionmatrixA,wecancalculateAnforn=1;:::;13anddeterminetheprobabilitiesofendinginexactlynrolls:29 ACollectionofDiceProblemsMatthewM.Conroyn P(X=n) P(Xn) 1 0 0 2 0 0 3 1 36=0:027 1 36=0:027 4 5 72=0:0694 7 72=0:972 5 25 216=0:1157407 23 108=0:212962::: 6 25 162=0:154320::: 119 324=0:367283::: 7 25 144=0:17361 701 1296=0:540895::: 8 1295 7776=0:166538::: 5501 7776=0:707433::: 9 175 1296=0:135030::: 6551 7776=0:842463::: 10 175 1944=0:0900205::: 2417 2592=0:932484::: 11 4375 93312=0:0468857::: 91387 93312=0:979370::: 12 9625 559872=0:0171914::: 557947 559872=0:996561::: 13 1925 559872=0:00343828::: 1 Wendtheexpectednumberofrollstobe13Xi=1iP(X=i)=4084571 559872=7:2955443387059899::::Additionalquestions:whatifwerolluntilafaceappears4times,or5times,etc?19.Supposewerollafairdie10times.Whatistheprobabilitythatthesequenceofrollsisnon-decreasing(i.e.,thenextrollisneverlessthanthecurrentroll)?Forexample,thesequencef1;2;2;2;3;4;5;5;5;6gisanon-decreasingsequence.Thetotalnumberofpossiblerollsequencesis610.Howmanyofthesearenon-decreasing?Anexcellentobservationisthateverynon-decreasingsequenceisequivalenttoa“histogram”orvectorwhichgivesthenumberoftimeseachfaceappears.Forexample,thesequencef1;2;2;2;3;4;5;5;5;6gisequivalenttothevectorh1;3;1;1;3;1i.Byequivalent,Imeanthatthereisaone-to-onecorrespondencebetweenthesequencesandvectors.So,countingoneisequivalenttocountingtheother.Thus,wewishtocounthowmanywayscan10indistinguishablethingsbeplacedinto6bins,whereweallowforzeroitemstobeplacedinsomebins.Tocountthat,weobservethatthisisequivalenttothenumberofwaystoplace16indistinguishablethingsinto6bins,whereeachbinmustcontainatleastoneitem.Subtractingonefromeachbinwillgiveusavectoroftheprevioussort.Tocountthis,wecanusethestars-and-barsmethod.Putting16thingsinto6binsisequivalenttoputting5barsamong16stars,suchthatthereisatmostonebarbetweenanytwostars.Forinstance,thischoiceofbars:jjjjj30 ACollectionofDiceProblemsMatthewM.Conroyrepresentsthevectorh3;5;2;1;4;1iwhich,ifwesubtractonefromeachcomponentyieldsthevectorh2;4;1;0;3;0iwhichcorrespondstotherolledsequence1;1;2;2;2;2;3;5;5;5.Sincethereare16stars,thereare15placesforbars,andhencethenumberofsuchsequencesis155=3003Thus,theprobabilityofrollingsuchasequenceisaverylow3003 610=1001 20155392=0:0000496641295788:::=1 20135:25674:::Generally,forasequenceofnrolls,theprobabilityispn=�n+6�15 6nHereisatableofsomevaluesnpn1127 12=0:58337 27=0: 25947 72=0:097257 216=0:032 407677 7776=0:00990226:::711 3888=0:00282921:::8143 186624=0:000766246:::91001 5038848=0:000198656:::101001 20155293=0:0000496641:::Thevalueofp12isgreaterthanone-in-a-million,butp13isless.20.Supposeapairofdicearethrown,andthenthrownagain.Whatistheprobabilitythatthefacesappearingonthesecondthrowarethesameastherst?Whatifthreediceareused?Orsix?Wemayconsidertwocases.Iftwodicearethrown,theresultwilleitherbetwodifferentfaces,orthesamefacetwice.Wemaynotatethesetwocasesas“AB”and“AA”(thiswillbeusefullater).Theprobabilitythattwodifferentfaceswillappearis65 62=5 6andtheprobabilitythatthesecondthrowwillbethesameastherstinthiscaseis2 62:Thus,theprobabilitythatthesecondrollwillrepeattherstinthiswayis652 64=5 108:31 ACollectionofDiceProblemsMatthewM.ConroyTheotherpossibilityofofrollingdoubles.Thiscasegivesaprobabilityof6 621 62=6 64=1 216ofoccurring.Addingtogether,wendtheprobabilityofthesecondthrowbeingidenticaltotherstis5 108+1 216=11 216=0:0509259::::Ifwethrowthreedice,therearemorecasestoconsider.ThesecasesmaybeexpressedasAAA,AAB,andABC.(Forexample,throwingf1;3;3gwouldbeanexampleoftheAABcase,whilef2;4;5gwouldbeanexampleoftheABCcase.)Theprobabilityofrepeatingviaeachcaseisasfollows:AAA(61) 63�1 63=6 66AAB(61)(51)(31) 63�3 63=270 66ABC(63)3! 63�3! 63=720 66Therstfactorineachcaseistheprobabilityofrollingthatcase,andthesecondistheprobabilityofrollingthesamesetoffacesasecondtime.Addingthese,weseethattheprobabilityofrepeatingwiththreediceis996 66=83 3888=0:02134773662551::::Forsixdice,theproblemissimilar,justwithmorecases.Hereisthecalculation:AAAAAA�6 66�1 66=6 612AAAAAB65(61) 66�6 66=1080 612AAAABB65(62) 66(62) 66=6750 612AAAABC654(65) 66(62) 66=54000 612AAABBB(62)(63) 66(63) 66=6000 612AAABBC654(62)(41) 66��62�41=432000 612AAABCD6543(63) 66�654 66=864000 612AABBCC 654(62)(42) 3! 66!(62)(42) 66=162000 612AABBCD 6543(62)(42)(21) 22 66!(62)(42)(21) 66=2916000 612AABCDE 65432(62)(41)(31)(21) 4! 66!(62)(41)(31)(21) 66=3888000 612ABCDEF�6! 66�6! 66=518400 612(Forexample,rollingf1;2;3;3;5;5gwouldbeanexampleoftheAABBCDcase.)32 ACollectionofDiceProblemsMatthewM.ConroyTherstfactorineachcaseistheprobabilityofrollingthatcase,andthesecondistheprobabilityofrollingthesamesetoffacesasecondtime.Addingtheprobabilitiesforallcasesgivesatotalprobabilityof8848236 612=737353 181398528=0:004064823502:::21.Asingledieisrolleduntilarunofsixdifferentfacesappears.Forexample,onemightrollthesequence535463261536435344151612534withonlythelastsixrollsalldistinct.Whatistheexpectednumberofrolls?Wemaysolvethisbycreatingasetoflinearrecurrenceequations.LetEibetheexpectednumberofrollsfromapointwherethelastirollsweredistinct.WeseekE0.WehavethenE0=1+E1(3.6)E1=1+1 6E1+5 6E2(3.7)E2=1+1 6E1+1 6E2+4 6E3(3.8)E3=1+1 6E1+1 6E2+1 6E3+3 6E4(3.9)E4=1+1 6E1+1 6E2+1 6E3+1 6E4+2 6E5(3.10)E5=1+1 6E1+1 6E2+1 6E3+1 6E4+1 6E5+1 6E6(3.11)E6=0(3.12)Thelastzerorollsaredistinctonlybeforetherollshavestarted,soE0=1+E1sincetheremustbearoll,andthattakesustothestatewherethelast1rollisdistinct.Thenanotherrolloccurs;atthispoint,withprobability1/6therollisthesameasthelastroll,andsoweremaininthesamestate,or,withprobability5/6,adifferentfaceappears,andthenthelasttworollsaredistinct.Thepatterncontinuesthisway.Thuswehaveasystemofsevenlinearequationsinsevenunknowns,whichissolvableviamanymethods.TheresultisE0=416 5=83:2E1=411 5=82:2E2=81E3=396 5=79:2E4=378 5=75:6E5=324 5=64:8Thus,onaverage,itwilltake83.2rollsbeforegettingarunofsixdistinctfaces.33 ACollectionofDiceProblemsMatthewM.Conroy22.Whatisthemostprobable:rollingatleastonesixwithsixdice,atleasttwosixeswithtwelvedice,oratleastthreesixeswitheighteendice?(Thisisanoldproblem,frequentlyconnectedwithIsaacNewton.)Onewaytosolvethisistosimplycalculatetheprobabilityofeach.Theprobabilityofrollingexactlymsixeswhenrollingrsix-sideddiceisrm5r�m 6rsotheprobabilityofrollingatleastmsixeswhenrollingrsix-sideddiceisp(m;r)=rXi=mri5r�i 6r:Grindingthroughthecalculationsyieldsp(1;6)=31031 466560:66510202331961591221p(2;12)=1346704211 21767823360:61866737373230871348p(3;18)=15166600495229 253899891671040:59734568594772319497sothatweseethatthesixdicecaseistheclearwinner.23.Supposewerollndice,removeallthedicethatcomeup1,androlltherestagain.Ifwerepeatthisprocess,eventuallyallthedicewillbeeliminated.Howmanyrolls,onaverage,willwemake?Show,forinstance,thatonaveragefewerthanO(logn)throwsoccur.Weexpectthat,onaverage,5/6ofthedicewillbeleftaftereachthrow.So,afterkthrows,weexpecttohaven�5 6kdiceleft.Whenthisislessthan2,wehave,onaveragelessthan6throwsleft,sothenumberofthrowsshouldbe,onaverage,somethinglessthanaconstanttimelogn.LetMnbetheexpectednumberofthrowsuntilalldiceareeliminated.Then,thinkingintermsofaMarkovchain,wehavetherecurrenceformulaMn=1 6n+5 6n(1+Mn)+n�1Xj=1(1+Mj)nn�j5j 6nwhichallowsustosolveforMn:Mn=1+5n+n�1Xj=1(1+Mj)nn�j5j 6n�5nHereareafewvaluesofMn.34 ACollectionofDiceProblemsMatthewM.Conroy n Mn 1 6 2 8.72727272727273 3 10.5554445554446 4 11.9266962545651 5 13.0236615075553 6 13.9377966973204 7 14.7213415962620 8 15.4069434778816 9 16.0163673664838 10 16.5648488612594 15 18.6998719821123 20 20.2329362496041 30 22.4117651317294 40 23.9670168145374 50 25.1773086926527 WeseethatMnincreasesquiteslowly,anothersuggestionthatMn=O(logn).Toshowthis,supposeMjClogjforall2jn.ThenwehaveMn1+5n+maxf1+6;1+Clog(n�1)gn�1Xj=1nn�j5j 6n�5n=1+5n+Clog(n�1)(6n�5n�1) 6n�5n=C1�1 6n�5nlog(n�1)+1+5n 6n�5nClognifandonlyif1�1 6n�5nlog(n�1) logn+1+5n Clogn(6n�5n)1SinceM2=log213,wemaysupposeC=13.Itisnothardtoshowtheaboveinequalityholdsforalln,andhenceMn13lognforalln2.24.Supposewerolladie6ktimes.Whatistheprobabilitythateachpossiblefacecomesupanequalnumberoftimes(i.e.,ktimes)?Findanasymptoticexpressionforthisprobabilityintermsofk.Inthe6krolls,wewantkofthemtoappearastheface“1”.Thereare6kkwaysthiscanoccur.Therearethen5kkwaysfork2stooccuramongthe6k�k=5kremainingspots.Continuing,wecanconcludethatthereare6kk5kk4kk3kk2kkkkwaystorollsanequalnumberofeachfacewhenrolling6ktimes.Hencetheprobabilityofthishappeningis�6kk�5kk�4kk�3kk�2kk�kk 66k=(6k)! (k!)666k35 ACollectionofDiceProblemsMatthewM.Conroyaftersimplication.ByapplyingStirling'sapproximationforthefactorial,limn!1n! p 2n�n en=1wecanapproximatetheprobabilityas(6k)! (k!)666kp 26k�6k e6k p 2k�k ek666k=26k (2k)3=p 6 (2)5=2k�5=2LetP(k)betheprobabilityofrollinganequalnumberofallfacesin6krollsofadie.Thenwehavelimk!1P(k) p 6 (2)5=2k�5=2=1:25.Calla“consecutivedifference”theabsolutevalueofthedifferencebetweentwoconsecutiverollsofadie.Forexample,thesequenceofrolls14351hasthecorrespondingsequenceofconsecutivedifferences3;1;2;4.Whatistheexpectednumberoftimesweneedtorolladieuntilall6consecutivedifferenceshaveappeared?WecansolvethiswithaMarkovchain.Here,wecandenethestatetobeapair(d;S),wheredisthelatestrollofthedie,andSisthesetofdifferencesalreadyachieved.Forcomputation,wecandeneavectorha1;a2;a3;a4;a5;a6iwithai=1ifi2S,andai=0ifi62S.Wecanthenconvertthestatepair(d;S)intoauniquenon-negativeintegerbys=64(d�1)+6Xi=12i�1ai:Thus,eachstatecorrespondstoarowofa384384matrix.Wemaydenea385throw(andcolumn)correspondingtotheabsorbing,“nished”state,sinceoncewehaveachievedalldifferences,itdoesnotmatterwhatadditionalrollsoccur.Wethencalculate,foreachstate,thenewstateattainedbyrolling1;2;:::6onthenextrollandaddthisinformationtocreatethetransitionmatrix.HereissomeGPcodethatdoesthis:{A=vector(6);M=matrix(64*6+1,64*6+1);36 ACollectionofDiceProblemsMatthewM.Conroyfor(a0=0,1,for(a1=0,1,for(a2=0,1,for(a3=0,1,for(a4=0,1,for(a5=0,1,for(d=1,6,A=[a0,a1,a2,a3,a4,a5];state1=64*(d-1)+sum(i=1,6,2ˆ(i-1)*A[i]);for(e=1,6,diff=abs(d-e);B=A;B[diff+1]=1;if(B==[1,1,1,1,1,1],M[state1+1,64*6+1]=M[state1+1,64*6+1]+1/6,state2=64*(e-1)+sum(i=1,6,2ˆ(i-1)*B[i]);M[state1+1,state2+1]=M[state1+1,state2+1]+1/6;)))))))));M[385,385]=1;}WethenletthematrixQbeMwiththelastrowandcolumnremoved,andcalculateN=(I�Q)�1(asdescribedinAppendixD).Ifwesumrows1,1+64,1+642,etc.,wendthattheexpectednumberofrollsneededafterstartingthesequencewitharollofdare(approximately)123.77122103041073289277579517225.27138286232360165381869693325.50271996489307011817416107425.50271996489307011817416107525.27138286232360165381869693623.77122103041073289277579517andsinceeachofthesestartingrollsisequallylikely,theaverageofthese,plus1,yieldstheoverallexpectednumberofrollsneededuntilallabsolutedifferenceshaveoccurred:672875275767847611958914137 2603156098760672834779400025:84844128587580155492288439:Notethatinthetableabove,a1or6ontherstrollmarkedlyreducestheexpectednumberofrolls,sincewemustrolla1anda6consecutivelyatsomepoint,whereasallotherdifferencescanbeachievedinmorethanoneway.3.2DiceSums26.Showthattheprobabilityofrolling14isthesamewhetherwethrow3diceor5dice.Thisseemslikeatediouscalculation,anditis.Tosavesometrouble,wecanuseacomputeralgebrasystemtodeterminethecoefcientofx14inthepolynomials(x+x2+x3+x4+x5+x6)3and(x+x2+x3+x4+x5+x6)5(seeAppendixCforanexplanationofthismethod).Theyare15and540,respectively,andsotheprobabilityinquestionis15 63=540 65=5 72.Arethereotherexamplesofthisphenomenon?Yes.Letpd(t;n)betheprobabilityofrollingasumoftwithnd�sideddice.Then:p3(5;2)=p3(5;3)=2 9p3(10;4)=p3(10;6)=10 8137 ACollectionofDiceProblemsMatthewM.Conroyp4(9;3)=p4(9;4)=5 32p6(14;3)=p6(14;5)=5 72p9(15;2)=p9(15;4)=4 81p20(27;2)=p20(27;3)=7 200Questions:Arethereothers?Canwendallofthem?27.Showthattheprobabilityofrollingasumof9withapairof5-sideddiceisthesameasrollingasumof9withapairof10-sideddice.Arethereotherexamplesofthisphenomenon?Canweprovethereareinnitelymanysuch?Here,byam-sideddie,wemeanadiewithsides1;2;:::;mallwithequalprobabilityofbeingthrown.Since1 5�x+x2+x3+x4+x52=1 25x10+2 25x9+3 25x8+4 25x7+1 5x6+4 25x5+3 25x4+2 25x3+1 25x2and1 10�x+x2+x3+x4+x5+x6+x7+x8+x9+x1021 100x20+1 50x19++9 100x10+2 25x9+7 100x8+++1 100x2wemayconcludethattheprobabilityofrolling9withapairof5-sideddiceisthesameaswithapairof10-sideddice.Therearelotsofexamples.Hereisashorttableofsome:sides1sides2sum510951510102017103019136526176833Arethereinnitelymanysuchexamples?Wehavethefollowingtheorem.Theorem1Letmbeapositiveinteger.Thenm�1isdivisibleby8orthesquareofanoddprimeifandonlyifthereexistpositiveintegerss1ands2,s1s2,suchthattheprobabilityofrollingasumofmwithapairofs1-sideddiceisthesameaswithapairofs2-sideddice.Proof:Letmbeapositiveinteger.Supposethereexists1ands2asdescribedinthetheorem.Fromthenatureoftheprobabilitydistributionsofsumsofapairofdice,wecanconcludethatm�1 s2=2s1�m+1 s21orequivalently,m=1+2s1s22 s21+s22:38 ACollectionofDiceProblemsMatthewM.ConroyLetr=gcd(s1;s2),^s1=s1 r,and^s2=s2 r.Thenm=1+2r^s1^s22 ^s21+^s22:LetR=m�1.Thenwehave^s21R+^s22R=2r^s1^s22:Notethat,sinces1s2,wecannothave^s2=1andsothereexistsaprimepthatdivides^s2.Hence,p2dividesR.Ifp=2,weconcludethat8dividesR.Hencem�1iseitherdivisibleby8orbythesquareofanoddprime.Now,supposemisapositiveinteger.LetR=m�1.SupposeRisdivisiblebythesquareofanoddprimeorby8.IfRisdivisiblebyanoddprime,letpbethatprime;else,letp=2.Thenlet^s2=pand^s1=1.Letr=1+p2 2R p2:ThenR=2r^s1^s22 ^s21+^s22:Lets1=(1+p2)R 2p2ands2=(1+p2)R 2p:Thenm=1+2s1s22 s21+s22andsotheprobabilityofrollingasumofmwithapairofs1-sideddiceisthesameaswithapairofs2-sideddice.Thus,theinnitesequenceofsuchsumsbegins9;10;17;19;25;26;28;33;37;41;46;49;50;:::.Questions:Isthereanicewaytocharacterizethenumbersofsidesforwhichthereexistanothernumberofsidesfordiceyieldingequalsumprobabilities?Thesequencebegins5;10;13;15;17;20;25;26;30;35;39;40;45;50;51;52;60;65;68;70;75;78;80;85;90;100;::::28.Supposewerollndiceandsumthehighest3.Whatistheprobabilitythatthesumis18?Inorderforthesumtobe18,theremustbeatleastthree6'samongthendice.So,wecouldcalculateprobabilitythatthereare3,4,5,...,n6'samongthendice.Thesumoftheseprobabilitieswouldbetheprobabilityofrolling18.Sincencouldbemuchgreaterthan3,aneasierwaytosolvethisproblemistocalculatetheprobabilitythatthesumisnot18,andthensubtractthisprobabilityfrom1.Togetasumthatisnot18,theremustbe0,1or26'samongthendice.Wecalculatetheprobabilityofeachoccurrence:zero6's:theprobabilityis5n 6none6:theprobabilityisn5n�1 6ntwo6's:theprobabilityis�n25n�2 6n39 ACollectionofDiceProblemsMatthewM.ConroyHence,theprobabilityofrollingasumof18is1� 5n 6n+n5n�1 6n+�n25n�2 6n!=1�5 6n1+9 50n+1 50n2=p(n)say.Then,forexample,p(1)=p(2)=0,p(3)=1=216,p(4)=7=432,andp(5)=23=648.29.Fourfair,6-sideddicearerolled.Thehighestthreearesummed.Whatisthedistributionofthesum?Thisisaquickcalculationwithatinybitofcoding.InPARI/GP,thecomputationlookslikethis:gp�A=vector(20);gp�for(i=1,6,for(j=1,6,for(k=1,6,for(m=1,6,s=i+j+k+m-min(min(i,j),min(k,m));A[s]=A[s]+1))))gp�A[0,0,1,4,10,21,38,62,91,122,148,167,172,160,131,94,54,21,0,0](Thefunnymin(min(i,j),min(k,m))bitistherebecausethedefaultminfunctiononlyworkswithtwovalues,andwewanttheminimumofi;j;kandm.)IfwedeneA(n)tobethenumberofrollsoutof64whichyieldasumofn,wehavethefollowingtable: n A(n) probability 3 1 1=12960:00077 4 4 1=3240:00308 5 10 5=6480:00771 6 21 7=4320:01620 7 38 19=6480:02932 8 62 31=6480:04783 9 91 91=12960:07021 10 122 61=6480:09413 11 148 37=3240:11419 12 167 167=12960:12885 13 172 43=3240:13271 14 160 10=810:12345 15 131 131=12960:10108 16 94 47=6480:07253 17 54 1=240:04166 18 21 7=4320:01620 Howdoesthiscomparetothedistributionofthesumsofthreedice?Weseethemostlikelyrollis13,comparedtoatiefor10and11withasimplerollofthreedice.Themeanrollhereis1 6418Xi=3iA(i)=15869 129612:2445987654:::comparedtoameanof10.5forasimplerollofthreedice.Hereisahistogramcomparingthedistributionofsumsforthe“rollfour,dropone”andthesimplerollthreemethods.40 ACollectionofDiceProblemsMatthewM.Conroy 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 30.Threefair,n-sideddicearerolled.Whatistheprobabilitythatthesumoftwoofthefacesrolledequalsthevalueoftheotherrolledface?Therearetwo(classesof)waysthiscanhappen.Onewayistogettwodistinctfaces,aandb,withaappearingtwiceandb=2a.Theotheristogetthreedistinctfaces,a,bandc,withc=a+b.Let'ssupposewerollthediceandthefacesthatappeararea,bandcwithabcandthesumoftwoofthemequalsthethird.Weconsiderthetwocases.Case1:Ifa=b,thenc=2a,andsowemusthaveabn 2c.Sincetherearethreepermutationsofthesetfa;a;2ag,weseethereare3jn 2kwaysforthistooccuroutofn3throws.Case2:Ifab,thenc=a+bnandthenumberofchoicesoffa;b;cgisX1an 2jfb:abn�agj=X1abn 2c(n�2a)=jn 2kn�jn 2k�1:Sincea,b,andcaredistinct,therearesixpermutationsofeachpossibility,andsothereare6jn 2kn�jn 2k�1waysforthiscasetooccuroutofn3totalpossiblethrows.Altogether,wehave3jn 2k+6jn 2kn�jn 2k�1=3 2n(n�1):41 ACollectionofDiceProblemsMatthewM.Conroywaysforthistooccuroutofn3totalpossibilethrows.Onecanverifythelastequalitybytreatingevenandoddn'sseparately.Forn=2;3;4;5;6;:::thelastexpressionis3;9;18;30;45;:::Thevaluesinthissequencearethe“triangularmatchsticknumbers”(seeA045943intheOEIS).Thustheprobabilityofthisoccurringis3(n�1) 2n2;withtheprobabilitytendingtozeroasntendstoinnity.Forn=6,theprobabilityis45 63=5 24=0:2083.31.Afair,n-sideddieisrolleduntilarollofkorgreaterappears.Allrollsaresummed.Whatistheexpectedvalueofthesum?Theprobabilitythatanyrollisgreaterthanorequaltokisn+1�k nsotheexpectednumberofrollsuntilarollofkorgreaterisn n+1�k:Allbutthelastoneoftheserollsislessthank,sotheexpectedvalueofthesumoftheserollsisn n+1�k�11+(k�1) 2:Weaddtothistheexpectedvalueofthenalrollk+n 2andsotheexpectationoftheentiresumisn n+1�k�11+(k�1) 2+k+n 2=n2+n 2n�2k+2Wecanalsoargueasfollows.LetEbetheexpectedvalueofthesum.Ontherstroll,thesumiseitherlessthankoritiskorgreater.Ifitisless,thenwecanexpressElikethis:E=k�1 n(fexpectedvalueofrollkg+E)+n+1�k n(expectedvalueofrollk)=k�1 nk 2+E+n+1�k nk+n 2Fromthiswehave2n(1�k�1 n)E=k(k�1)+(n+1�k)(k+n)=n2+nfromwhichwendE=n2+n 2n�2k+2:42 ACollectionofDiceProblemsMatthewM.ConroyMoreexplicitly,andwithouttheassumptionoftheuniformdistributionofthedicevalues,wemaywriteE=k�1Xi=11 ni+E+nXi=k1 ni=k�1 nk 2+E+n+1�k nk+n 2andtherestfollowsasabove.32.Apairofdiceisrolledrepeatedly.Whatistheexpectednumberofrollsuntilallelevenpossiblesumshaveappeared?Whatifthreedicearerolleduntilallsixteenpossiblesumshaveappeared?Thisisanexampleofaso-calledcouponcollector'sproblem.Weimagineapersonisseekingtocompleteasetofndistinct“coupons”.Eachdaytheygetonecouponchosenatrandomfromanitesetofpossiblecoupons(thesetisreplenishedeachday),andwewishtoknowhowmanydaysareexpectedinordertogetthecompleteset.Iftheprobabilityofeachcouponappearingisthesameasallothers,theproblemisfairlysimple(seeproblem8).Whentheprobabilitiesarenotallthesame,asisthecasewiththesumsofpairsofdice,itgetsmorecomplicated.OnewaytosolvethisproblemistouseMarkovchains.Thisisconceptuallystraightforward,butabitcomputationallyelaborate.Aswerollthepairofdice,weconsiderourselvesinastaterepresentedbyan11-dimensionalvectorha2;a3;;a12i,whereai=0or1fori=2;12,andai=1ifandonlyifasumofihasbeenachievedthusfar.Westartinthestateh0;0;;0iandwewanttoknowtheexpectednumberofrollsuntilweareinthestateh1;1;;1i(thisisouroneabsorbingstate).Thusthereare211=2048statestothischain.Fromeachstateexcepttheabsorbingstate,theprobabilityofmovingtoanotherstateisdeterminedbytheprobabilityofrollingeachoftheso-farunrolledsums.WecancreatethetransitionmatrixMforthisprocess,anduseittocalculatetheexpectedvalue(seeAppendixDformoredetailsonthismethod).ThebasicideaistocreateatransitionmatrixM,andfromthattakeasub-matrixQ,fromwhichthematrixN=(I�Q)�1iscalculated.ThentheexpectednumberofrollsneededwillbethesumofthevaluesintherstrowofN.BelowissomeGPcodethatcreatesthetransitionmatrixandcalculatestheexpectedvalue.Ahelpfulideahereistoassigneachstateapositiveintegerviathemaps(ha2;a2;;a12i)=12Xi=22i�2aisowecanrepresenteachstateasapositiveinteger,ratherthanasavector.A=vector(11);s(A)=sum(i=1,11,2ˆ(i-1)*A[i]);p=sum(i=1,6,xˆi)*1/6;B=vector(12);for(i=2,12,B[i]=polcoeff(pˆ2,i,x));M=matrix(2048,2048);\\allocatemem()asneededtogettherequiredmemoryfor(a2=0,1,for(a3=0,1,for(a4=0,1,for(a5=0,1,for(a6=0,1,\43 ACollectionofDiceProblemsMatthewM.Conroyfor(a7=0,1,for(a8=0,1,for(a9=0,1,for(a10=0,1,for(a11=0,1,for(a12=0,1,\A=[a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12];\s0=s(A);\for(j=2,12,C=A;if(A[j-1]()))\M[s0+1,s0+1]=sum(j=2,12,B[j]*A[j-1]);\)))))))))))print("FoundM.");Q=matrix(2047,2047);print("NowwehaveQ.");for(i=1,2047,for(j=1,2047,Q[i,j]=M[i,j]));N=(matid(2047)-Q)ˆ(-1)print("NowwehaveN.");print1("Theexpectedvalueis",sum(j=1,2047,N[1,j]));Theexpectednumberofrollsis769767316159 12574325400=61:217384763957::::In[2](equation14b),theauthorsgivethefollowingformulaforcalculatingsuchanexpectedvalue:E=m�1Xq=0(�1)m�1�qXjJj=q1 1�PJwheremisthenumberof“coupons”,Jisasubsetofallpossiblecoupons,andPJ=Pj2Jpjwherepjistheprobabilityofdrawingthej-thcoupononanyturn.Thisrequires,essentially,summingoverthepowersetofthesetofallcoupons.HereissomePARI/GPcodethatndstheexpectedvalueusingthisformula:A=vector(11);p=sum(i=1,6,xˆi)*1/6;B=vector(12);for(i=2,12,B[i]=polcoeff(pˆ2,i,x));E=0;for(a2=0,1,for(a3=0,1,for(a4=0,1,for(a5=0,1,for(a6=0,1,\for(a7=0,1,for(a8=0,1,for(a9=0,1,for(a10=0,1,for(a11=0,1,for(a12=0,1,\A=[a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12];\q=sum(i=1,11,A[i]);\P=sum(i=1,11,A[i]*B[i+1]);\if(P()ˆ()*1/(1-P));\)))))))))));print(E);Thisisdenitelyamoreefcientwaytocomputethis:ononemachine,thiscodetakesabout1=10000asmuchtimeastheMarkovchainmethod.Withasmallmodicationtotheabovecode,wecanndtheexpectednumberofrollsuntilallsixteenpossiblesumsareattainedwhenrollingthreedice.Theexpectedvalueis32780408650180616717098566081494549422317059377168943326909666810782193227427941243843 96853626249252584111109636978626695927366864056199200661045945395107914269245971600whichisabout338:45308554395589,andhereisthePARI/GPcode:44 ACollectionofDiceProblemsMatthewM.ConroyA=vector(16);p=sum(i=1,6,xˆi)*1/6;B=vector(18);for(i=3,18,B[i]=polcoeff(pˆ3,i,x));E=0;for(a3=0,1,for(a4=0,1,for(a5=0,1,for(a6=0,1,\for(a7=0,1,for(a8=0,1,for(a9=0,1,for(a10=0,1,for(a11=0,1,for(a12=0,1,\for(a13=0,1,for(a14=0,1,for(a15=0,1,for(a16=0,1,for(a17=0,1,for(a18=0,1,\A=[a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18];\q=sum(i=1,16,A[i]);\P=sum(i=1,16,A[i]*B[i+2]);\if(P()ˆ()*1/(1-P));\))))))))))))))));print(E);33.Adieisrolledrepeatedlyandsummed.Whatcanyousayabouttheexpectednumberofrollsuntilthesumisgreaterthanorequalton?Whenasix-sideddieisrolled,theexpectedvalueoftherollis7 2.So,toreachasumofn,weexpecttoneedabout2 7n=n 3:5rolls.That'sveryrough.Let'sndamorepreciseexpressionoftheexpectedvalue.DeneEntobetheexpectednumberofrollsuntilthesumisatleastn.ThenE0=0andE1=1.Sinceontherstroll,thereisa5=6probabilityofgettingatleast2,and,ifwedon't,thesumwillbeatleast2afterthesecondroll,wehaveE2=1+1 6=7 6:Thatis,E2=1+1 6E1.Supposen=3.Ontherstroll,wewillget3orgreaterwithprobability4=6.Ifwegeta1,thentheexpectednumberofadditionalrollsisE2,andifgeta2,thentheexpectednumberofadditionalrollsisE1.Hence,E3=1+1 6E1+1 6E2=49 36:Inthesameway,E4=1+1 6E1+1 6E2+1 6E3=343 216E5=1+1 6E1+1 6E2+1 6E3+1 6E4=2401 1296E6=1+1 6E1+1 6E2+1 6E3+1 6E4+1 6E5=16807 7776:Supposen�6.Inordertoreachasumofatleastn,thenalrollmustbeiafterachievingasumofatleastn�i.Hence,En=1+1 66Xi=1En�i:(3.13)45 ACollectionofDiceProblemsMatthewM.ConroyTohelpusstudyEn,wewillndageneratingfunctionforEn.Denef(x)=1Xn=0Enxn:Wewishtondasimple,closed-formexpressionforf.Multiplyingequation3.13byxiandsummingfromn=6to1wehave1Xn=6Enxn=1Xn=6 xn+1 66Xi=1En�ixn!:(3.14)Denefk(x)=kXi=0Eixi:Thenequation3.14yieldsf(x)�f5(x)==1Xn=6xn+1 66Xi=1 1Xn=6En�ixn!=x6 1�x+1 61Xn=6En�1xn+1 61Xn=6En�2xn++1 61Xn=6En�5xn+1 61Xn=6En�6xn=x6 1�x+1 61Xn=5Enxn+1+1 61Xn=4Enxn+2++1 61Xn=1Enxn+5+1 61Xn=0Enxn+6=x6 1�x+1 6x1Xn=5Enxn+1 6x21Xn=4Enxn++1 6x51Xn=1Enxn+1 6x61Xn=0Enxn=x6 1�x+1 6x(f(x)�f4(x))+1 6x2(f(x)�f3(x))++1 6x5(f(x)�f0(x))+1 6x6f(x)Usingthefactthatf0(x)=0andsimplifying,wehavef(x)�f5(x)=x6 1�x+1 6(x+x2++x6)f(x)�1 6(xf4(x)+x2f3(x)+x3f2(x)+x4f1(x)):Sincethefiarejustpolynomials,wecansolvethisforf(x)andndthatf(x)=6x x7�7x+6=6x (x�1)2(x5+2x4+3x3+4x2+5x+6):Applyingthemethodofpartialfractions,wendf(x)=2=7 (x�1)2�4=21 x�1+2 21(2x4+3x3�10x�30) x5+2x4+3x3+4x2+5x+6=2 71Xn=0(n+1)xn+4 211Xn=0xn+Z(x)=1Xn=02 7n+10 21xn+Z(x);say.46 ACollectionofDiceProblemsMatthewM.ConroyThepolesofZ(x)areapproximately�1:491797988139901;�0:8057864693890311:222904713374410i;and0:5516854634589821:253348860277206i:TheminimummodulusamongthesepolesisR=1:3693941054897684.Asaresult,then-thcoef-cientanofthepowerseriesofZ(x)satisesan=O1 Rn=O(0:73024997n):(See,forexample,[3],(June26,2009edition),TheoremIV.7(ExponentialGrowthFormula),page244)).Thus,wemayconcludethatEn=2 7n+10 21+O(0:73024997n):So,Enisverycloselyapproximatedby2 7n+10 21forallbutthesmallestvaluesofn.Hereisashorttableofvalues.Letg(n)=2 7n+10 21.nEng(n)En�g(n) 111:0000000000:76190476190:238095238127=61:1666666671:0476190480:1190476190349=361:3611111111:3333333330:027777777784343=2161:5879629631:619047619�0:0310846560852401=12961:8526234571:904761905�0:05213844797616807=77762:1613940332:190476190�0:029082157557117649=466562:5216263722:4761904760:045435895558776887=2799362:7752307672:7619047620:0133260051395111617=16796163:0433247843:047619048�0:0042942638591033495175=100776963:3236937293:333333333�0:009639604132154:7600083774:761904762�0:001896385320206:1901951996:190476190�0:0002809914888257:6190816127:6190476190:00003399272215309:0476345949:0476190480:000015546764983510:4761948010:476190480:0000043274907914011:9047629011:904761900:00000099346759454513:3333335113:333333330:00000017950843855014:7619047814:761904760:000000018420845606017:6190476217:61904762�0:0000000009900237247020:4761904820:47619048�8:2031751110�118023:3333333323:33333333�1:89637026110�129026:1904761926:190476196:3237832810�1410029:0476190529:047619056:47872976010�15WeseethatEnisextremelycloselyapproximatedby2 7n+10 21asngetslarge.34.Adieisrolledrepeatedlyandsummed.Showthattheexpectednumberofrollsuntilthesumisamultipleofnisn.Wewilltreatsmallnrst.Wewillusethefactthattheexpectednumberofadditionalrollsuntilthesumisamultipleofndependsonlyontheresidueclassofthesummodulon(e.g.,theexpected47 ACollectionofDiceProblemsMatthewM.Conroynumberofadditionalrollsuntilthesumisamultipleof4isthesamewhetherthesumis3,7,11,oranyothervaluecongruentto3modulo4).Letn=2.Thentheexpectednumberofrolls,EuntilthesumisamultipleofnisE=1+1 2E1andE1=1+1 2E1whereE1istheexpectednumberofadditionalrollsfromanoddsum(i.e.,asumcongruentto1mod2).Theseequationsarisefromthefactthathalfofthevaluesf1;2;3;4;5;6gareevenandhalfareodd,sothereisaone-halfchanceoftherstrollendinginanoddsum,andfromthere,aone-halfchanceofstayingwithanoddsum.ThesetwoequationseasilyleadtoE=2.Letn=3,andletEbetheexpectednumberofrollsuntilthesumisamultipleofthree,andE1andE2betheexpectednumberofadditionalrollsfromasumcongruentto1or2mod3.ThenwehaveE=1+1 3E1+1 3E2E1=1+1 3E1+1 3E2E2=1+1 3E1+1 3E2Asinthen=2case,thefactthatf1;2;3;4;5;6gareuniformlydistributedmod3resultsinthreeidenticalexpressions,andsowendE=E1=E2=3.Then=4caseisalittledifferent,sincef1;2;3;4;5;6gisnotuniformlydistributedmodulo4.Asaresult,ourequations,followingtheschemeabove,areE=1+1 3E1+1 3E2+1 6E3E1=1+1 6E1+1 3E2+1 3E3E2=1+1 6E1+1 6E2+1 3E3E3=1+1 3E1+1 6E2+1 6E3Solvingthissystem,wendE1=98 25;E2=84 25;E3=86 25,andE=4.Then=5caseissimilar.WehaveE=1+1 3E1+1 6E2+1 6E3+1 6E4E1=1+1 6E1+1 3E2+1 6E3+1 6E4E2=1+1 6E1+1 6E2+1 3E3+1 6E4E3=1+1 6E1+1 6E2+1 6E3+1 3E4E4=1+1 6E1+1 6E2+1 6E3+1 6E448 ACollectionofDiceProblemsMatthewM.ConroywhichyieldsE1=1554 311;E2=1548 311;E3=1512 311;E4=1296 311andE=5.Forn=6,wecanconcludemoreeasily.Sincef1;2;3;4;5;6gisuniformlydistributedmodulo6,wehaveE=E1=E2=E3=E4=E5andsoE=1+5 6EandthusE=6.Supposen�6.DeneEandEiasabove.Thenwehavethefollowingsystemofequations.E=1+1 6E1++1 6E6E1=1+1 6E2++1 6E7.....................En�7=1+1 6En�6++1 6En�1En�6=1+1 6En�5++1 6En�1En�5=1+1 6En�4++1 6En�1+1 6E1En�4=1+1 6En�3++1 6En�1+1 6E1+1 6E2En�3=1+1 6En�2++1 6En�1+1 6E1+1 6E3En�2=1+1 6En�1++1 6En�1+1 6E1+1 6E4En�1=1+1 6E1++1 6E5Summing,andcounting,wehaveE+n�1Xi=1Ei=n+n�1Xi=161 6Ei=n+n�1Xi=1EiandsoE=n.Acuriousfeatureofthisisthatauniformdistributionofdicevaluesisactuallynotnecessarytohavenrollsbetheexpectedvalue.Avarietyofotherkindsofdiedistributions(appearto)yieldnalso.Soaquestionis:whatarenecessaryconditionsonthevaluesofadiesothatnistheexpectednumberofrollsuntilthesumisamultipleofn?35.Afair,n-sideddieisrolledandsummeduntilthesumisatleastn.Whatistheexpectednumberofrolls?Tosolvethis,wewillusesomerecursiveexpressions.LetE(m)betheexpectednumberofrollsuntilthesumisatleastn,startingwithasumofm.Thenwehave:E(n)=049 ACollectionofDiceProblemsMatthewM.ConroyE(n�1)=1E(n�2)=1+1 nE(n�1)=1+1 nE(n�3)=1+1 nE(n�2)+1 nE(n�1)=1+1 n(1+1 nE(n�1))+1 n=1+2 n+1 n2E(n�4)=1+1 nE(n�3)+1 nE(n�2)+1 nE(n�1)=1+3 n+3 n2+1 n3SupposeE(n�k)=k�1Xi=0�k�1i nifor1kr.ThenE(n�r)=1+1 nr�1Xm=1E(n�m)=1+1 nr�1Xm=1m�1Xi=0�m�1i ni=1+1 nr�2Xi=01 nir�2Xj=iji=1+1 nr�2Xi=01 nir�1i+1=1+r�2Xi=01 ni+1r�1i+1=1+r�1Xi=11 nir�1i=r�1Xi=01 nir�1i(HerewehaveusedthelovelyidentitymXk=rkr=m+1r+1:)Thusbyinduction,wehaveE(n�k)=k�1Xi=0�k�1i nifor1kn.ThevalueweseekisE(0):E(0)=n�1Xi=0�n�1i ni=1+1 nn�1:Weobservethecuriositythatasn!1,E(0)!e.Wehavethefollowingvalues:50 ACollectionofDiceProblemsMatthewM.Conroy n E(0)exact E(0)approx. 1 1 1.0000 2 3/2 1.5000 3 16/9 1.7778 4 125/64 1.9531 5 1296/625 2.0736 6 16807/7776 2.1614 7 262144/117649 2.2282 8 4782969/2097152 2.2807 9 100000000/43046721 2.3231 10 2357947691/1000000000 2.3579 20 2.5270 100 2.6780 500 2.7101 1000 2.7142 36.Adieisrolledandsummedrepeatedly.Whatistheprobabilitythatthesumwilleverbeagivenvaluex?Whatisthelimitofthisprobabilityasx!1?Let'sstartbyconsidering2-sideddice,withsidesnumbered1and2.Letp(x)betheprobabilitythatthesumwilleverbex.Thenp(1)=1=2sincetheonlywaytoeverhaveasumof1istoroll1ontherstroll.Wethenhavep(2)=1=2+1=2p(1)=3=4,sincetherearetwomutuallyexclusivewaystogetasumof2:roll2ontherstroll,orrolla1followedbya1onthesecondroll.Now,extendingthisidea,wehave,forx�2,p(x)=1 2p(x�1)+1 2p(x�2):(3.15)Thisequationcouldbeusedtocalculatep(x)foranygivenvalueofx.However,thiswouldrequirecalculatingpforalllowervalues.Canwegetanexplicitexpressionforp(x)?Equation3.15isanexampleofalinearrecurrencerelation.Onewaytogetasolution,orexplicitformula,forsucharelationisbyexaminingtheauxiliaryequationforequation3.15:x2=1 2x+1 2orx2�1 2x�1 2=0Therootsofthisequationare =1and =�1 2Apowerfultheorem(seeAppendixE)saysthatp(n)=A n+B n=A+B�1 2nforconstantsAandB.Sincep(1)=1=2andp(2)=3=4wecansolveforAandBtondthatp(n)=2 3+1 3�1 2n:For3-sideddice,wehavep(1)=1 3;p(2)=4 9;andp(3)=16 27with,forn�3,p(n)=1 3(p(n�1)+p(n�2)+p(n�3))=1 33Xi=1p(n�i):51 ACollectionofDiceProblemsMatthewM.ConroyThecharacteristicequationforthisrecurrenceequationcanbewritten3x3�x2�x�1=0whichhasroots =1; =�1 3�p 2 3i;and =�1 3+p 2 3i:Usingthese,andthefactthatp(1)=1 3;p(2)=4 9;andp(3)=16 27;wendp(n)=1 2+1 4 n+1 4 n:Since and arecomplexconjugates,and,inanycase,p(n)isalwaysreal,wemightprefertowritep(n)likethis:p(n)=1 2+1 21 p 3ncosn 2+tan�11 p 2Usingthisformulatogenerateatable,weseethatwhilep(n)isasymptotictothevalue1/2,itwobblesquiteabit: x p(x) p(x)�p(x�1) 1 0.3333333333333333333333333333 2 0.4444444444444444444444444444 0.1111111111111111111111111111 3 0.5925925925925925925925925925 0.1481481481481481481481481481 4 0.4567901234567901234567901234 -0.1358024691358024691358024691 5 0.4979423868312757201646090534 0.04115226337448559670781893002 6 0.5157750342935528120713305898 0.01783264746227709190672153636 7 0.4901691815272062185642432556 -0.02560585276634659350708733424 8 0.5012955342173449169333942996 0.01112635269013869836915104404 9 0.5024132500127013158563227150 0.001117715795356398922928415384 10 0.4979593219190841504513200901 -0.004453928093617165405002624938 11 0.5005560353830434610803457015 0.002596713463959310629025611496 12 0.5003095357716096424626628355 -0.0002464996114338186176828660183 13 0.4996082976912457513314428757 -0.0007012380803638911312199598200 14 0.5001579562819662849581504709 0.0005496585907205336267075952194 15 0.5000252632482738929174187274 -0.0001326930336923920407317435396 16 0.4999305057404953097356706913 -0.00009475750777858318174803604667 17 0.5000379084235784958704132966 0.0001074026830831861347426052109 18 0.4999978924707825661745009051 -0.00004001595279592969591239145842 19 0.4999887688782854572601949643 -0.000009123592497108914305940764722 20 0.5000081899242155064350363887 0.00001942104593004917484142432929 Let'sskipover4-and5-sideddicetodealwith6-sideddice.Letp(x)betheprobabilitythatthesumwilleverbex.Weknowthat:p(1)=1 6p(2)=1 6+1 6p(1)=7 36p(3)=1 6+1 6p(2)+1 6p(1)=49 216p(4)=1 6+1 6p(3)+1 6p(2)+1 6p(1)=343 1296p(5)=1 6+1 6p(4)+1 6p(3)+1 6p(2)+1 6p(1)=2401 7776p(6)=1 6+1 6p(5)+1 6p(4)+1 6p(3)+1 6p(2)+1 6p(1)=16807 4665652 ACollectionofDiceProblemsMatthewM.Conroyandforx�6,p(x)=1 66Xi=1p(x�i):Thecorrespondingcharacteristicequation6x6�x5�x4�x3�x2�x�1=0hasroots,approximately,A1=1A2=�0:67033204760309682774A3=�0:37569519922525992469�0:57017516101141226375iA4= A3A5=0:29419455636014167190�0:66836709744330106478iA6= A5Solvingthesystemofequationsp(j)=6Xi=1ciAji;j=1;:::;6wendc1=2 7andci=1 7fori=2;:::;7.Hence,wemayexpressp(n)asp(n)=2 7+1 76Xi=2Ani:SincealltheAiexceptA1haveabsolutevaluelessthanone,wemayconcludethatlimn!1p(n)=2 7:Here'satableofthevaluesofp(x)andp(x)�p(x�1)forx20: x p(x) p(x)�p(x�1) 1 0.1666666666666666666666666666 2 0.1944444444444444444444444444 0.02777777777777777777777777777 3 0.2268518518518518518518518518 0.03240740740740740740740740740 4 0.2646604938271604938271604938 0.03780864197530864197530864197 5 0.3087705761316872427983539094 0.04411008230452674897119341563 6 0.3602323388203017832647462277 0.05146176268861454046639231824 7 0.2536043952903520804755372656 -0.1066279435299497027892089620 8 0.2680940167276329827770156988 0.01448962143728090230147843316 9 0.2803689454414977391657775745 0.01227492871386475638876187573 10 0.2892884610397720537180985283 0.008919515598274314552320953784 11 0.2933931222418739803665882007 0.004104661202101926648489672418 12 0.2908302132602384366279605826 -0.002562908981635543738627618117 13 0.2792631923335612121884963084 -0.01156702092667722443946427417 14 0.2835396585074294008073228155 0.004276466173868188618826507133 15 0.2861139321373954704790406683 0.002574273629966069671717852795 16 0.2870714299200450923645845173 0.0009574977826496218855438489728 17 0.2867019247334239321389988488 -0.0003695051866211602255856684957 18 0.2855867251486822574344006235 -0.001115199584741674704598225314 19 0.2847128104634228942354739637 -0.0008739146852593631989266598476 20 0.2856210801517331745766369062 0.0009082696883102803411629425406 Here'sanotherproofthatp(n)approaches2 7(proofideafromMarcHoltz).53 ACollectionofDiceProblemsMatthewM.ConroyFirst,let'sdeneasequenceofvectorsv(i):v(i)=hp(i);p(i�1);p(i�2);p(i�3);p(i�4);p(i�5)i:IfwethendenethematrixM:M=0BBB@1 61 61 61 61 61 61000000100000010000001000000101CCCAThenit'snothardtoshowthatMv(i)=v(i+1)Whatweareinterestedin,thenisM1v(j)=limi!1v(i),wherejisanynitevalue(butwemayaswelltakeittobesix,sincewe'vecalculatedp(1),...,p(6)alreadyNotethateachentryofMisbetween0and1,eachrowofMsumstoone,andM6hasnozeroentries:M6=0BBBBBBBBBBB@16807 466569031 466567735 466566223 466564459 466562401 466562401 77762401 77761105 7776889 7776637 7776343 7776343 1296343 1296343 1296127 129691 129649 129649 21649 21649 21649 21613 2167 2167 367 367 367 367 361 361 61 61 61 61 61 61CCCCCCCCCCCASo,wecanconsiderMtobeatransitionmatrixofaregularMarkovsystem.HenceM1isamatrixwithallidenticalrowsgivenbythevectorwwherethesumoftheentriesofwequals1,andwM=w:Alittlesimplealgebrashowsthatw=2 7;5 21;4 21;1 7;2 21;1 21Hence,v(1)isavectorofsixidenticalprobabilitiesequaltowv(6)=2 7Thus,limi!1=2 7.Morequestions:(a)Noticethatwhilep(x)issettlingdownon2 7,itdoessoquitenon-monotonically:p(x)increasestoitsmaximumatx=6,andthenwobblesaroundquiteabit.Isthesequencep(i)eventuallymonotonic,ordoesitalwayswobble?54 ACollectionofDiceProblemsMatthewM.Conroy37.Adieisrolledandsummedrepeatedly.Letxbeapositiveinteger.Whatistheprobabilitythatthesumwilleverbexorx+1?Whatistheprobabilitythatthesumwilleverbex,x+1,orx+2?Etc.?Inthepreviousproblem,weworkedouttheprobabilitythatthesumwilleverbex.Letp(x)bethisprobability.Then,withinclusion-exclusion,wecanworkoutthesoughtprobabilitiesforthisproblem.Theprobabilitythatthesumiseverxorx+1isp(x)+p(x+1)�qwhereqistheprobabilitythatthesumwillbebothxandx+1.Sincetheonlywaythatcanhappenisforthesumtoreachxandthenoneappearsasthenextdieroll,theprobabilityisq=p(x)1 6:Thus,theprobabilitythatthesumiseverxorx+1is5 6p(x)+p(x+1):Sincep(x)approaches2 7asxgoestoinnity,wecanconcludethattheprobabilitythatthesumwilleverbexorx+1isasymptoticto11 210:5238095.Now,let'sconsidertheprobabilitythatthesumwilleverbex,x+1,orx+2.LetP(S)betheprobabilitythatthesumwilleverbeinthesetS.LetAnbetheeventthatthesumiseverequalton.Byinclusion-exclusion,P(fxg[fx+1g[fx+2g)=P(fxg)+P(fx+1g)+P(fx+2g)�P(fxg\fx+1g)�P(fxg\fx+2g)�P(fx+1g\fx+2g)+P(fxg\fx+1g\fx+2g)=p(x)+p(x+1)+p(x+2)�p(x)1 6�p(x)7 36�p(x+1)1 6+p(x)1 36=2 3p(x)+5 6p(x+1)+p(x+2):Thus,asxgoestoinnity,theprobabilitythatthesumwilleverbex,x+1orx+2approaches5 70:7142857:Now,let'sconsidertheprobabilitythatthesumwilleverbex,x+1,x+2orx+3.Ifthishappens,thenthesumwilleitherbex,oritwillbeatleastoneofx+1,x+2andx+3.Usingthecalculationwejustdid,andatinybitofinclusion-exclusion,wecanconcludethattheprobabilitythatthesumiseverx,x+1,x+2orx+3isp(x)+2 3p(x+1)+5 6p(x+2)+p(x+3)�p(x)1 2=1 2p(x)+2 3p(x+1)+5 6p(x+2)+p(x+3):(Thisp(x)1 2bitisduetotheprobabilitythatthesumisxandoneofx+1,x+2andx+3isequaltop(x)timestheprobabilitythattherollafterhittingxislessthen4(i.e.,1=2).)55 ACollectionofDiceProblemsMatthewM.ConroyThus,asxgoestoinntiy,theprobabilityapproaches2 7�1 2+2 3+5 6+1=6 7.Now,let'sconsidertheprobabilitythatthesumwilleverbex,x+1,x+2,x+3orx+4.Justlikethelastcase,wecanutilizethepreviouscalculationandndthattheprobabilityisp(x)+1 2p(x+1)+2 3p(x+2)+5 6p(x+3)+p(x+4)�p(x)2 3=1 3p(x)+1 2p(x+1)+2 3p(x+2)+5 6p(x+3)+p(x+4):Thus,asxapproachesinnity,theprobabilityapproaches2 7�1 3+1 2+2 3+5 6+1=20 210:952380:::Thisis,ofcourse,asfaraswecango,sincethesumisguaranteedtohitatleastoneofx,x+1,x+2,x+3,x+4andx+5foreveryx.38.Adieisrolledonce;calltheresultN.ThenNdicearerolledonceandsummed.Whatisthedistributionofthesum?Whatistheexpectedvalueofthesum?Whatisthemostlikelyvalue?Whattheheck,takeitonemorestep:rolladie;calltheresultN.RollNdiceonceandsumthem;calltheresultM.RollMdiceonceandsum.What'sthedistributionofthesum,expectedvalue,mostlikelyvalue?Sinceeachofthepossiblevaluesf1;2;3;4;5;6gofNareequallylikely,wecancalculatethedistri-butionbysummingtheindividualdistributionsofthesumof1,2,3,4,5,and6dice,eachweightedby1 6.Wecandothisusingpolynomialgeneratingfunctions.Letp=1 6(x+x2+x3+x4+x5+x6):ThenthedistributionofthesumisgivenbythecoefcientsofthepolynomialD=6Xi=11 6pi=1 279936x36+1 46656x35+7 93312x34+7 34992x33+7 15552x32+7 7776x31+77 46656x30+131 46656x29+139 31104x28+469 69984x27+889 93312x26+301 23328x25+4697 279936x24+245 11664x23+263 10368x22+691 23328x21+1043 31104x20+287 7776x19+11207 279936x18+497 11664x17+4151 93312x16+3193 69984x15+1433 31104x14+119 2592x13+749 15552x12+2275 46656x11+749 15552x10+3269 69984x9+4169 93312x8+493 11664x7+16807 279936x6+2401 46656x5+343 7776x4+49 1296x3+7 216x2+1 36x:TogettheexpectedvalueE,wemustcalculateE=36Xi=1idiwhereD=36Xi=1dixi.ThisworksouttoE=49 4=12:25.56 ACollectionofDiceProblemsMatthewM.ConroyMoresimply,onecancalculatetheexpectedvalueofthesumasfollows,usingthefactthattheexpectedvalueofasinglerollis3.5:E=1 6(3:5+23:5+33:5++63:5)=12:25:Since11Xi=1di=1255 25921 2,and12Xi=1di=8279 15552�1 2,wecansaythatthemedianvalueisbetween11and12. 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 0 1 2 3 4 5 6 10�2 i coefcientofxi YoucanseefromtheplotofthecoefcientsofDthat6isthemostlikelyvalue.Itisperhapsabitsurprisingthattherearethree“localmaxima”intheplot,ati=6;11;and14.Okay,nowletsdoonemorestep.Afterrollingthedice,gettingasumofN,andthenrollingNdice,thesumdistributionisD1=6Xi=11 6piasabove.ThecoefcientofxiinDthengivesustheprobabilitythatthesumofi.HenceifwecallthesumMandthenrollMdiceonce,thesumdistributionisgivenbyD2=36Xi=1D1(i)piwhereD1(i)isthecoefcientonxiinD1.Now,D2isadegree216polynomialwithmassiverationalcoefcients,sothereislittlepointinprintingithere.LetD2(i)bethecoefcientonxiinD2.Wecanndtheexpectedvalueofthesumas216Xi=1iD2(i)=343 8=42:875:57 ACollectionofDiceProblemsMatthewM.ConroySince40Xi=1D2(i)1 2,and41Xi=1D2(i)�1 2,wecansaythatthemediansumisbetween40and41.Here'saplotofthedistribution: 0 20 40 60 80 100 120 140 160 180 200 �30 �20 �10 0 i log10ofcoefcientofxiinD2 Here'saplotshowingjustthecoefcientsofxiforsmallvaluesofi.Therearelocalmaximaati=6,i=20(theabsolutemax),andi=38,andalocalminimumati=7andi=30. 0 5 10 15 20 25 30 35 40 �2:3 �2:2 �2:1 �2 �1:9 �1:8 i log10ofcoefcientofxiinD2 39.Adieisrolledonce.CalltheresultN.Then,thedieisrolledNtimes,andthoserollswhichareequaltoorgreaterthanNaresummed(otherrollsarenotsummed).Whatisthedistributionoftheresultingsum?Whatistheexpectedvalueofthesum?Thisisaperfectproblemfortheapplicationofthepolynomialrepresentationofthedistributionofsums.Theprobabilityofasumofkisthecoefcientonxkinthepolynomial1 61 6�x+x2+x3+x4+x5+x6+1 61 6�1+x2+x3+x4+x5+x62+58 ACollectionofDiceProblemsMatthewM.Conroy1 61 6�2+x3+x4+x5+x63+1 61 6�3+x4+x5+x64+1 61 6�4+x5+x65+1 61 6�5+x66=1 279936x36+1 7776x30+5 46656x29+5 23328x28+5 23328x27+5 46656x26+1 46656x25+59 31104x24+13 5832x23+5 1296x22+11 2916x21+67 23328x20+1 486x19+1117 69984x18+23 1296x17+7 288x16+16 729x15+1 54x14+1 72x13+6781 93312x12+47 729x11+377 5832x10+67 1296x9+19 432x8+1 36x7+8077 46656x6+565 5832x5+7 108x4+5 108x3+1 27x2+1 36x+27709 279936So,that'sthedistribution.Here'saplotofthedistribution: 0 5 10 15 20 25 30 35 40 0 510�2 0:1 0:15 i coefcientofxi Theexpectedvalueissimplythesumofitimesthecoefcientonxiinthedistributionpolynomial.Theresultis133 18=7:38888:::.Theprobabilitythatthesumis5orlessis104077 279936=0:3717:::whiletheprobabilitythatthesumis6orlessis152539 279936=0:5449:::,sowewouldsaythemediansumissomewherebetween5and6.40.Supposensix-sideddicearerolledandsummed.Foreachsixthatappears,wesumthesix,andrerollthatdieandsum,andcontinuetorerollandsumuntilwerollsomethingotherthanasixwiththatdie.Whatistheexpectedvalueofthesum?Whatisthedistributionofthesum?Eachdieisindependent,sowecanworkoutthedistributionforasingledie,andgeteverythingweneedfromthat.Tostart,wecannotethattheexpectedvalueEwhenrollingasinglediesatisesE=1 61+1 62+1 63+1 64+1 65+1 6(6+E)59 ACollectionofDiceProblemsMatthewM.ConroyandsoE=4:2,sowithndice,theexpectedsumis4:2n.Therstthingwemightnoticeisthattheprobabilityofgettingascoreof6m+k,foranynon-negativem,andk2f1;2;3;4;5gisP(6m+k)=1 6m+1Notethatitisnotpossibletoscoreamultipleof6.Wecancreatesomegeneratingfunctions(thatis,powerserieswherethecoefcientonxmistheprobabilityofgettinganalsumofm).Forscorescongruentto1mod6,wehave1 6x+1 62x7+1 63x13+=x 6�x6Thegeneratingfunctionforcongruenceclasskmod6isxktimesthis,sotheoverallgeneratingfunctionforasingledieisx+x2+x3+x4+x5 6�x6=x6�x (x�1)(6�x6)So,whenrollingrdice,thegeneratingfunctionforthesumisx6�x (x�1)(6�x6)r:Thus,theprobabilitythatthesumiskisthecoefcientonxkinthepowerseriesrepresentationoftheabovegeneratingfunction.Here'sanexampleofhowtocalculatewiththis.Supposeweroll5six-sideddice,andwanttoknowtheprobabilitythatthesumwillbegreaterthan20.Wecalculatetheprobabilitythatthesumwillbelessthan20bytruncatingthegeneratingfunctiontothe19thdegreeforasingledieandraisingittothefthpower.LetQ=1 6x+1 6x2+1 6x3+1 6x4+1 6x5+1 36x7+1 36x8+1 36x9+1 36x10+1 36x11+1 216x13+1 216x14+1 216x15+1 216x16+1 216x17+1 1296x19Then,raisingQtothefthpower,wehave1 7776x5+5 7776x6+5 2592x7+35 7776x8+35 3888x9+121 7776x10+1115 46656x11+1555 46656x12+665 15552x13+2365 46656x14+659 11664x15+2795 46656x16+5695 93312x17+5635 93312x18+5495 93312x19+SummingthecoefcientsofQ5uptox19givesus44711 93312;theprobabilitythatwescorelessthan20whenrolling5dice.Andso,theprobabilitythatwescore20ormoreis1�44711 93312=48601 93312:60 ACollectionofDiceProblemsMatthewM.Conroy41.Adieisrolleduntilallsumsfrom1toxareattainablefromsomesubsetofrolledfaces.Forexample,ifx=3,thenwemightrolluntila1and2arerolled,oruntilthree1sappear,oruntiltwo1sanda3.Whatistheexpectednumberofrolls?Idon'thaveasolutionforageneralx,butherearesomethoughts.Ifx=1,thentheexpectednumberofrollsis6.Letx=2.Theexpectednumberofrollsuntila1or2isrolledis3,andthesetwooutcomesareequallylikely.Ifwerolleda1,thenweneedtorolla1ora2,whichtakes3rollsonaverage.Ifwerolleda2,thenwemustrolla1,whichtakes6rollsonaveage.Hence,theexpectednumberofrollsisE2=3+1 2(3)+1 2(6)=15 2=7:5:Wecandothesamethingwithx=3:E3=2+1 3(expectednumberofrollsaftera1)+1 3(e.n.ofrollsaftera2)+1 3(e.n.ofrollsaftera3):Afterrollinga1,werolluntila1,2or3appears.Ifa1appears,thenweneedtorolla1,2or3.Ifa2appears,wearedone.Ifa3appears,thenweneedtorolla1ora2.Hencetheexpectednumberofrollsafterrollinga1is2+1 3(2)+1 3(3):Afterrollinga2,werolluntila1appesrs,whichrequires6rollsonaverage.Afterrollinga3,westillneedtoachievesubsums1and2,whichtakesE2rollsonaverage.Thus,E3=2+1 32+1 3(2)+1 3(3)+1 36+1 3E2=139 18:Wecouldcontinueinthisway,butinsteadwecantreattheproblemviaaMarkovprocess.Createthesetof2xvectorsV=fha1;a2;:::;axi:ai2f0;1g;i=1;2;:::;xg.EachvectorcorrespondstoastateinaMarkovchain:ifinstateha1;a2;:::;axi,ai=1ifandonlyifasumofihssbeenachievedwiththefacesrolledsofar.Thegoalistoreachtheh1;1;:::;1istate,whichwetreatastheabsorbingstate.Theprocessstartsinstateh0;0;:::;0i.Forexample,withx=2,wehavethestatesandtransitionmatrix0BB@h0;0ih1;0ih0;1ih1;1ih0;0i2=31=61=60h1;0i02=301=3h0;1i005=61=6h1;1i00011CCAForexample,theprobabilityofmovingfromstateh1;0itostateh1;1iis1=3since,oncea1hasbeenrolled,weneedtorolleithera1ora2,hencetheprobabilityis2=6=1=3.ThefollowingPARI/GPcodeimplementsthismethodandoutputstheexpectednumberofrollsuntilallsums1;2;:::;xhavebeenattained.Oneusefulideaisthatofconvertingthestatevectorsdescribedaboveintointegersbytreatingthevectorsasstringsofbinarydigits.ThiscodeappliesthemethodofAppendixDtondtheexpectedvaluefromthetransitionmatrix.61 ACollectionofDiceProblemsMatthewM.Conroyx=2;\\wewillrolluntilallsums1,2,3,...,xcanbeachievedfromrolledfacesM=matrix(2ˆx,2ˆx);\\A=vector(x);\\vectonum(V,x)=sum(i=1,x,2ˆ(i-1)*V[i]);\\givesthestatenumbercorrespondingtovectorVnumtovec(n,x)=�B=vector(x);m=n;j=0;while(m0,B[j+1]=m%2;j=j+1;m=floor(m/2));return(B)\\{for(kk=0,2ˆx-1,for(d=1,6,\\figureoutwhatstatewegettobasedoneachpossiblefacerolledBB=numtovec(kk,x);\\generatethevectorforthisstateforstep(r=x,1,-1,\\if(�(BB[r]0)&&(r+d)BB[r+d]=1));\\if(d)jj=vectonum(BB,x);\\M[kk+1,jj+1]=M[kk+1,jj+1]+1/6;\\addingonetomakeindiceslegal)\\);Q=matrix(2ˆx-1,2ˆx-1);for(a=1,2ˆx-1,for(b=1,2ˆx-1,Q[a,b]=M[a,b]));N=(matid(2ˆx-1)-Q)ˆ(-1);print(sum(i=1,2ˆx-1,N[1,i]));}Usingthiscode,Ifoundthefollowingexpectedvalues:xexpectedvalue(exact)ev(approx.)rstdifference215=27:53138=187:722220:22222249139=11527:933160:210937528669967=36000007:963870:0300726777101609=972000007:994870:03099272341848577=2916000008:031030:0361588883143607=1093500008:076300:045271942538515011=52488000008:104420:02812510256722093191=314928000008:151770:047344111550818181021=1889568000008:207260:055492Therstdifferencesareinterestinglyerratic.Isuspectasimpleexpressionfortheexpectedvalueshereisunlikely.Here'sanothertable.Thisshowsthepercentageofthetimethatallsums1throughxwillhavebeenachievedbyacertainnumberofrolls.x1234567891011121314208.3319.932.043.453.361.868.974.879.583.486.589.091.0305.5615.727.939.950.760.067.774.079.083.186.388.991.04009.7223.537.349.459.367.473.879.083.086.388.990.95008.3322.536.949.259.367.473.879.083.086.388.990.96005.5622.236.849.259.367.473.879.083.086.388.990.97002.7821.536.849.259.367.473.879.083.086.388.990.9800019.936.649.259.367.473.879.083.086.388.990.9900017.636.149.159.367.473.879.083.086.388.990.91000013.935.249.059.367.473.879.083.086.388.990.9Thisisfascinating.Thepercentagesarenearlyconstantatmanyrollnumbers,andthevarietyisalmostentirelywherethenumberofrollsissmall.Unfortunately,themethodusedaboveistoocomputationallyinvolvedtobeappliedtolargex.Itwouldbenicetogetatleastaheuristicforthegrowthoftheexpectedvalueasafunctionofx.62 ACollectionofDiceProblemsMatthewM.ConroyComment:experimentally,ifyourolladie15times,onaverageyoucancreatesumsfrom1toabout48,whereasifyouroll7times,onaverageyoucangetsumsfrom1toabout13:3,and20rollswillgetyoutoabout68.30rollswillgetyoutoabout105,soitcertainlyappearsthatthisisapproaching3:5timesthenumberofrolls.42.Howlong,onaverage,doweneedtorolladieandsumtherollsuntilthesumisaperfectsquare(1;4;9;16;:::)?Wecanmakeaverypreciseestimateofthisexpectedvalue.Webeingbycalculatingtheexpectationresultingfromrollingthedieupto104.Thatis,ifweletEbethevaluewewant,andpiistheprobabilitythatthesumisasquareforthersttimeafterirolls,thenE=1Xi=1ipi=104Xi=1ipi+1Xi=104+1ipi=E1+E2;say:WecancalculateE1byrunningthroughallpossiblesequencesofupto10000rollsofthedie.HereissomePARI/GPcodethatdoesthat:{mm=62000;A=vector(mm);A[1]=1;B=vector(mm);p=0;plast=0;totProb=0;lowerE=0;for(roll=1,10000,for(i=1,mm,�if(A[i]0,for(d=1,6,B[i+d]=B[i+d]+A[i])));for(i=1,mm,if(issquare(i-1)&&�B[i]0,p=p+B[i];B[i]=0));A=B;totProb=totProb+(p-plast)*1/6ˆroll;lowerE=lowerE+roll*(p-plast)*1/6ˆroll;plast=p;print(roll,"",lowerE*1.,"",1-totProb*1.);print();B=vector(mm);)}Theresult,accuratetomorethan50digits,isE1=7:079764237551105103895546667746425712389260689139678Atthesametime,thecalculationtellsusthattheprobabilitythatthesumhasnotreachedasquareafter10000rollsislessthan6:210�28.Hence,E2(6:2�28)E0whereE0istheexpectednumberofrollsneededtoreachasquareifmorethan10000rollsareneeded.Let'sgetanupperboundonE0.Let'ssupposewearerollingadieandthecurrentsumism2+1wheremislarge(saym�10).Thenextsquarethesumcouldhitis(m+1)2.Theprobabilityofhittingthissquareisbetween1 6and63 ACollectionofDiceProblemsMatthewM.Conroy16807 46656,sotheprobabilityofmissingthissquareislessthan5 6,andtheexpectednumberofrollsneededtoreachthatsquareiscertainlylessthan(m+1)2�(m2+1).Ifthesum“misses”(m+1)2,thenthenextsquarethesumcouldhitis(m+2)2,requiringfewerthan(m+2)2�(m+1)2additionalrolls.Continuinginthisway,wehavetheupperboundE010000+1Xj=0((m+1+j�m2)pqj=10000+p0@1Xj=0j2qj+1Xj=0(2m+2)jqj+1Xj=0(2m+1)qj1A=10000+pq(1+q) (1�q)3+(2m+2)q (1�q)2+2m+1 1�q=10000+16807 648m+184877 129610000+26m+143wherep=16807 46656andq=5 6.After10000rolls,consideringtheworstcase,wewouldhavem245andsoE016513.Thus,E210�22,andsowecanconcludethatE=7:079764237551105103895accurateto21digitstotherightofthedecimal.43.Howlong,onaverage,doweneedtorolladieandsumtherollsuntilthesumisprime?Whatifwerolluntilthesumiscomposite?Wemakeaverypreciseestimateofthisrstexpectedvalueinthefollowingway.Westartbycalculatingtheexpectationresultingfromrollingthedieupto104times.Thatis,ifEisthevaluewewant,andpiistheprobabilitythatthesumisprimeforthersttimeafterirolls,thenE=1Xi=1ipi=104Xi=1ipi+1Xi=104+1ipi=E1+E2;say:WecancalculateE1byrunningthroughallpossiblesequencesofupto10000rollsofthedie.HereissomePARI/GPcodethatdoesthat:{mm=62000;A=vector(mm);A[1]=1;B=vector(mm);p=0;plast=0;totProb=0;lowerE=0;for(roll=1,10000,for(i=1,mm,64 ACollectionofDiceProblemsMatthewM.Conroy�if(A[i]0,for(d=1,6,B[i+d]=B[i+d]+A[i])));for(i=1,mm,if(isprime(i-1)&&�B[i]0,p=p+B[i];B[i]=0));A=B;totProb=totProb+(p-plast)*1/6ˆroll;lowerE=lowerE+roll*(p-plast)*1/6ˆroll;plast=p;print(roll,"",lowerE*1.,"",1-totProb*1.);print();B=vector(mm);)}BysettingthenumericalprecisioninGPtodisplaywellover500decimalplaces,wecanconcludethat,to500decimalplaces,E1=2:42849791369350423036608190624229927163420183134471182664689592112165213232573798604609327056580542852416004758916519484151656563433616477256594348575120100473140535884140802682651337652276857652736803431366812324178513260565966869474098555533124510113237977013366168026086615306805134626003385548615552748670772033743828142893635968820059123417686546040938389237587262019318687321289858489108100887189200924057179560935192425315320539737383744024227909185701767244213100211303319283551672174728414550Alsooutputbythecodeaboveistheprobabilitythat,after10000rolls,thesumhasneverbeenprime.Thisvalueisapproximately2:0510�552.Hence,E=E1+(2:0610�552)E10000whereE10000istheexpectednumberofrollsneededifmorethan10000areneeded.ThoughIdonothaveaproof,itseemstruethatE10000iscertainlylessthan1050(alittleexperimentationshowsthat,startingfromasumintherange10000to60000,theexpectednumberofrollsneededisnotmorethan20.Hence,IsuspectthetruevalueofE10000islikelylessthan10020,soIthinkIammakingaverysafeclaimhere.)Thus,wemayconcludethat,to500digitsofaccuracy,E=E1aslistedabove.IfIndawaytoprovesuchanupperbound,I'llbesuretoaddit.Now,whatifwerolluntilthesumiscomposite?Thisisamucheasierquestion,becausewecannotrollindenitely:therearenoprimenumbersbetweentheprimes89and97,andsince97�89�6,ifoursumpasses89,itmustfallononeofthecompositesbetweenthesetwoprimes.Since89isthe24thprime,wemustlandonacompositeonorbeforethe26throll.Withaslightmodicationtothecodeabove,wemayrunitfor26rollsandndthattheexpectedvalueofthenumberofrollsuntilthesumiscompositeisexactly60513498236803196347 284302880299297013762:12848699151757507022715820:65 ACollectionofDiceProblemsMatthewM.ConroyIfweletpnbetheprobabilitythatthesumwillbecompositeforthersttimeonthenthroll,thenwehavethefollowingtable.npnPni=1pi1�Pni=1pi10.33333333333333333330.333333333333333333330.66666666666666666620.36111111111111111110.694444444444444444440.30555555555555555530.19907407407407407400.893518518518518518520.10648148148148148140.07098765432098765430.964506172839506172840.03549382716049382750.02456275720164609050.989068930041152263370.01093106995884773660.00823045267489711930.997299382716049382720.00270061728395061770.00216120827617741190.999460590992226794700.00053940900777320580.00044414913885078490.999904740131077579640.00009525986892242090.00007739864349946650.999982138774577046180.000017861225422953100.00001380937335941330.999995948147936459550.000004051852063540110.00000310090719148500.999999049055127944590.000000950944872055120.00000075386499277430.999999802920120718950.000000197079879281130.00000016117060834750.999999964090729066510.000000035909270933140.00000002977126122520.999999993861990291750.000000006138009708150.00000000503418883550.999999998896179127310.000000001103820872160.00000000088015004070.999999999776329168062.236708319418220031E-10171.7735336436591380173E-100.999999999953682532424.631746757590820138E-11183.7485246399124685943E-110.999999999991167778828.832221176783515438E-12197.3437736466195153487E-120.999999999998511552471.488447530164000092E-12201.2781174767468527085E-120.999999999999789669952.103300534171473825E-13211.8730953391657100290E-130.999999999999976979482.302051950057638328E-14222.1219904608947140874E-140.999999999999998199391.800614891629241323E-15231.7081782621714818617E-150.999999999999999907569.243662945775692717E-17248.9693076528648355726E-170.999999999999999997262.743552929109835594E-18252.7083791736101660356E-180.999999999999999999963.517375551E-20263.5173755501430727735E-2010Wecanseethat,morethan99percentofthetime,6orfewerrollsareneeded.3.3Non-StandardDice44.Showthattheprobabilityofrollingdoubleswithanon-fair(“xed”)dieisgreaterthanwithafairdie.Forafair,n-sideddie,theprobabilityofrollingdoubleswithitisn1 n2=1 n.Supposewehavea“xed”n-sideddie,withprobabilitiesp1;:::;pnofrollingsides1throughnrespectively.Theprobabilityofrollingdoubleswiththisdieisp21++p2n:Wewanttoshowthatthisisgreaterthan1 n.Anicetrickistoleti=pi�1 nfori=1;:::;n:Thenp21++p2n=(1+1 n)2++(n+1 n)2=21++2n+2 n(1++n)+1 n:Now,sincep1++pn=1,wecanconcludethat1++n=0.Hence,p21++p2n=21++2n+1 n�1 npreciselywhennotallthei'sarezero,i.e.whenthedieis“xed”.66 ACollectionofDiceProblemsMatthewM.Conroy45.Isitpossibletohaveanon-fairsix-sideddiesuchthattheprobabilityofrolling2;3;4;5;and6isthesamewhetherwerollitonceortwice(andsum)?Whataboutforothernumbersofsides?Let'sstartwitha2-sideddie.Supposetheprobabilityofrollingaoneisa1andtheprobabilityofrollinga2isa2.Thentheprobabilityofrollinga2whenrollingtwiceandsummingisa21:So,toachieveequalprobabilitieswhetherrollingonceortwice,werequirenon-negativea1anda2witha1+a2=1anda21=a2sothata21+a1�1=0,andhencea1=�1+p 5 2=1 0:6180339887498;anda2=3�p 5 2=1 20:381966011250:whereisthegoldenratio.Let'slookatthesix-sidedcase.Here,weseeka1;:::;a6non-negativewitha1++a6=1anda21=a22a1a2=a32a1a3+a22=a42a1a4+2a2a3=a52a1a5+2a2a4+a23=a6:Thisimpliesa21=a22a31=a35a41=a414a51=a542a61=a6andsoweseeka(real,boundedbetweenzeroand1)solutiontothepolynomial42a61+14a51+5a41+2a31+a21+a1�1:Thispolynomialhasonepositiverealroot:a1=0:3833276422504671918282678397:::.Thus,weightingadiewithprobabilitiesa1=0:3833276422504671918282678397:::a2=0:1469400813133021601465169741:::a3=0:1126523898438400996320617058:::a4=0:1079569374817992533848329781:::a5=0:1158720592665417507230810930:::a6=0:1332508898440495442852394095:::67 ACollectionofDiceProblemsMatthewM.Conroywillgiveusadiesuchthattheprobabilityofrolling2;3;4;5and6isthesamewhetherwerollonceorrolltwiceandsum.Ingeneral,forann-sideddie,werequirea1;:::;annon-negativerealnumberswithnXi=1ai=1andCi�1ai1=ai;i=1;:::;nwhereCiisthei-thCatalannumber,Ci=�2ii i+1.Thusweneedtoguaranteeapositiverealrootlesstheoneforthepolynomial�1+nXi=1Ci�1xiSincethispolynomialevaluatesto�1atx=0,andispositiveforx=1,theremustbeatleastonerealsolutionbetween0and1,andsothereexistsoneofthesespecialdiceforeverynumberofsides.Forann-sideddie,wehavethefollowingapproximatea1values:na1 20.6180339887498 30.5 40.4418115119484 50.4068294316935 60.3833276422504 70.3663733452433 80.3535209284167 90.3434158345289 100.3352452267388 200.2969330618649 500.2714018346938 1000.2617716572724 2000.2564370408369 5000.2528692107822 10000.2515454964644 Someobservations(proofstobeaddedlater):(a)Itappearsthata1approaches1 4asntendstoinnity.(b)Foranygivennumberofsidesn,itappearsthatthevaluesofaidecreasesasiincreasesuntilreachingaminimumwithi=dn 2e,andincreasesthereafter.46.Findapairof6-sideddice,labelledwithpositiveintegersdifferentlyfromthestandarddice,sothatthesumprobabilitiesarethesameasforapairofstandarddice.Numberonediewithsides1,2,2,3,3,4andonewith1,3,4,5,6,8.Rollingthesetwodicegivesthesamesumprobabilitiesastwonormalsix-sideddice.Anaturalquestionis:howcanwendsuchdice?Onewayistoconsiderthepolynomial(x+x2+x3+x4+x5+x6)2:68 ACollectionofDiceProblemsMatthewM.ConroyThisfactorsasx2(1+x)2(1+x+x2)2(1�x+x2)2:Wecangroupthisfactorizationas�x(1+x)(1+x+x2)�x(1+x)(1+x+x2)(1�x+x2)2=(x+2x2+2x3+x4)(x+x3+x4+x5+x6+x8):Thisyieldsthe“weird”dice(1,2,2,3,3,4)and(1,3,4,5,6,8).ThesediceareknownasSichermandice,namedforGeorgeSichermanwhocommunicatedwithMartinGardnerabouttheminthe1970s.SeeAppendixCformoreaboutthismethod.See[1]formoreonrenumberingdice.47.Isitpossibletohavetwonon-fairn-sideddice,withsidesnumbered1throughn,withthepropertythattheirsumprobabilitiesarethesameasfortwofairn-sideddice?Anotherwayofaskingthequestionis:supposeyouaregiventwon-sideddicethatexhibittheprop-ertythatwhenrolled,theresultingsum,asarandomvariable,hasthesameprobabilitydistributionasfortwofairn-sideddice;canyouthenconcludethatthetwogivendicearefair?ThisquestionwasaskedbyLewisRobertson,RaeMichaelShorttandStephenLandryin[4].Theiranswerissurprising:youcansometimes,dependingonthevalueofn.Specically,ifnis1,2,3,4,5,6,7,8,9,11or13,thentwon-sideddicewhosesum“actsfair”are,infact,fair.Ifnisanyothervalue,thenthereexistpairsofn-sideddicewhicharenotfair,yethave“fair”sums.Thesmallestexample,withn=10,givesdicewiththeapproximateprobabilities(see[Rob2]fortheexactvalues)(0:07236;0:14472;0:1;0:055279;0:127639;0:127639;0:055279;0:1;0:14472;0:07236)and(0:13847;0;0:2241;0;0:13847;0:13847;0;0:2241;0;0:13847):It'sclearthatthesedicearenotfair,yetthesumprobabilitiesforthemarethesameasfortwofair10-sideddice.48.Isitpossibletohavetwonon-fair6-sideddice,withsidesnumbered1through6,withauniformsumprobability?Whataboutn-sideddice?No.Letp1;p2;p3;p4;p5andp6betheprobabilitiesforone6-sideddie,andq1;q2;q3;q4;q5andq6betheprobabilitiesforanother.Supposethatthesedicetogetheryieldsumswithuniformprobabilities.Thatis,supposeP(sum=k)=1 11fork=2;:::;12.Thenp1q1=1 11andp6q6=1 11:Also,1 11=P(sum=7)p1q6+p6q1sop11 11p6+p61 11p11 1169 ACollectionofDiceProblemsMatthewM.Conroyi.e.,p1 p6+p6 p11:Now,ifweletx=p1 p6,thenwehavex+1 x1whichisimpossible,sinceforpositiverealx,x+1 x2.Thus,nosuchdicearepossible.Anidenticalproofshowsthatthisisanimpossibilityregardlessofthenumberofsidesofthedice.49.Supposethatwerenumberthreefair6-sideddice(A;B;C)asfollows:A=f2;2;4;4;9;9g,B=f1;1;6;6;8;8g,andC=f3;3;5;5;7;7g.(a)FindtheprobabilitythatdieAbeatsdieB;dieBbeatsdieC;dieCbeatsdieA.(b)Discuss.TheprobabilitythatAbeatsBcanbeexpressedas2 62 6+2 62 6+2 6(1)=5 9:Thethinkingbehindthisgoeslikethis:theprobabilityofrollinga2withAis2/6,andifa2isrolled,itwillbeatBwithprobability2/6.Theprobabilityofrollinga4withAis2/6,anditwillbeatBwithprobability2/6.Theprobabilityofrollinga9withAis2/6,ifitwillbeatBwithprobability1.Similarly,theprobabilitythatBbeatsCis2 64 6+2 6(1)=5 9andtheprobabilitythatCbeatsAis2 62 6+2 64 6+2 64 6=5 9:Thus,eachdiebeatsanotherwithprobabilitygreaterthan50%.Thisiscertainlyacounterintuitivenotion;thisshowsthat“beats”,asin“die1beatsdie2”isnottransitive.Lotsofquestionsarise.Whatothersetsof“non-transitive”dicearepossible?Whatisthefewestnumberofsidesnecessary?Foragivennumberofsides,whatistheminimumpossiblemaximumfacevalue(e.g.,inthesetgivenabove,themaximumfacevalueis9)?Foragivennumberofsides,andaboundonthefacevalues,howmanysetsoftransitivedicearethere?Whataboutsetswithmorethanthreedice?50.Findeverysix-sideddiewithsidesnumberedfromthesetf1,2,3,4,5,6gsuchthatrollingthedietwiceandsummingthevaluesyieldsallvaluesbetween2and12(inclusive).Forinstance,thedienumbered1,2,4,5,6,6isonesuchdie.Considerthesumprobabilitiesofthesedice.Doanyofthemgivesumprobabilitiesthatare“moreuniform”thanthesumprobabilitiesforastandarddie?Whatifwerenumbertwodicedifferently-canwegetauniform(ormoreuniformthanstandard)sumprobability?Thenumbers1,2,5and6mustalwaysbeamongthenumbersonthedie,elsesumsof2,3,11and12wouldnotbepossible.Inordertogetasumof5,either3or4mustbeonthediealso.Thelast70 ACollectionofDiceProblemsMatthewM.Conroyplaceonthediecanbeanyvalueinf1,2,3,4,5,6g.Hencethereare11dicewiththerequiredproperty.Listedwiththeircorrespondingerror,theyare:1,2,4,5,6,60.02328843995510661,2,4,5,5,60.03254769921436591,2,4,4,5,60.02946127946127951,2,3,5,6,60.02328843995510661,2,3,5,5,60.0263748597081931,2,3,4,5,60.02174523007856341,2,3,3,5,60.02946127946127951,2,2,4,5,60.0263748597081931,2,2,3,5,60.03254769921436591,1,2,4,5,60.02328843995510661,1,2,3,5,60.0232884399551066Theerrorhereisthesumofthesquareofthedifferencebetween1=11andtheactualprobabilityofrollingeachofthesums2through12(theprobabilitywewouldhaveforeachsumifwehadauniformdistribution).Thatis,ifpiistheprobabilityofrollingasumofiwiththisdie,thentheerroris12Xi=2pi�1 112:Notethatthestandarddiegivesthesmallesterror(i.e.,theclosesttouniformsum).Ifwerenumbertwodicedifferently,manymorecasesarepossible.Onepairofdiceare1,3,4,5,6,6and1,2,2,5,6,6.Thesetwodicegiveallsumvaluesbetween2and12,withanerror(asabove)of0.018658810325477,moreuniformthanthestandarddice.Thebestdicefornear-uniformityare1,2,3,4,5,6and1,1,1,6,6,6whichyieldallthesumsfrom2to12withnearequalprobability:theprobabilityofrolling7is1/6andallothersumsare1/12.Theerroris5/792,orabout0.00631.51.Let'smakepairsofdicethatonlysumtoprimevalues.Ifweminimizethesumofallthevaluesonthefaces,whatdicedowegetfor2-sideddice,3-sideddice,etc.?We'llassumethatallfacesofthedicearedifferent,tokeepthisfrombeingtrivial.Wecanuselinearprogrammingtondthesedice.Supposewewanttomakedicewithssides.Letnbeanupperboundonthefacevalues.Wecandenethefollowinglinearprogramtondthedice:minimize:nXi=1iai+nXi=1ibisubjecttoai+bj1foralli;jsuchthati+jiscomposite(i.e.,notprime)(3.16)nXi=1ai=s(3.17)nXi=1bi=s(3.18)withai;bj2f0;1gforalli;j2f1;:::;ng.Thereisthequestionofhowtosetn.Wecansimplystartsmallandincreaseituntilwegetsomedice,andthenkeepincreasingnuntil,say,nisgreaterthanthetotalfacevaluesumofdicealreadyfound.Ontheotherhand,wecouldalsoaskforthedicewiththeminimummaximalface.71 ACollectionofDiceProblemsMatthewM.ConroyHerearetheresultingdice:sidesminimaltotalfacesum(sum)minimalmaximalface 2f2;4g;f1;3g(10)same3f2;4;10g;f1;3;9g(29)same4f2;6;12;18g;f1;5;11;35g(90)f6;10;16;20g;f1;7;13;31g5f2;8;14;28;44g,f3;9;15;39;45g(207)same6f2;8;14;38;44;98g,f3;9;15;29;59;65g(384)f4;12;16;46;72;82g;f1;7;25;55;67;85g7f6;12;16;22;72;82;106g,f1;7;25;31;67;91;151g(689)sameWithmoresides,ittakesprogressivelylongertosolvetheseLPs.Wecouldalsotryagreedymethodofcreatingthedice.Startwith1ondieA,and2ondieB.Thenaddthenextsmallestintegertoeachdieinturnthatmaintainstheprimesumrequirement.ThisresultsinthetwosetsA=f1;3;9;27;57;267;1227;1479;3459;:::gandB=f2;4;10;70;100;1060;27790;146380;2508040;:::gand,inparticular,thesix-sideddicewithsidesf1;3;9;27;57;267gandf2;4;10;70;100;1060g.Soyoucanseethatthisisprettyfarfromgettingtheminimalfaces,butitiseasytocode.Wecanextendthequestiontosetsofthreedice.Fortwo-sideddice,assumingallfacesareodd,thesetsff1;3g;f3;9g;f1;7ggandff3;5g;f1;7g;f1;7ggyieldonlyprimesums,thelatteronebeingthesetwiththeminimalmaximumface.Ifwewanttorequirethatthedicefacesarealldistinct,thesetff9;11g;f5;17g;f3;15ggistheonewithminimalmaximumface.Ifwechoosetohavetwodicewithallevenfaces,andonewithalloddfaces,thenwegetthediceff2;4g;f2;8g;f1;7ggwithminimalmaximumface.Ifwefurtherrequirealldistinctfaces,thenff2;6g;f4;10g;f1;7gisthesetwithminimalmaximumface.Forthree-sideddice,thesetff1;7;37g;f1;7;37g;f9;15;29ggyieldsonlyprimesums,andisthesetwithminimalmaximumface.Ifwerequirethatthedicefacearealldistinct,thenthesetff1;31;37g;f3;9;39g;f13;27;33ggworksandhasminimalmaximumface.52.ShowthatyoucannothaveapairofdicewithmorethantwosidesthatonlygivessumsthatareFibonaccinumbers.Hereweconsidereachdietohavedistinctintegerfaces(i.e.,nofaceisrepeated),butwedonotneedtoassumethatthereisnofacecommontobothdice.Let'sstartwiththetwo-sidedcase,andwe'llseethisleadseasilytothegreater-than-twosidescase.Supposewehavetwo-sideddicewithsidesfr;sg,ft;ugwithsumsthatareallFibonaccinumbers.Wecansubtractrfromtherstdie'sfaces,andaddrtothesecondtogetthedicef0;s�rg;ft+r;u+rgwiththesamesumset.Sincetherstdiehasazero,andallsumsareFibonacci,wecanrelabelthediceasf0;xg;fFa;Fbg,whereFnisthen-thFibonaccinumber(e.g.,F1=1;F2=1;F3=2;etc.)WemayassumeFaFb.Let'swriteFc=x+FaandFd=x+Fb.ThenFb+Fc=Fa+Fd.Supposebc.ThenFb+FcFc�1+Fc=Fc+1FdFd+Fa,acontradiction.72 ACollectionofDiceProblemsMatthewM.ConroySupposeb�c.ThenFb+FcFb+Fb�1=Fb+1FdFd+Fa,acontradiction.Hence,b=c,andsowehave,simply,Fb=Fa+xandFd=Fb+x.ThenxFb�1,sinceotherwisewe'dhaveFb+xFb+Fb�1=Fb+1Fd.Ontheotherhand,Fb=Fa+ximpliesxFb.Thus,x=Fb�1.(NoteweareusingthefactthatFa&#x-336;0here).Thus,ifwehavetwo-sideddicewithsumsthatareFibonacci,theymustbe“equivalent”tothedicef0;Fb�1g;fFb�2;Fbgforsomeintegerb&#x-336;1.By“equivalent”,Imeananydicederivedfromthesebyaddinganinteger toallfacesofonedieandsubtracting fromallthefacesoftheother.Sowecanhavedicelikef0;3g;f2;5g,orf0;8g;f5;13g.Now,ifwehavemorethantwosides,thenallnon-zerofacesofthediewiththezeroonitwouldhavetobeidentical(inthesecases,ourxabovestandingforanynon-zeroface),somethingwearenotallowinghere.Hence,dicewiththreeormoresideswhosesumsareallFibonacciareimpossible.3.4GameswithDice53.Twoplayerseachrolladie.Player1rollsafairm-sideddie,whileplayer2rollsafairnsideddie,withm&#x-336;n.Thewinneristheonewiththehigherroll.WhatistheprobabilitythatPlayer1wins?WhatistheprobabilitythatPlayer2wins?Whatistheprobabilityofatie?Iftheplayerscontinuerollinginthecaseofatieuntiltheydonottie,whichplayerhasthehigherprobabilityofwinning?IfthetiemeansawinforPlayer1(orplayer2),whatistheirprobabilityofwinning?Whenthetwoplayersrolltheredice,therearemnpossibleoutcomes.Thesecanbethoughtofaslatticepoints,i.e.,points(x;y)inthexy-planewherexandyarepositiveintegers,and1xmand1yn.Ofthesemnlatticepoints,Player1isawinnerwheneverx&#x-336;y.Thenumberoflatticepointswithx&#x-336;yisequalto(m�1)+(m�2)+(m�3)++(m�n)=nm�1 2n(n+1):Hence,theprobabilityofPlayer1winningis1�n+1 2m:Ofthenmpossiblyoutcomes,nareties.Sotheprobabilityofatieisn mn=1 m:Hence,theprobabilityofPlayer2winningisn�1 2m:Now,supposetheplayerscontinuerollinguntilthereisnotie,andthenthewinnerisdeclaredbasedonthenalroll.Whatarethewinningprobabilitiesthen?LetpbetheprobabilityofPlayer1rollingalargerrollonasingleroll,andqbetheprobabilityofatie.Then,forPlayer1towin,theremustbe73 ACollectionofDiceProblemsMatthewM.Conroyasequenceofties,followedbyasinglewinningrollbyPlayer1.Hence,theprobabilityofPlayer1winningis1Xi=0qip=p1Xi=0qi=p 1�q:Usingthevaluesforpandqcalculatedabove,wendthattheprobabilityofPlayer1winningiftheplayersrerolluntiltheyarenottiedis1�n+1 2m 1�1 m=1�n�1 2(m�1)andsotheprobabilityofPlayer2winningisn�1 2(m�1):If,insteadofrerolling,tiesmeanawinforPlayer1,thenPlayer1'sprobabilityofwinningbecomes1�n+1 2m+1 m=1�n�1 2m:whilePlayer2'sisn�1 2m:If,insteadofrerolling,tiesmeanwinforPlayer2,thenPlayer1'sprobabilityofwinningis1�n+1 2m:whilePlayer2'sisn�1 2m+1 m=n+1 2m:Sincen+1 2m1 2aslongasnm�1,Player2isatadisadvantageeveniftiesgothem,exceptwhenn=m�1,inwhichcasetheplayersareevenlymatched(eachwitha1 2probabilityofwinning).IfPlayer1'sdiehasatleasttwomorefacesthanPlayer2'sdie,Player1hastheadvantage,regardlessofhowtiesaretreated.54.CrapsWhatistheprobabilityofwinningaroundofthegameCraps?TheprobabilityofwinningaroundofcrapscanbeexpressedasP(rolling7or11)+Xb2f4;5;6;8;9;10gP(rollingb)P(rollingbagainbeforerolling7):Wenowevaluateeachprobability.Theprobabilityofrolling7is6 36=1 6,andtheprobabilityofrolling11is2 36=1 18.Hence,P(rolling7or11)=6 36+2 36=2 9:Thefollowingtablegivestheprobabilityofrollingb,forb2f4;5;6;8;9;10g.(Thisistheprobabilityofbbecomingthe“point”.)74 ACollectionofDiceProblemsMatthewM.Conroy 4 3/36=1/12 5 4/36=1/9 6 5/36 8 5/36 9 4/36=1/9 10 3/36=1/12 Finally,weneedtodeterminetheprobabilityofrollingbbeforerolling7.Letpbetheprobabilityofrollingbonanysingleroll.Rollingbbeforerolling7involvesrollingsomenumberofrolls,perhapszero,whicharenotbor7,followedbyarollofb.Theprobabilityofrollingkrollswhicharenotbor7,followedbyarollofbis1�p�1 6kp=5 6�pkp:Sincekmaybeanynon-negativeintegervalue,wehaveP(rollingbbeforerolling7)=1Xk=05 6�pkp=p 1 6+p:SeeAppendixBforsomeformulasforsimplifyingseriessuchastheoneabove.Anotherwayoflookingatthisisthattheprobabilityofrollingbbeforerollinga7istheconditionalprobabilityofrollingb,giventhateitherbor7wasrolled.Wecancalculatethefollowingtable:bP(rollingb)P(rollingbagainbeforerolling7)P(rollingb)P(rollingbagainbeforerolling7)41/121/31/3651/92/52/4565/365/1125/39685/365/1125/39691/92/52/45101/121/31/36Thus,theprobabilityofwinningaroundofcrapsis2 9+1 36+2 45+25 396+25 396+2 45+1 36=244 495=0:49 29:Since244 495=1 2�7 990,theoddsarejustslightlyagainsttheplayer.55.Non-StandardCrapsWecangeneralizethegamesofcrapstoallowdicewithotherthansixsides.Supposeweusetwo(fair)n-sideddice.Thenwecandeneagameanalogoustocrapsinthefollowingway.Theplayerrollstwon-sideddice.Ifthesumofthesediceisn+1or2n�1,theplayerwins.Ifthesumofthesediceis2;3or2ntheplayerloses.Otherwisethesumbecomestheplayer'spoint,andtheywiniftheyrollthatsumagainbeforerollingn+1.Wemayagainask:whatistheplayer'sprobabilityofwinning?Fortwon-sideddice,theprobabilityofrollingasumofn+1isP(n+1)=n n2=1 nandtheprobabilityofrollingasumof2n�1isP(2n�1)=2 n2:75 ACollectionofDiceProblemsMatthewM.ConroyIngeneral,theprobabilityofasumofkisP(k)=n�jk�n�1j n2:Hence,theprobabilityofwinningaroundofCrapswithn-sideddiceispn=1 n+2 n2+X4k2n�2k6=n+1P(k)2 P(k)+P(n+1)=1 n+2 n2+X4k2n�2k6=n+1(n�jk�n�1j)2 n2(2n�jk�n�1j)Wehavethefollowingtable:npn35/9=0.55555...415/28=0.535714...5461/900=0.512222...6244/495=0.492929...7100447/210210=0.477841...837319/80080=0.4660214...92288779/5012280=0.456634...1023758489/52907400=0.449057...200.415459...300.404973...500.397067...1000.391497...10000.386796...100000.386344...1000000.386299...10000000.38629486...Itcertainlyappearsthatpnapproachesalimitasnapproachesinnity.56.YahtzeeTherearemanyprobabilityquestionswemayaskwithregardtothegameofYahtzee.Forstarters,whatistheprobabilityofrolling,inasingleroll,a)Yahtzeeb)Fourofakind(butnotYahtzee)c)Afullhoused)Threeofakind(butnotYahtzee,fourofakindorfullhouse)e)Alongstraightf)AsmallstraightThesequestionsaren'ttootricky,soI'lljustgivetheprobabilitieshere:(a)Yahtzee:6 65=1 12960:07716%(b)Fourofakind(butnotYahtzee):�5465 65=25 12961:929%(c)Afullhouse:�5365 65=25 6483:858%(d)Threeofakind(butnotYahtzee,fourofakindorfullhouse):�53654 65=25 16215:432%76 ACollectionofDiceProblemsMatthewM.Conroy(e)Alongstraight:25! 65=5 1623:086%(f)Asmallstraight(butnotalongstraight):5! 2!4+2�5! 2!4+5! 65=10 8112:346%57.MoreYahtzeeWhatistheprobabilityofgettingYahtzee,assumingthatwearetryingjusttogetYahtzee,wemakereasonablechoicesaboutwhichdicetore-roll,andwehavethreerolls?Thatis,ifwe'reinthesituationwhereallwehavelefttogetinagameofYahtzeeisYahtzee,soallotheroutcomesareirrelevant.ThisisquiteabittrickierthanthepreviousquestionsonYahtzee.ThedifcultyhereliesinthelargenumberofwaysthatonecanreachYahtzee:rollitontherstroll;rollfourofakindontherstrollandthenrollthecorrectfaceontheremainingdie,etc.OnewaytocalculatetheprobabilityistotreatthegameasaMarkovchain(seeAppendixDforgeneralinformationonMarkovchains).Weconsiderourselvesinoneofvestatesaftereachofthethreerolls.Wewillsaythatweareinstatebifwehavebcommondiceamongtheve.Forexample,ifarollyields12456,we'llbeinstate1;ifarollyields11125,we'llbeinstate3.Now,thegoalinYahtzeeistotrytogettostate5inthreerolls(orfewer).Eachrollgivesusachancetochangefromourinitialstatetoabetter,orequal,state.Wecandeterminetheprobabilitiesofchangingfromstateitostatej.DenotethisprobabilitybyPi;j.Letthe0staterefertotheinitialstatebeforerolling.Thenwehavethefollowingprobabilitymatrix:P=(Pi;j)=0BBBBBBB@0120 1296900 1296250 129625 12961 12960120 1296900 1296250 129625 12961 129600120 21680 21615 2161 21600025 3610 361 3600005 61 60000011CCCCCCCA(3.19)TheonerepresentingP5;5indicatesthatifwereachyahtzee,state5,beforethethirdroll,wesimplystayinthatstate.Now,theprobabilityofbeinginstate5after3rollsisgivenbyXP0;i1Pi1;i2Pi2;5=(M3)1;5wherethesumisoveralltriples(i1;i2;i3)with0ij5.CalculatingM3givesustheprobability2783176 610=347897 75582720:04603:Since347897 7558272=1 21:7256026:::,aplayerwillgetYahtzeeaboutonceoutofeverytwentytwoat-tempts.58.DropDead(a)Whatistheexpectedvalueofaplayer'sscore?(b)Whatistheprobabilityofgettingascoreof0?1?10?20?etc.77 ACollectionofDiceProblemsMatthewM.Conroy(a)Theplayerbeginswithvedice,andthrowsthemrepeatedly,untilnodiceareleft.Thekeyfactorincalculatingtheexpectedscoreisthefactthatthenumberofdicebeingthrownchanges.Whenthrowingndice,acertainnumbermay“die”(i.e.comeup2or5),andleavejnon-deaddice.TheprobabilityofthisoccurringisPn;j=nn�j2n�j4j 6n:ThefollowingtablegivesPn;jfornandjbetween0and5.nnj01234511/32/3000021/94/94/900031/276/2712/278/270041/818/8124/8132/8116/81051/24310/24340/24380/24380/24332/243Whenthrowingndice,theexpectedsumis3:5n,ifnoneofthedicecomeup2or5.LetE(n)representtheexpectedscorestartingwithndice(sowe'reultimatelyconcernedwithE(5)).ConsiderE(1).Rollingasingledie,theexpectedscoreisE(1)=3:5P1;1+E(1)P1;1:Thatis,inoneroll,wepickup3:5points,onaverage,ifwedon't“dropdead”(soweget3:5P1;1expectedpoints),andthenwe'reinthesamepositionaswhenwestarted(sowepickupE(1)P1;1expectedpoints).WecansolvethisequationtogetE(1)=32 37 2=7:Now,supposewestartwith2dice.TheexpectedscoreisE(2)=(23:5+E(2))P2;2+E(1)P2;1:Thatis,onasingleroll,wepickup23:5pointsonaverageifnoneofthedice“die”,inwhichcasewe'rebackwherewestartedfrom(andthenexpecttopickupE(2)points),orexactlyoneofthedice“die”,andsoweexpecttopickupE(1)pointswiththeremainingdie.ThisequationyieldsE(2)=1 1�P2;2(7P2;2+E(1)P2;1)=56 5:Continuinginthisway,wehavethegeneralequationE(n)=3:5nPn;n+nXj=1E(j)Pn;jwhichwecanrewriteasE(n)=1 1�Pn;n0@3:5nPn;n+n�1Xj=1E(j)Pn;j1AWiththisformula,wecancalculateE(n)forwhatevervalueofnwewant.HereisatableofE(n):78 ACollectionofDiceProblemsMatthewM.Conroy n E(n) 1 7 2 56 5=11:2 3 1302 9513:70526 4 3752 24715:19028 5 837242 5211716:06466 6 4319412 26058516:57583 10 9932935945754444 57764543448254517:19556 20 17:26399 30 17:26412371400800701809841213 100 17:26412423601867057324993502 250 17:26412422187783220247082379 6 8 10 12 14 16 18 0 5 10 15 20 25 30 SoweseethatagameofDropDead,using5dice,willhave,onaverage,ascoreofabout16:06.Furtherquestions:Noticethatifweplaythegamewithmorethan5dice,theexpectedscoredoesnotincreaseverymuch.Infact,itappearsasifthereisanupperboundontheexpectedscore;thatis,itseemsthatthereissomeBsothatE(n)Bforalln.WhatisthesmallestpossiblevalueforB?Also,weexpectE(n)toalwaysincreaseasnincreases.Canweprovethisisso?(b)Calculatingtheexactprobabilitiesofscoresseemstobeabitofapain.Theeasiestscoretoworkoutiszero.Togetzero,theplayermustrollatleastone2or5oneveryroll.IfwedeneaMarkovprocess,withstates0,F,5,4,3,2,1(inthatorder),where0meansascoreofzerohasbeenachieved,Fmeansascoregreaterthan0hasbeenachieved,and5through1arethecurrentnumberofdicebeingrolled,wehavethefollowingtransitionmatrix:P0=0BBBBBBB@100000001000001 24332 243080 24380 24340 24310 2431 8116 810032 818 278 811 278 270004 92 91 94 900004 91 32 3000001CCCCCCCA79 ACollectionofDiceProblemsMatthewM.ConroySincethegamestakesatmostverolls,thefthpowerofthismatrixtellsuswhatwewanttoknow:P50=0BBBBBBB@10000000100000978853 47829693804116 4782969000004163 1968315520 196830000055 243188 243000007 2720 27000001 32 3000001CCCCCCCAThusweseethattheprobabilityofachievingascoreofzerois978853 4782969=978853 314,whichisabout0:2046538457598::::Theprobabilityofachievingascoreof1iscalculableinasimilarway.OurtransitionmatrixisP1=0BBBBBBB@10000000100000011 81080 24380 24340 24310 243017 810032 818 278 8101 30004 92 905 900004 91 1817 18000001CCCCCCCAAnoteonthislower-leftmostentry:oncetheplayerhasonlyonedieleft,theyhavea1/6chanceofrollingaone;butthen,thediemustdie,whichoccurswithprobability1/3.Hencethe1/18probabilityofgettingascoreof1afterthestateofonedieisattained.RaisingthismatrixtothefthpoweryieldsP51=0BBBBBBB@10000000100000305285 143489074477684 4782969000001300 5904918383 196830000017 729226 243000002 8125 27000001 1817 18000001CCCCCCCAandthustheprobabilityofascoreof1inthisgameis305285=14348907=0:0212758365497804118:::.Scoreshigherthan1aremoredifcult,sinceitwillnotbenecessarytoreachasingledie.Ontheotherhand,toachieveascoreofn,therecanbeatmostn+4rolls,sotheproblemisnite.59.ThreesInthegameofThrees,theplayerstartsbyrollingvestandarddice.Inthegame,thethreescountaszero,whiletheotherfacescountnormally.Thegoalistogetaslowasumaspossible.Oneachroll,atleastonediemustbekept,andanydicethatarekeptareaddedtotheplayer'ssum.Thegamelastsatmostverolls,andthescorecanbeanywherefrom0to30.Forexampleagamemightgolikethis.Ontherstrolltheplayerrolls2�3�3�4�6Theplayerdecidestokeepthe3s,andsohasascoreofzero.Theotherthreedicearerolled,andtheresultis1�5�580 ACollectionofDiceProblemsMatthewM.ConroyHeretheplayerkeepsthe1,sotheirscoreis1,andre-rollstheothertwodice.Theresultis1�2Here,theplayerdecidestokeepbothdice,andtheirnalscoreis4.Ifaplayerplaysoptimally(i.e.,usingastrategywhichminimizestheexpectedvalueoftheirscore),whatistheexpectedvalueoftheirscore?Thisiscertainlybestanalysedinreverse.Supposewearerollingonedie.Thentheexpectedvalueoftheresultis1+2+0+4+5+6 6=3:Supposewerolltwodice.Therulesrequirethatwekeepatleastone,soclearlywemustkeepthelowerofthetwo.Thequestioniswhethertokeeptheotherone.Ifwedon'tkeepit,ourexpectedvaluefromitwillbe3whenwereroll.Hence,weshouldkeepitifitisa3,a1,ora2.Followingthismethod,theexpectedvaluewithtwodiceisexpressibleasE2=1 366Xi=16Xj=1(minfi;jg+minfmaxfi;jg;3g)=158 36=79 18=4:388::::Supposewerollthreedice.Wemustkeepthelowestdie,soweneedtodecidewhethertokeepeitheroftheothertwodice.Obviously,ifwekeeponlyoneofthem,wewouldkeepthelowerone.Callthethreediced1d2d3:Thenifwekeepbothd2andd3,oursumisd2+d3.Ifwere-rollonlyd3,thenourexpectedsumisd2+3.Ifwere-rollbothd2andd3,thenourexpectedsumisE2=4:3888:::.Thuswewanttochoosetheoptionsothatourexpectedsumisminfd2+d3;d2+3;E2g:Analyzingthis,wendthatifd24,weshouldre-rollboth.Ifd2=3,weshouldkeepbothifd33.Ifd2=2,thenweshouldkeepd3ifd3=2;otherwiseweshouldre-rollboth.(Thisisthesurprisingpartoftheoptimalstrategy:atwoisnotnecessarilykeepablebyitself:itdependsonthevalueoftheotherdie.)Ifd2=1andd3=1or2,keepboth;otherwise,keepd2andre-rolld3.ThecalculationoftheexpectedvaluewiththreedicecanbeexpressedasE3=1 636Xi;j;k=00(d1+minfd2+d3;d2+3;E2g)=2261 263=5:233796:::wherethesumskips3,andd1d2d3isfi;j;kgsortedinincreasingorder.Continuinginthisway,theexpectedvaluewithfourdicecanbeexpressedasE4=1 646Xi;j;k;l=00(d1+minfd2+d3+d4;d2+d3+3;d2+E2;E3g)=1663107 67=5:833858:::81 ACollectionofDiceProblemsMatthewM.Conroywherethesumskips3,andd1d2d3d4isfi;j;k;lgsortedinincreasingorder.Finally,theexpectedvaluewithvedicecanbeexpressedasE5=1 656Xi;j;k;l;m=00 d1+min(5Xn=2dn;d2+d3+d4+3;d2+d3+E2;d2+E3;E4)!=13613549985 612=6:253978525::::wherethesumskips3,andd1d2d3d4d5isfi;j;k;l;mgsortedinincreasingorder.Thus,theexpectedscoreinthisgame,playedwithanoptimalstrategy,isabout6.25398.But,whatistheoptimalstrategy?Itisessentiallyencodedabove,butisthereamoresimplestatement?Asmallsimplicationismadebynotingthatasumofintegersislessthan,say,4.38888...onlyifthesumislessthanorequalto4.SotheEivaluesthatappearinthesumsabovecanbereplacedbytheirintegerparts.Itisatrickystrategytoparaphrase.Considerthatifyouroll3-3-3-2-2,youshouldkeepallthedice,butifyouroll3-3-2-2-2,youshouldre-rollthe2s,since6�E3=5:233796:::.Thestrategyisnotsummarizabletoa“thisdieorlessshouldalwaysbekeptonrolli”simplicity.Afurtherquestion:whatistheprobabilityofgettingascoreofzero?Thisquestionhasmorethanoneinterpretation:(a)whatistheprobabilityofgettingascoreofzeroifplayedusingthe“optimal”strategyabove,and(b)whatistheprobabilityofgettingascoreofzeroiftheplayerdoeseverythingpossibletogetascoreofzero(i.e.,keepsonly3saslongaspossible).(SpecialthankstoDavidKorsnackforinspiringmetolookintothisproblem,andforprovidingsomenumericswithwhichIcouldcomparemycalculations.)60.Supposeweplayagamewithadiewherewerollandsumourrollsaslongaswekeeprollinglargervalues.Forinstance,wemightrollasequencelike1-3-4andthenrolla2,sooursumwouldbe8.Ifwerolla6rst,thenwe'rethroughandoursumis6.Threequestionsaboutthisgame:(a)Whatistheexpectedvalueofthesum?(b)Whatistheexpectedvalueofthenumberofrolls?(c)Ifthegameisplayedwithann-sideddie,whathappenstotheexpectednumberofrollsasnapproachesinnity?WecanconsiderthisgameasaMarkovchainwithanabsorbingstate.Ifweconsiderthestatetobethevalueofthelatestroll,or7ifthelatestrollisnotlargerthanthepreviousone,thenwehavethefollowingtransitionmatrix:P=0BBBBB@01=61=61=61=61=61=6001=61=61=61=62=60001=61=61=63=600001=61=64=6000001=65=6000000100000011CCCCCA(3.20)82 ACollectionofDiceProblemsMatthewM.ConroyUsingthenotationofAppendixD,wehaveQ=0BBBB@01=61=61=61=61=6001=61=61=61=60001=61=61=600001=61=6000001=60000001CCCCAsothatN=(I�Q)�1isN=0BBBB@11=67=3649=216343=12962401=7776011=67=3649=216343=12960011=67=3649=21600011=67=36000011=60000011CCCCATherowsumofNis0BBBB@16807=77762401=1296343=21649=367=611CCCCAandsotheexpectednumberofrollsbeforeabsorption(i.e.,thenumberofrollsthatcountinthesum)is(1=6)(16807=7776+2401=1296+343=216+49=36+7=6+1)=70993=77761:521626:WeuseNtocalculatetheexpectedsumaswell.Iftherstrollisa1,theexpectedsumwillbe1+21 6+37 36+449 216+5343 1296+62401 7776=6:Infact,foranyrstroll,theexpectedsumis6.Hence,theexpectedsumis6.Now,supposethegameisplayedwithann-sideddie.LetEbetheexpectednumberofrolls.LetE(j)betheexpectednumberofrollsiftherstrollisj.Then,E(j)=1+1 nE(j+1)+1 nE(j+2)++1 nE(n)andsoE(j+1)=1+1 nE(j+2)+1 nE(j+3)++1 nE(n)fromwhichwecanconcludeE(j)=1+1 nE(j+1):SinceE(n)=1,wehaveE(j)=1+1 nn�j:Thus,E=1 nnXj=1E(j)=1 nnXj=11+1 nn�j=1 nn+1 nnnXj=1n n+1j83 ACollectionofDiceProblemsMatthewM.Conroy=n+1 nn1�n n+1n=n+1 nn�1:Andsoweseethatlimn!1E=e�1=1:718281828459::::61.Supposeweplayagamewithadiewherewerollandsumourrolls.Wecanstopanytime,andthesumisourscore.However,ifoursumiseveramultipleof10,ourscoreiszero,andourgameisover.Whatstrategywillyieldthegreatestexpectedscore?Whataboutthesamegameplayedwithvaluesotherthan10?Let'sgeneralizethingsrightaway.Supposewewanttoavoidmultiplesofm.Fornow,let'ssupposem6.Supposewehavebeenplaying,andoursumisn,andkmn(k+1)mforsomeintegerk&#x]TJ/;༕ ;.9;‘ ;&#xTf 5;.24;&#x 0 T; [0;0.Ifourscoreislessthan(k+1)m�6,thenweshouldcertainlyrolluntilitisatleast(k+1)m�6,sincethereisnorisk.Suppose(k+1)m�6n(k+1)m.Shouldwerolltogetpast(k+1)m?Thereisatleasta1=6chancethatthiswillresultinascoreofzero,andthebestourscorecouldbe(withoutriskinganothermultipleofm)is(k+2)m�1.HencetheexpectedvalueEofourscorewithriskingonemultipleofmisE5 6((k+2)m�1)andthisislessthan(k+1)m�6ifk�4+31 m:Hence,ifk�4+31 m,thenweshouldstoprollingifourscore,n,isintheintervalkmn(k+1)mandpossiblyearlier.Supposem=10.Then4+31 10=7:1,so(withk=8�7:1)weshoulddenitelystoprollingifourscoreisbetween84and89.Wecanthenworkoutanoptimalstrategyrecursivelyasfollows.LetE(x)betheexpectedvalueofourultimatescoreifoursumiseverx.ThenE(84)=84,E(85)=85,E(86)=86,E(87)=87,E(88)=88,andE(89)=89(sincewewillstopatanyofthosescores).WealsoknowE(x)=0ifxisapositivemultipleofm.Wecanthendenef(n)=1 66Xi=1E(n+i).Then,iff(n)�n,weshouldrollwhenoursumisnandE(n)=f(n).Ontheotherhand,iff(n)n,weshouldstoprollingwhenoursumisnandE(n)=n.Inthisway,wecancalculateE(n)downwardfromn=83ton=0,notingwhetherwestoprollingornottocreateouroptimalstrategyandtheexpectedvalueofourstrategy.84 ACollectionofDiceProblemsMatthewM.ConroyWritingalittlecode,wecanthusndthatweshouldrollunlessthesumis24or25orgreaterthan33.Withthisstrategy,theexpectedscoreis162331123011053862884431 12281884428929630994432=13:21711859042473::::Applyingthissamemethodtoothervaluesofm,wehavethefollowingtable.mstopifexpectedvalue 6n197:2214516231082868127n158:5850328184428388648n=18orn2610:129829194997043939n=21;22orn3011:6791613241799614710n=24;25,orn3313:2171185904247315011n=27;28orn3814:7282356456330995912n=30;31orn4216:2753438316806873613n=33;35;35orn4617:9054941497690036414n=36;37;38orn5019:4336215731855040115n=39;40;41orn5420:9709443404738028516n=42;43;44;58;59;60;61;62orn7422:5157152433952986717n=45;46;47;62;63;64;65;66orn7924:0723080016441488318n=48;49;50;66;67;68;69;70orn8425:6421135285006977919n=51;52;53;70;71;72;73;74orn8927:2136075350295673920n=54;55;56;74;75;76;78orn9428:75912955252540060For2m5,itisprobablybesttoattackeachoneseparately,whichperhapsIwilldosomeothertime.62.Supposeweplayagamewithadieinwhichweusetworollsofthedietocreateatwodigitnumber.Theplayerrollsthedieonceanddecideswhichofthetwodigitstheywantthatrolltorepresent.Then,theplayerrollsasecondtimeandthisdeterminestheotherdigit.Forinstance,theplayermightrolla5,anddecidethisshouldbethe“tens”digit,andthenrolla6,sotheirresultingnumberis56.Whatstrategyshouldbeusedtocreatethelargestnumberonaverage?Whataboutthethreedigitversionofthegame?Astrategyinthisgameismerelyarulefordecidingwhethertherstrollshouldbethe“tens”digitorthe“ones”digit.Iftherstrollisa6,thenitmustgointhe“tens”digit,andifit'sa1,thenitmustgointhe“ones”digit.Thisleavesuswithwhattodowith2,3,4and5.Iftherstrollisb,thenusingitasthe“ones”digitresultsinanexpectednumberof7 210+b.Usingitasthe“tens”digitresultsinanexpectednumberof10b+7 2.So,whenis10b+7 2�7 210+b?Whenb4.Thus,iftherstrollis4,5or6,theplayershoulduseitforthe“tens”digit.Withthisstrategy,theexpectedvalueofthenumberis1 6(63:5+53:5+43:5+38+37+36)=45:25:Inthethree-digitversionofthegame,oncewehavedecidedwhattodowiththerstroll,we'llbedone,sincewewillthenbeinthetwo-digitcasewhichwesolvedabove.Notethisisobviouslytrueifweplacetherstrollinthe“hundreds”digit.Ifweplacetherstrollinthe“ones”digit,thenthestrategytomaximizetheresultingnumberisthesameasthetwo-digitcase,simplymultipliedbyafactoroften.Ifweplacetherstrollinthe“tens”digit,thenourstrategyistoputthenextrollbinthe“hundreds”digitif100b+3:5�350+b85 ACollectionofDiceProblemsMatthewM.Conroyi.e.,ifb4.Thuswehavethesamestrategyinallthreecases:putthesecondrollinthelargestdigitifitisatleast4.Now,iftherstroll,b,isplacedinthe“hundreds”digit,thentheexpectedvaluewillbe100b+45:25.Iftherstrollisplacedinthe“ones”digit,thentheexpectedvaluewillbe452:5+b.Iftherstrollisplacesinthe“tens”digit,thentheexpectedvaluewillbe10b+(351+352+353+403:5+503:5+603:5)=6=427:75+10b:Ourstrategythuscomesdowntomaximizingthequantities100b+45:25;427:75+10b;and452:5+b.Fromthegraphbelow,weseethat100b+45:25isthelargestwhenb5;427:75+10bislargestwhen3b4,and452:5+bislargestwhenb3.Thusourstrategyfortherstrollisthis:ifitisatleast5,putitinthe“hundreds”digit;ifitis3or4,putitinthe“tens”digit;otherwise,putitintheonesdigit.Ifthesecondrollis4,5,or6,placeitinthelargestavailabledigit. 2 3 4 5 200 250 300 350 400 450 500 550 600 Theexpectedvalueusingthisstrategyisthus(645:25+545:25+(40+427:75)+(30+427:75)+(452:5+2)+(452:5+1))=6=504:63.Supposewerollasingledie,repeatedlyifwelike,andsum.Wecanstopatanypoint,andthesumbecomesourscore;however,ifweexceeed10,ourscoreiszero.Whatshouldourstrategybetomaximizetheexpectedvalueofourscore?Whatistheexpectedscorewiththisoptimalstrategy?Whataboutlimitsbesides10?Weconsiderthegamerstwithalimitof10.86 ACollectionofDiceProblemsMatthewM.ConroyWeneedtodecide,ifourcurrentscoreisn,whetherornotweshouldcontinuerolling.Supposeourcurrentscoreis10.Thenrollingwillnothelp,sinceourscorewouldbecomezero.Sowemust“stick”(i.e.,notroll)ifourscoreis10.Supposeourcurrentscoreis9.Thenrollingwillgiveusanexpectedscoreof1 610+5 60=10 69:Sincetheexpectedvalueislessthan9,itisbettertostickon9thantoroll.Supposeourcurrentscoreis8.Thenrollingwillgiveusanexpectedscoreof1 69+1 610+4 60=19 68soweshouldstickon8.Supposeourcurrentscoreis7.Thenrollingwillgiveusanexpectedscoreof1 68+1 69+1 610+3 60=9 27soweshouldstickon7.Supposeourcurrentscoreis6.Thenrollingwillgiveusanexpectedscoreof1 67+1 68+1 69+1 610+2 60=17 36soweshouldstickon6.Supposeourcurrentscoreis5.Thenrollingwillgiveusanexpectedscoreof1 66+1 67+1 68+1 69+1 610+1 60=20 3�5:Sincetheexpectedvalueisgreaterthan5,weshouldroll,eventhoughthereisachancethatwewillendupwithascoreofzero.Ifourcurrentscoreislessthan4,thenthereisnochancethatonemorerollwillresultinascoreofzero(i.e.,alowerscorethanthecurrentscore),soitisalwaysbettertoroll.Hence,theoptimalstrategyis:rollagainifthescoreis5orless,andstickotherwise.Tocalculatetheexpectednalscorewiththisstrategy,letE(m)betheexpectednalscorestartingwithacurrentscoreofm.ThenweseekE(0).Ifm�5,E(m)=m.Ifm=5,wehaveE(5)=1 6P10i=6E(i)=20 3.ThenE(4)=1 66Xi=1E(4+i)=70 9E(3)=1 66Xi=1E(3+i)=200 2787 ACollectionofDiceProblemsMatthewM.ConroyE(2)=1 66Xi=1E(2+i)=1157 162E(1)=1 66Xi=1E(1+i)=6803 972E(0)=1 66Xi=1E(i)=40817 5832Thus,theexpectedvalueofthescoreis40817 5832=6:99879972565157:::,justthetiniestbitlessthan7.Whataboutotherlimits?Supposethelimitisk(soweloseallpointsifthescoreeverexceeedsk).Thenifourcurrentscoreisn=k�1,ourexpectedscoreifwerollis1 6(n+1)whichisgreaterthannifandonlyifn1 5,i.e.,n=0.Thus,shouldalwaysstoponifourcurrentscoreisk�1orgreater.Supposeourcurrentscoreisn=k�2.Ifweroll,ourexpectedscoreis1 6(n+1+n+2)=1 6(2n+3)whichisgreaterthannifandonlyifn3 4,i.e.,n=0.Soweshouldalwaysstopifourcurrentscoreisk�2orgreater.Supposeourcurrentscoreisn=k�3.Thentheexpectedscoreifwerollis1 6(n+1+n+2+n+3)=1 6(3n+6)whichisgreaterthannifandonlyifn2,i.e.,k5.Hence,weshouldstickonk�3orgreater,unlessk=4,inwhichcaseweshouldrollonk�3.Supposeourcurrentscoreisn=k�4.Thentheexpectedscoreifwerollis1 6(n+1+n+2+n+3+n+4)=1 6(4n+10)whichisgreaterthannifandonlyifn5,i.e.,k9.Henceweshouldstickonk�4orgreater,unlessk=5;6;7;or8,inwhichcaseweshouldrollonk�4.Supposeourcurrentscoreisn=k�5.Thentheexpectedscoreifwerollis1 6(n+1+n+2+n+3+n+4+n+5)=1 6(5n+15)whichisgreaterthannifandonlyifn15,i.e.,k20.Hence,weshouldstickonk�5orgreaterifk20,andotherwiserollonk�5.Letkbethelimitinourgame,andletsbethestickingvalue,i.e.,weshouldstoprollingifoutscoreisatoraboves.Then,forallk20,thestickingvalueisk�5.Forsmallervaluesofk,thesvaluesaresummarizedinthetablebelow.Whataretheexpectedscoresusingthisoptimalstrategy?Foranyk,letE(x)betheexpectedvalueofournalscoreifourscoreisx.Ifk=1,thentheexpectedscoreis1 6(1)=1 6.Ifk=2,thentheexpectedscoreis1 6(1)+1 6(2)=1 2.Ifk=3,thentheexpectedscoreis1 6(1+2+3)=1.Ifk=4,thentheexpectedscoreis1 6(2+3+4)+1 6(1 6(2+3+4))=7 4=1:75.Ifk=5,thentheexpectedscoreis1 6(2+3+4+5)+1 6(1 6(2+3+4+5))=49 18=2:72:Supposek=6.Westickon3orgreater.ThenE(3)=3;E(4)=4;E(5)=5;andE(6)=6.ThenE(2)=1 6(E(3)+E(4)+E(5)+E(6))andE(1)=1 6(E(2)+E(3)+E(4)+E(5)+E(6)).Finally,theexpectedscoreis1 66Xi=1E(i)=49 12=4:083:88 ACollectionofDiceProblemsMatthewM.ConroySupposek=7.Westickon4orgreater.ThenE(4)=4;E(5)=5;E(6)=6;andE(7)=7,andwemaysetE(x)=0ifx�7.ThenE(j)=1 6P6i=1E(j+i)forj=0;1and2.TheexpectedscoreisthenE(0)=3017 6484:6558642:Usingthesametechnique,wehavethefollowingtableofresults.ksE(0)E(0)approx. 111/60.166666 211/20.5 3111 427/41.75 5249/182.722222 6349/124.083333 743017/6484.655864 8520629/38885.305813 9546991/77766.043081 10640817/58326.998800 11784035/103688.105228 1287695859/8398089.163831 139101039827/1007769610.026084 141055084715/503884810.932006 15114307852885/36279705611.874002 161213976066993/108839116812.841033 171360156375517/435356467213.817729 18141131329591/7652750414.783307 19157388908661401/47018498457615.714897 20152611098542647/15672832819216.660029 504546.666667 1009596.666667 Thecalculationssuggestthattheexpectedscoreapproachesk�10 3askgoestoinnity.Provingthatwouldbenice.Letf(k;m)betheexpectedscoreofthegamewithalimitofkwhereweusethestrategyofstoppingonmorgreater.Wecancalculatef(k;m)inPARI/GPwiththefollowingcode:f(k,m)=A=vector(k+6);for(i=m,k,A[i]=i);for(j=1,m-1,A[m-j]=1/6*sum(n=1,6,A[m-j+n]));return(1/6*sum(i=1,6,A[i]))89 Chapter4ProblemsforthefutureHerearesomeproblemsthatIintendtoaddtothiscollectionsometimeinthefuture,assoonasIgetaroundtowritingdecentsolutions.1.MoreDropDead:probabilityofgettingzero?probabilityofanyparticularvalue?2.MoreThrees:probabilityofgettinganyparticularscore?3.LawofLargeNumbersrelated:Whatistheexpectednumberofrollsofasingledieneededuntilthereisa99%chancethattheproportionof2s(say)throwniswithinsomespeciedintervalaround1/6(e.g.,1=6�0:01r1=6+0:01?4.Ifadieisrolled100times(say),whatistheprobabilitythatallsixsideshaveappearedatleastonce?Ifadieisrolled100times(say),whatistheprobabilitythatthereisarunof6thathasallsixpossiblefaces?Whataboutarunof10withallsixfacesatleastonce?5.Foreverycompositen,thereappeartobepairsof“weird”dicewithnsides(i.e.apairofdicenotnumberedintheusualwaywithsumprobabilitiesequaltothestandarddice).Provethis.Formanyn,therearemanysuchpairs.Giveusefulboundsonthenumberofsuchpairsintermsofn.Forn=4k+2,itappearsthatthedicef1;2;2;3;3;:::;2k+3;2k+3;2k+4g;f1;3;5;:::;2k+1;2k+2;2k+3;:::;n�1;n;n+2;n+4;:::;6k+2gdothetrick.90 Bibliography[1]DuaneM.Broline.Renumberingofthefacesofdice.MathematicsMagazine,52(5):312–314,1979.[2]PhilippeFlajolet,DanieleGardy,LoysThimonier.BirthdayParadox,couponcollectors,cachinalgo-rithms,andself-organizingsearch.DiscreteAppliedMathematics,39(1992),207–229[3]PhilippeFlajolet,RobertSedgwick.AnalyticCombinatorics,CambridgeUniversityPress,2009.[4]LewisC.Robertson,RaeMichaelShortt,andStephenG.Landry.Dicewithfairsums.Amer.Math.Monthly,95(4):316–328,1988.91 ACollectionofDiceProblemsMatthewM.ConroyAdditionalreading[Ang1]Angrisani,Massimo,Anecessaryandsufcientminimaxconditionfortheloadeddiceproblem(Italian),Riv.Mat.Sci.Econom.Social.8(1985),no.1,3-11[Ble1]Blest,David;HallamColin,Thedesignofdice,Math.Today(Southend-on-Sea)32(1996),no.1-2,8-13[Bro1]Broline,DuaneM.,Renumberingofthefacesofdice,Math.Mag.52(1979),no.5,312-314[Dia1]Diaconis,Persi;Keller,JosephB.,Fairdice,Amer.Math.Monthly,96(1989),no.4,337-339[Faj1]Fajtlowitz,S.,n-dimensionaldice,Rend.Math.(6)4(1971),855-865[Fel1]Feldman,David;Impagliazzo,Russell;Naor,Moni;Nisan,Noam;Rudich,Steven;Shamir,Adi,Ondiceandcoins:modelsofcomputationforrandomgeneration,Inform.andComput.104(1993),159-174[Fer1]Ferguson,ThomasS.,Onaclassofinnitegamesrelatedtoliardice,Ann.Math.Statist.41(1970)353-362[Fre1]Freeman,G.H.,Thetacticsofliardice,J.Roy.Statist.Soc.Ser.C38(1989),no.3,507-516[Gan1]Gani,J.,Newtonon“aquestiontouchingyedifferentoddsuponcertaingivenchancesupondice”,Math.Sci.7(1982),no.1,61-66[Gri1]Grinstead,CharlesM.,Onmediansoflatticedistributionsandagamewithtwodice,Combin.Probab.Comput.6(1997),no.3,273-294[Gup1]Gupta,ShantiS.;Leu,LiiYuh,Selectingthefairestofk2,m-sideddice,Comm.Statist.TheoryMethods,19(1990),no.6,2159-2177[Ito]Itoh,Toshiya,Simulatingfairdicewithbiasedcoins,Inform.andCompu.126(1996),no.1,78-82[Koo]Koole,Ger,Anoptimaldicerollingpolicyforrisk,NieuwArch.Wisk.(4)12(1994),no.1-2,49-52[Mae1]Maehara,Hiroshi;Yamada,Yasuyuki,HowManyicosahedraldice?,RyukyuMath.J.7(1994),35-43[McM1]McMullen,P.,Adiceprobabilityproblem,Mathematika21(1974),193-198[Pom1]Pomeranz,JanetBellcourt,Thediceproblem-thenandnow,CollegeMath.J.15(1984),no.3,229-237[Rob1]Roberts,J.D.,Atheoryofbiaseddice,Eureka1955(1955),no.18,8-11[Rob2]*Robertson,LewisC.,Shortt,RaeMichael;Landry,StephenG.,Dicewithfairsums,Amer.Math.Monthly95(1988),no.4,316-328[Sav1]Savage,RichardP.,Jr.,Theparadoxofnon-transitivedice,Amer.Math.Monthly101(1994),no.5,429-436[She1]Shen,Zhizhang;Marston,ChristianM.,AStudyofadiceproblem,Appl.Math.Comput.73(1993),no.2-3,231-247[Sol1]SoldeMora-Charles,Leibnizetleproblemedespartis.Quelchespapiersinedits[Leibnizandtheproblemofdice.Someunpublishedpapers],HistoriaMath.13(1986),no.4,352-369[Wys1]Wyss,Roland,IdentitatenbeidenStirling-Zahlen2.ArtauskombinatorischenUberlegungenbeinWurfelspiel[IdentitiesforStirlingnumbersofthesecondkindfromcombinatorialconsiderationsinagameofdice],Elem.Math.51(1996),no.3,102-10692 AppendixADicesumprobabilitiesSumsof2,6-SidedDice SumProbability 21/36 32/36=1/18 43/36=1/12 54/36=1/9 65/36 76/36=1/6 85/36 94/36=1/9 103/36=1/12 112/36=1/18 121/36 Sumsof3,6-SidedDice SumProbability 31/216 43/216=1/72 56/216=1/36 610/216=5/108 715/216=5/72 821/216=7/72 925/216 1027/216=1/8 1127/216=1/8 1225/216 1321/216=7/72 1415/216=5/72 1510/216=5/108 166/216=1/36 173/216=1/72 181/216=1/216 93 AppendixBHandySeriesFormulasForjrj1,1Xn=0arn=a 1�r(B.1)Forjrj1,NXn=0arn=a(1�rN+1) 1�r(B.2)Forjrj1,1Xn=1nrn=r (1�r)2(B.3)Forjrj1,NXn=1nrn=r�1�rN(1+N�Nr) (1�r)2(B.4)Forjrj1,1Xn=1(n+k)rn=r(1+k�kr) (1�r)2(B.5)Forjrj1,1Xn=1n2rn=r(1+r) (1�r)3(B.6)94 AppendixCDiceSumsandGeneratingFunctionsVeryofteninmathematicsagoodchoiceofnotationcantakeyoualongway.Anexampleofthisisthefollowingmethodforrepresentingsumsofdice.Supposewehaveann-sideddie,withsides1;2;:::;nthatappearwithproba-bilityp1;p2;:::;pn,respectively.Then,ifwerollthedietwiceandaddthetworolls,theprobabilitythatthesumiskisgivenbynXj=1pjpk�j=n�kXj=k�1pjpk�j(C.1)ifwesaypi=0ifi1ori&#x]TJ/;༕ ; .96;& T; 16;&#x.715;&#x 0 T; [0;n.Nowconsiderthefollowingpolynomial:P=p1x+p2x2++pnxn(C.2)IfwesquareP,wegetP2=a2x2+a3x3++a2nx2n(C.3)whereak,fork=2,3,...,2n,isgivenbyak=n�kXj=k�1pjpk�j:(C.4)Inotherwords,theprobabilityofrollingthesumofkisthesameasthecoefcientofxkinthepolynomialgivenbysquaringthepolynomialP.Here'sanexample.Supposeweconsiderastandard6-sideddie.ThenP=1 6x+1 6x2+1 6x3+1 6x4+1 6x5+1 6x6(C.5)andsoP2=x2 36+2x3 36+3x4 36+4x5 36+5x6 36+6x7 36+5x8 36+4x9 36+3x10 36+2x11 36+x12 36(C.6)=x2 36+x3 18+x4 12+x5 9+5x6 36+x7 6+5x8 36+x9 9+x10 12+x11 18+x12 36(C.7)Andso,weseethattheprobabilityofrollingasumof9,forinstance,is1=9.Fortwodifferentdicethemethodisthesame.Forinstance,ifwerolla4-sideddie,anda6-sideddie,andsumthem,theprobabilitythatthesumisequaltokisgivebythecoefcientonxkinthepolynomialx 4+x2 4+x3 4+x4 4x 6+x2 6+x3 6+x4 6+x5 6+x6 6(C.8)which,whenexpanded,isx2 24+x3 12+x4 8+x5 6+x6 6+x7 6+x8 8+x9 12+x10 24:(C.9)95 ACollectionofDiceProblemsMatthewM.ConroyNoticethatthiscanbewrittenas1 24�x2+2x3+3x4+4x5+4x6+4x7+3x8+2x9+x10(C.10)Ingeneral,afairn-sideddiecanberepresentedbythepolynomial1 n�x+x2+x3++xn(C.11)Withthisnotation,manyquestionsaboutdicesumscanbetransformedintoequivalentquestionsaboutpolyno-mials.Forinstance,askingwhetherornotthereexistotherpairsofdicethatgivethesamesumprobabilitiesasapairofstandarddiceisthesameasasking:inwhatwayscanthepolynomial(x+x2+x3+x4+:::+xn)2befactoredintotwopolynomials(withcertainconditionsonthedegreesandcoefcientsofthosepolynomials)?Usingmoregeneralterminology,suchpolynomialsarecalledgeneratingfunctions.Theycanbeappliedinlotsofsituationsinvolvingdiscreterandomvariables,includingsitationsinwhichthevariablestakeoninnitelymanyvalues:insuchcases,thegeneratingfunctionwillbeapowerseries.96 AppendixDMarkovChainFactsAMarkovchainisamathematicalmodelfordescribingaprocessthatmovesinasequenceofstepsthroughasetofstates.AniteMarkovchainhasanitenumberofstates,fs1;s2;:::;sng.Whentheprocessisinstatesi,thereisaprobabilitypijthattheprocesswillnextbeinstatesj.ThematrixP=(pij)iscalledthetransitionmatrixfortheMarkovchain.Notethattherowsofthematrixsumto1.Theij-thentryofPk(i.e.thek-thpowerofthematrixP)givestheprobabilityoftheprocessmovingfromstateitostatejinexactlyksteps.Anabsorbingstateisonewhichtheprocesscanneverleaveonceitisentered.Anabsorbingchainisachainwhichhasatleastoneabsorbingstate,andstartinginanystateofthechain,itispossibletomovetoanabsorbingstate.Inanabsorbingchain,theprocesswilleventuallyendupinanabsorbingstate.LetPbethetransitionmatrixofanabsorbingchain.Byrenumberingthestates,wecanalwaysrearrangePintocanonicalform:P=0@Q R O J1AwhereJisanidentitymatrix(with1'sonthediagonaland0'selsewhere)andOisamatrixofallzeros.QandRarenon-negativematricesthatarisefromthetransitionprobabilitiesbetweennon-absorbingstates.TheseriesN=I+Q+Q2+Q3+:::converges,andN=(I�Q)�1.ThematrixNgivesusimportantinformationaboutthechain,asthefollowingtheoremshows.Theorem1LetPbethetransitionmatrixforanabsorbingchainincanonicalform.LetN=(I�Q)�1.Then:Theij-thentryofNistheexpectednumberoftimesthatthechainwillbeinstatejafterstartinginstatei.Thesumofthei-throwofNgivesthemeannumberofstepsuntilabsorbtionwhenthechainisstartedinstatei.Theij-thentryofthematrixB=NRistheprobabilitythat,afterstartinginnon-absorbingstatei,theprocesswillendupinabsorbingstatej.Anergodicchainisoneinwhichitispossibletomovefromanystatetoanyotherstate(thoughnotnecessarilyinasinglestep).Aregularchainisoneforwhichsomepowerofitstransitionmatrixhasnozeroentries.Aregularchainisthereforeergodic,thoughnotallergodicchainsareregular.Theorem2SupposePisthetransitionmatrixofanergodicchain.ThenthereexistsamatrixAsuchthatlimk!1P+P2+P3++Pk k=AForregularchains,limk!1Pk=A:97 ACollectionofDiceProblemsMatthewM.ConroyThematrixAhaseachrowthesamevectora=(a1;a2;:::;an).Onewaytointerpretthisistosaythatthelong-termprobabilityofndingtheprocessinstateidoesnotdependontheinitialstateoftheprocess.Thecomponentsa1;a2;:::;anareallpositive.Thevectoraistheuniquevectorsuchthata1+a2++an=1andaP=aForthisreason,aissometimescalledthexedpointprobabilityvector.ThefollowingtheoremissometimescalledtheMeanFirstPassageTheorem.Theorem3SupposewehavearegularMarkovchain,withtransitionmatrixP.LetE=(eij)beamatrixwhere,fori6=j,eijistheexpectednumberofstepsbeforetheprocessentersstatejforthersttimeafterstartinginstatei,andeiiistheexpectednumberofstepsbeforethechainre-entersstatei.ThenE=(I�Z+JZ0)DwhereZ=(I�P�A)�1,A=limk!1Pk,Z0isthediagonalmatrixwhosediagonalentriesarethesameasZ,Jisthematrixofall1's,andDisadiagonalmatrixwithDii=1=Aii.98 AppendixELinearRecurrenceRelationsHere'sausefultheorem:Theorem2Considerthelinearrecurrencerelationxn=a1xn�1+a2xn�2++ak:(E.1)Ifthepolynomialequation(knownasthecharacteristicequationoftherecurrencerelation)xn�a1xn�1�a2xn�2��ak=0(E.2)haskdistinctrootsr1;:::rk,thentherecurrencerelationE.1hasasageneralsolutionxn=c1rn1+c2rn2++ckrnk:(E.3)forsomeconstantsc1;:::;ck.Proof:Wecanprovethiswithabitoflinearalgebra,butwe'lldothatsomeothertime.Example:Mayaswelldotheoldclassic.TheFibonaccinumbersaredenedbyf0=1;f1=1;andfn=fn�1+fn�2forn�1:Thecharacteristicequationisx2�x�1=0whichhasrootsr1=1+p 5 2andr2=1�p 5 2:Sofn=A 1+p 5 2!n+B 1�p 5 2!nforconstantsAandB.Sincef0=1=A+Bandf1=1=A+B+p 5 2(A�B)weconcludethatA=1+p 5 2p 5andB=�1+p 5 2p 5sothatfn=(1+p 5)n+1�(1�p 5)n+1 2n+1p 5:99 Indexcouponcollector'sproblem,16,19,40Craps,7,72,73expectation,4–6,8–11,16,19–21,24,29,30,33,34,39,45,54,56,75,78,79,82generatingfunctions,43,54,58,92inclusion-exclusion,12,15,21,25linearprogramming,69Markovchain,16,29,34,41,52,74,77,80,94multiset,17PARI/GP,28,29,38,42,86recursion,11,24,27,28,33,34,47,49stars-and-barsmethod,30Yahtzee,7,8,73,74100

Related Contents


Next Show more