Solutio to 1 Th Evil Ward. This is o of thos vry rar PoWs (I caot thik of aothr cas) that o o solvd. About 10 of you submittd th basic approach, which givs a probability of 47%. I was shockd wh I foud that thr is a mthod that works with probability 48%. All of this (ad xtsios of a arly PoW i th sam vi) lads to may rsarch qustios, ad I hav b workig vry hard o this with Cartr ad Rickrt ovr th past fw wks. Mor ifo o rqust. Th problm: Problm 1 Th Evil Ward Alic ad Bob ar prisors of ward Charli. Alic will b brought ito Charli's room o Suday ad show 5 cards, umbrd 1,,, 4, 5, fac-up i a row i a radom ordr. Alic ca, if sh wishs, itrchag two cards. Sh th lavs th room ad Charli turs all cards fac-dow i thir placs. Bob is th brought to th room. Charli calls out a radom targt card T. Bob is allowd to tur ovr ONE CARD ONLY ad if, ad oly if, h fids th targt T, th two prisors ar frd. Th odds of succss sm poor. What is th prisors' bst stratgy? Exprss th probability of succss as % whr is th arst itgr to th actual probability of your stratgy. Not that Charli's two choics -- th iitial shuffl ad th choic of targt -- ar assumd to b purly radom. Sourc: Larry Cartr, Mark Rickrt, ad Sta Wago, who hav b workig o may variatios of this problm, fidig svral surpriss. Solutio. It is hlpful to thik of th cards as big bhid doors 1,,, 4, or 5. Th stadard approach to such problms is to us a cycl-splittig stratgy: Bob, o harig T, ops door T. Lt us call this stratgy (145), which idicats th door Bob ops o harig th targt T. Alic, o sig th shuffl, looks to s if thr ar ay traspositios. If so, sh chooss o ad switchs th two cards. If ot, sh looks for a cycl of lgth K (K ) ad splits it ito a fixd poit ad a cycl of lgth K - 1. If thr ar o cycls, th th cards ar i prfct ordr ad sh dos othig. Aothr way of sayig this is: Bob ops door T. Alic dos, as sh always dos for ay stratgy, th bst thig sh ca for Bob's ovrall prformac o th prmutatio h will s. This basic cycl-splittig stratgy has 84 good cass ovr all Charli s choics, for a succss probability of 84 5 5! = 47 1 %. Hr is th gral formula for cards. Proof. Lt T() b th umbr of prmutatios of {1,, } havig at last o traspositio. A formula for this is o OEIS: https://ois.org/a07616, which cits A00066. It is T() =! / k=1 (-1) k+1 1, ad it is asy drivd by stadard iclusio-xclusio argumts. k k! For our cas of = 5, o ca asily cout: th thr typs for th prmutatios with a traspositio ar (), (1), (111) with frqucis 0, 10, 15, rsp., for a total of T (5) = 45. I gral, startig from = 1, T-valus ar 0, 1,, 9, 45, 85, 1995. Lt f () b th umbr of succsss usig th basic cycl-splittig stratgy.
Thorm. f () =! - 1 + T() Proof. Amog all! possibilitis for Charli s shuffl, th umbr of fixd poits is! (ach i is a fixd poit of ( - 1)! prmutatios, so ( - 1)! i all). Also, for ay Charli shuffl (xcpt th idtity), Alic s switch ca always itroduc at last o mor fixd poit, so that is aothr! - 1 cass. But wh thr is a traspositio, Alic ca udo it, so that hr mov adds two to th cout istad of just o. QED So f (5) = 40-1 + 45 = 84 ad succss rat is 84 5 5! = 71 150 = 47 1 %, or 47% roudd. Now, a stratgy is just a rul tllig Bob what to do giv targt T. Th stratgy abov is (145) sic, o harig T, Bob ops door T. Aothr stratgy o might cosidr is this: (1). Hr Alic will plac card 1 bhid door 1. If Bob hars T = 1 h ops door 1. Othrwis h ops door. Thus thr ar xactly 5 5 stratgis (though oly thir typ mattrs. Thr ar oly sv typs: {{5}, {4, 1}, {, }, {, 1, 1}, {,, 1}, {, 1, 1, 1}, {1, 1, 1, 1, 1}}; th last mas 5 diffrt umbrs, th first mas all th sam: Bob ops door 1 o mattr what T is). I ach cas, Alic should do what is bst to maximiz Bob s chacs of succss. I was VERY surprisd wh I foud that stratgy (1145) (whos typ is {, 1, 1, 1}) bats (145). This optimal stratgy is: I short: Bob ops door T, xcpt h ops door 1 if T =. Th total succss cout for stratgy (1145) is 86, so th probability is 71.5 150 or 47 %, or 48% roudd. O ca quickly chck all sv typs of stratgis to coclusivly prov that this is bst possibl. Th Thorm abov has a aalog for th w stratgy. Lt f 11 45 b th cout. Thorm. f 11 45... () = - T(i)! - + T() - ( - 1)! + ( - 1) T( - ) + ( - )! ( - ) - ( - )! i=0. i So f 11 45 (5) = 86. I will omit dtails of th proof sic, for th problm at had whr is just 5, a proof by cass ca b giv. Cas 1: 1XYZ. 6 prmutatios. Each prmutatio hr has 1 as a succss, cotributig 6. Th umbrs XYZ form a prmutatio that Alic ca apply th basic stratgy to, sic Bob s movs thr ar th basic stratgy. But f () = 6-1 + T() = 14. So th total cout i this cas is 6 + 14 = 0. Cas 1: 1XYZ. Idtical to Cas 1 sic th card bhid door 1 is a succss. 0 mor to
th cout. Cas 1: 1XYZ. Hr is a proxy for, 4, or 5, thus itroducig a factor of. Door 1 cotributs 1 for ach prmutatio, so 6 i all; w will ow igor door 1. Ad ovr ths six prmutatios 4 is a fixd poit twic, as is 5. So i all w hav 10 fixd poits. Now for ach of ths prmutatios Alic s switch ca add o mor fixd poit. So th cout is ow 16. Wh thr is a traspositio that dos NOT ivolv, hr switch will add ot 1. Th umbr of prmutatios with such a traspositio hr is 1 (oly 154). So th cout i this cas is 17, which gts multiplid by, for 51. Cas : XYZ idtical to Cas 1. Aothr 51 to th cout. So far w hav 51 + 51 + 0 + 0 = 14. Cas : XYZW. Hr is a proxy for, 4, or 5 itroducig a factor of. If 4 was usd, th th xt cas would b 4XY1W. Subcas: X1ZW: Thr ar 4 fixd poits (sic w do ot cout as a fixd poit as it lads to a bad choic) ad! from Alic s switch, ad a xtra 6 for th (1) traspositio that xists i all cass. So 16, ad so 48. Subcas: XZW : Idtical to prcdig cas. 48 Total is ow 96 + 14 = 8. Subcas: X4ZW. Hr 4 is a proxy for 4 or 5, itroducig a factor of. Th cout hr is 6 for Alic s movs, for th possibility of 5 big a fixd poit (w igor big a fixd poit), ad 0 for traspositios ot ivolvig. So 8. Doublig givs 16. Triplig givs 48. Total umbr of prmutatios: 6 + 6 + 6 + 6 + 6 + 6 + 6 6 = 10. Total cout of succsss is 8 + 48 = 86, as claimd. / Th formula i th thorm givs th xact aswr for th doubl-door mthod vry quickly. Wh = 5 th doubl-door mthod has about 10 1 mor succsss tha th basic mthod. Basic: 1905869151818958791918907846507441949071599515954 (114 ): 190586915181895879191890784650744776849104547944800 Th gai is 584584144594770546 Th succss probability for th basic mthod is about: 4.608%. Th probability icras usig doubl-door is about 10-8. But w ca do much bttr for = 5. Cosidr th multipl doubl door stratgy: (1144 ). Aftr som hard work (that, lik so much i math, sms obvious i practic), I hav a formula for th cout for this stratgy. It uss iclusio-xclusio as i th basic cas. Th formula (for divisibl by 4) is
4! - /! + j=1 Comparig th thr mthods: ( ) j (-1) j+1! (- j)! 4 j j! - j! (14 ): 190586915181895879191890784650744 1949071599515954 (114 ): 190586915181895879191890784650744 776849104547944800 (11 ): 1905 7905501978990959674887891554881619004878158 Th gai to th probability hr is substatial: th cout icrass by 10 64. Th probability (o just divids by 5 5!) icrass from 4.608% to 4.6095%. So aturally o wodrs: Op Problm 1. Is thr a bttr stratgy for = 5? Th umbr of possibl stratgis is ot larg: 81589 typs for 5 (th umbr of itgr partitios of 5). But it is ot clar how to rak ach ovr all of Charli's 5 5! choics. Prhaps for smallr o ca do this. I hav do this up to = 10. Aothr op qustio is this. Simo Plouff has foud mpirically that T(), th umbr of prmutatios with a traspositio, is T() =! -! 1 +!!. If = k is v, this looks bttr as: T() =! 1-1 k! k + k k!. Or w ca xprss this as th probability that a prmutatio has o traspositios: 1 + k! k -k k!. But this is ot provd i gral. Op problm : Prov Plouff's formula for T(). Not that k! k is ot a itgr. So th cojcturd formula ca b writt as follows, whr { } dots roudig: Probability(prmutatio of k has o traspositios) =? k! k k! k. Hr is a graph of th thr mthods discussd: 145, 114, ad 1144
5 Hr ar th optimal stratgis up to = 10, togthr with th bst I kow for 11. = 4: {1,,, 4} idtity = 5: {1, 1,,, 4} doubl-door = 6: {1,,, 4, 5, 6} idtity = 7: {1,,, 4, 5, 6, 7} idtity = 8: {1, 1,,,,, 4, 5} = 9: {1, 1,,,,, 4, 4, 5} multipl doubl-door = 10: {1, 1,,,,, 4, 4, 5, 5} multipl doubl-door = 11: {1, 1,,,,, 4, 4, 5, 5, 6} multipl doubl-door [ot provd bst]