Tải bản đầy đủ - 0 (trang)
Hack 42. Play with Cards and Get Lucky

Hack 42. Play with Cards and Get Lucky

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

Thebet

Alittleflush(oops,sorry;Imeanli'lflush)isanytwocardsof

thesamesuit.Frankhasawagerthathealmostalwayswins

thathastodowithfindingtwocardsofthesamesuitinyour

hand.Again,becauseoftimeconstraints,hispokerhandshave

onlyfourcards,notfive.

Thewageristhatyoudealmefourcardsoutofarandomdeck,

andIwillgetatleasttwocardsofthesamesuit.Whilethis

mightnotseemtoolikely,itisactuallymuchlesslikelythat

therewouldbefourcardsofalldifferentsuits.Ifigurethe

chanceofgettingfourdifferentsuitsinafour-cardhandis

about11percent.So,thelikelihoodofgettingali'lflushis

about89percent!



Whyitworks

Thereareavarietyofwaystocalculateplaying-cardhand

probabilities.Forthisbarbet,Iuseamethodthatcountsthe

numberofpossiblewinninghandcombinationsandcomparesit

tothetotalnumberofhandcombinations.Thisisthemethod

usedin"PlaywithDiceandGetLucky"[Hack#43].

Tothinkabouthowoftenfourcardswouldrepresentfour

differentsuits,withnotwo-cardflushesamongstthem,count

thenumberofpossiblefour-cardhands.Imagineanyfirstcard

(52possibilities),imaginethatcardcombinedwithany

remainingsecondcard(52x51),addathirdcard(52x51x50)

andafourthcard(52x51x50x49),andyou'llgetatotalof

6,497,400differentfour-cardhands.

Next,imaginethefirsttwocardsofafour-cardhand.Thesewill

matchonly.2352ofthetime(12cardsofthesamesuitremain

outofa51-carddeck).So,aboutone-and-a-halfmillionfourcarddealswillfindaflushinthefirsttwocards.Theywon't



matchanother.7648ofthetime.Thisleaves4,968,601hands

withtwodifferentlysuitedfirsttwocards.

Ofthatnumberofhands,howmanywillnotreceiveathirdcard

thatdoesnotsuitupwitheitherofthefirsttwocards?There

are50cardsremaining,and26ofthosehavesuitsthathave

notappearedyet.So,26/50(52percent)ofthetime,thethird

cardwouldnotmatcheithersuit.

Thatleaves2,583,673handsthathavethreefirstcardsthatare

allunsuited.Now,ofthatnumber,howmanywillnowdrawa

fourthcardthatisthefourthunrepresentedsuit?Thereare13

outof49cardsremainingthatrepresentthatfinalfourthsuit.

26.53percentoftheremaininghandswillhavethatsuitasthe

fourthcard,whichcomputesto685,464four-cardcombinations

withfourdifferentsuits.685,464dividedbythetotalnumberof

possiblehandsis.1055(685,464/6497400).

There'syour11percentchanceofhavingfourdifferentsuitsin

afour-cardhand.Whew!Bytheway,somesuper-genius-type

couldgetthesameproportionbyusingjusttherelevant

proportions,whichweusedalongthewayduringourdifferent

countingsteps,andnothavetocountatall:



FindingaMatchwithTwoDecksofCards

Youhaveadeckofcards.Ihaveadeckofcards.Theyareboth

shuffled(or,perhaps,souffl\x8ed,asmyspellchecksuggested

Imeanttosay).Ifwedealtthemoutoneatatimeandwent

throughbothdecksonetime,wouldtheyevermatch?Imean,

wouldtheyevermatchexactly,withtheexactsamecardfor

example,usbothturninguptheJackofClubsatthesame

time?



Thebet



Mostpeoplewouldsayno,oratleastthatitwouldcertainly

happenoccasionally,butnottoofrequently.Astoundingly,not

onlywillyouoftenfindatleastonematchwhenyoupass

throughapairofdecks,butitwouldbeoutoftheordinarynot

to.Ifyoumakethiswagerorconductthisexperimentmany

times,youwillgetatleastonematchonmostoccasions.In

fact,youwillnotfindamatchonly36.4percentofthetime!



Whyitworks

Here'showtothinkaboutthisproblemstatistically.Becausethe

decksareshuffled,onecanassumethatanytwocardsthatare

flippeduprepresentarandomsamplefromatheoretical

populationofcards(thedeck).Theprobabilityofamatchfor

anygivensamplepairofcardscanbecalculated.Becauseyou

aresampling52times,thechanceofgettingamatch

somewhereinthoseattemptsincreasesasyousamplemore

andmorepairsofcards.Itisjustlikegettinga7onapairof

dice:onanygivenroll,itisunlikely,butacrossmanyrolls,it

becomesmorelikely.

Tocalculatetheprobabilityofhittingtheoutcomeonewishes

acrossaseriesofoutcomes,themathisactuallyeasierifone

calculatesthechancesofnotgettingtheoutcomeand

multiplyingacrossattempts.Foranygivencard,thereisa1out

of52chancethatthecardintheotherdeckisanexactmatch.

Thechancesofthatnothappeningare51outof52,or.9808.

Youaretryingtomakeamatchmorethanonce,though;you

aretrying52times.Theprobabilityofnotgettingamatch

across52attempts,then,is.9808multipliedbyitself52times.

Foryoumathtypes,that's.980852.

WaitasecondandI'llcalculatethatinmyhead(.9808times

.9808times.9808andsoonfor52timesis...about...0.3643).

OK,sothechancethatitwon'thappenis.3643.Togetthe



chancethatitwillhappen,wesubtractthatnumberfrom1and

get.6357.

You'llfindatleastonematchbetweentwodecksabouttwothirdsofthetime!Remarkable.Goforthandwinthatfree

lemonade.







Hack43.PlaywithDiceandGetLucky



Herearesomehonestwagersusinghonestdice.Just

becauseyouaren'tcheating,though,doesn'tmeanyou

won'twin.

Itisanunfortunatestereotypethatstatisticiansareglasseswearingintrospectivenerdswhoneverhaveabeerwiththe

gang.Thisissuchanabsurdbelief,thatjustthinkingaboutit

lastSaturdayandSundayatmyweeklyDungeons&Dragons

gathering,Ilaughedsohardthatmymonoclealmostlandedin

mysherry.

Thetruthisthatdisplayingknowledgeofsimpleprobabilitiesin

abarcanbequiteentertainingforthepatronsandmakeyou

thelifeoftheparty.Atleast,that'swhathappensaccordingto

myUncleFrank,whoforyearshasusedhisstatsskillstowin

freedrinksandpickledeggs(orwhateverthosethingsarein

thatbigjarthatarealwaysdisplayedinthebarsIseeonTV).

Hereareafewwaystowinabetusinganyfairpairofdice.



DistributionofDiceOutcomes

First,let'sgetacquaintedwiththepossibilitiesoftwodicerolled

once.You'llrecallthatmostdicehavesixsides(myfantasy

role-playingfriendsandIcallthesesix-sideddice)andthatthe

valuesrangefrom1to6oneachcube.

Calculatingthepossibleoutcomesisamatteroflistingand

countingthem.Figure4-2showsallpossibleoutcomesfor

rollingtwodice.



Figure4-2.Possibleoutcomesfortwodice



ThisdistributionresultsinthefrequenciesshowninTable4-15.

TableFrequencyofoutcomesforrollingtwodice



Totalroll

2

3

4

5

6

7

8

9

10

11

12

Totalnumberofpossibleoutcomes



Chances

1

2

3

4

5

6

5

4

3

2

1

36



Frequency

2.8percent

5.6percent

8.3percent

11.1percent

13.9percent

16.7percent

13.9percent

11.1percent

8.3percent

5.6percent

2.8percent

100percent



Thegameofcraps,ofcourse,isbasedentirelyonthese

expectedfrequencies.Someinterestingwagersmightcometo

mindasyoulookatthisfrequencydistribution.Forexample,

whilea7isthemostcommonrollandmanypeopleknowthis,

itisonlyslightlymorelikelytocomeupthana6or8.



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

Hack 42. Play with Cards and Get Lucky

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

×