找回密码
 欢迎注册
查看: 3452|回复: 11

[讨论] 掷硬币选择策略

[复制链接]
发表于 2024-3-19 20:52:30 | 显示全部楼层 |阅读模式
下面的问题以前讨论过么?有的话请来个链接 ,没有的话大家可以看看 。上周在x上很火很多人都无法理解答案的问题。

掷硬币100 次——给出了一系列正面 (H) 和反面 (T)。

现在你有选择权,可以选择积分规则。

规则A:对于序列中的每个HH,你会都会得到一分;对于每个HT,对手都会得一分。

规则B:反过来,对于序列中的每个HH,对手会都会得到一分;对于每个HT,则你得一分。

比如说HHHT,按A规则你得2分,对手1分。

问:为了积分最高你应该选择哪条规则?又或者说,它们的获胜概率是一样的?



单选投票, 共有 4 人参与投票

投票已经结束

25.00% (1)
0.00% (0)
75.00% (3)
您所在的用户组没有投票权限
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2024-3-20 11:08:53 来自手机 | 显示全部楼层
规则有点不清楚,是只有分数比对手高就赢,还是分数尽量高?
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
回复

使用道具 举报

 楼主| 发表于 2024-3-21 15:29:25 | 显示全部楼层
mathe 发表于 2024-3-20 11:08
规则有点不清楚,是只有分数比对手高就赢,还是分数尽量高?

哦,我昨天没理解你的意思。现在想明白了。追求的是胜利的场次,比如玩这个游戏100轮(每轮投100次),胜出数更多的那个策略。不是单次胜负里,有可能使积分最高的策略。
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
回复

使用道具 举报

 楼主| 发表于 2024-3-21 15:34:43 | 显示全部楼层

为了追求胜利的概率最大,答案是选B。

我把这个问题还转载在煎蛋网:https://jandan.net/p/115970#/

有网友提供了模拟代码,https://codepen.io/lunar-dark/pen/NWmpKpM

每次扔100个币,连续扔100k次,HH胜45k左右,HT胜48k左右

毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
回复

使用道具 举报

发表于 2024-3-21 17:57:50 | 显示全部楼层
本帖最后由 BeerRabbit 于 2024-3-21 21:26 编辑

扔n次硬币,在所有可能的序列(共有2^n个)中,满足“其所包含的(10)组个数大于(11)组个数”的序列个数为A(n)。
则A(n)(n=1~15)的前几个数字为:
{0, 1, 3, 6, 13, 28, 56, 113, 231, 464, 930, 1875, 3766, 7547, 15151}
如果把规则描述中的“大于”改成“小于”和“等于”则对应的结果分别是——
小于:
{0, 1, 2, 4, 10, 21, 42, 89, 184, 371, 758, 1546, 3122, 6315, 12782}
等于:
{2, 2, 3, 6, 9, 15, 30, 54, 97, 189, 360, 675, 1304, 2522, 4835}
其中只有“等于”对应的数列在OEIS上能查到(A163493)

补一个MMA代码:

  1. F[n_, X_] := Module[{Y, a, b},
  2.    Y = X[[# ;; # + 1]] & /@ Range[n - 1];
  3.    a = Select[Y, # == {1, 0} &] // Length;
  4.    b = Select[Y, # == {1, 1} &] // Length;
  5.    If[a > b, 1, If[a < b, -1, 0]]
  6.    ];

  7. Table[F[n, #] & /@ (IntegerDigits[# - 1, 2, n] & /@ Range[2^n]) // Count[#, 1] &, {n, 1, 15}]
  8. Table[F[n, #] & /@ (IntegerDigits[# - 1, 2, n] & /@ Range[2^n]) // Count[#, -1] &, {n, 1, 15}]
  9. Table[F[n, #] & /@ (IntegerDigits[# - 1, 2, n] & /@ Range[2^n]) // Count[#, 0] &, {n, 1, 15}]
复制代码

毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
回复

使用道具 举报

发表于 2024-3-21 21:44:27 | 显示全部楼层
设n个硬币的所有排列中,HH比HT多s个的方案中最后一个为HEAD的计数为count[n][HEAD][ s ],
最后一个为TAIL的计数为count[n][TAIL][ s ]
那么我们有
  1.             //count[level-1][HEAD][s] + TAIL => count[level][TAIL][s-1]
  2.             //count[level-1][HEAD][s] + HEAD => count[level][HEAD][s+1]
  3.             //count[level-1][TAIL][s] + TAIL => count[level][TAIL][s]
  4.             //count[level-1][TAIL][s] + HEAD => count[level][HEAD][s]
复制代码

就可以递归计算了,最后我们分别对s<0,s>0和所有s情况进行统计,就可以得到规则A结果如下
  1. Level 2{-:1; +:1; T:4}
  2.         Lost Ratio: 0.250000000; Win Ratio: 0.250000000
  3. Level 3{-:3; +:2; T:8}
  4.         Lost Ratio: 0.375000000; Win Ratio: 0.250000000
  5. Level 4{-:6; +:4; T:16}
  6.         Lost Ratio: 0.375000000; Win Ratio: 0.250000000
  7. Level 5{-:13; +:10; T:32}
  8.         Lost Ratio: 0.406250000; Win Ratio: 0.312500000
  9. Level 6{-:28; +:21; T:64}
  10.         Lost Ratio: 0.437500000; Win Ratio: 0.328125000
  11. Level 7{-:56; +:42; T:128}
  12.         Lost Ratio: 0.437500000; Win Ratio: 0.328125000
  13. Level 8{-:113; +:89; T:256}
  14.         Lost Ratio: 0.441406250; Win Ratio: 0.347656250
  15. Level 9{-:231; +:184; T:512}
  16.         Lost Ratio: 0.451171875; Win Ratio: 0.359375000
  17. Level 10{-:464; +:371; T:1024}
  18.         Lost Ratio: 0.453125000; Win Ratio: 0.362304688
  19. Level 11{-:930; +:758; T:2048}
  20.         Lost Ratio: 0.454101562; Win Ratio: 0.370117188
  21. Level 12{-:1875; +:1546; T:4096}
  22.         Lost Ratio: 0.457763672; Win Ratio: 0.377441406
  23. Level 13{-:3766; +:3122; T:8192}
  24.         Lost Ratio: 0.459716797; Win Ratio: 0.381103516
  25. Level 14{-:7547; +:6315; T:16384}
  26.         Lost Ratio: 0.460632324; Win Ratio: 0.385437012
  27. Level 15{-:15151; +:12782; T:32768}
  28.         Lost Ratio: 0.462371826; Win Ratio: 0.390075684
  29. Level 16{-:30398; +:25780; T:65536}
  30.         Lost Ratio: 0.463836670; Win Ratio: 0.393371582
  31. Level 17{-:60917; +:51962; T:131072}
  32.         Lost Ratio: 0.464759827; Win Ratio: 0.396438599
  33. Level 18{-:122116; +:104759; T:262144}
  34.         Lost Ratio: 0.465835571; Win Ratio: 0.399623871
  35. Level 19{-:244786; +:210934; T:524288}
  36.         Lost Ratio: 0.466892242; Win Ratio: 0.402324677
  37. Level 20{-:490435; +:424404; T:1048576}
  38.         Lost Ratio: 0.467715263; Win Ratio: 0.404743195
  39. Level 21{-:982544; +:853806; T:2097152}
  40.         Lost Ratio: 0.468513489; Win Ratio: 0.407126427
  41. Level 22{-:1968413; +:1716759; T:4194304}
  42.         Lost Ratio: 0.469306231; Win Ratio: 0.409307241
  43. Level 23{-:3942649; +:3450158; T:8388608}
  44.         Lost Ratio: 0.470000386; Win Ratio: 0.411290884
  45. Level 24{-:7896116; +:6932169; T:16777216}
  46.         Lost Ratio: 0.470645189; Win Ratio: 0.413189471
  47. Level 25{-:15813268; +:13924260; T:33554432}
  48.         Lost Ratio: 0.471272111; Win Ratio: 0.414975286
  49. Level 26{-:31665423; +:27959805; T:67108864}
  50.         Lost Ratio: 0.471851572; Win Ratio: 0.416633561
  51. Level 27{-:63403245; +:56130762; T:134217728}
  52.         Lost Ratio: 0.472390987; Win Ratio: 0.418206766
  53. Level 28{-:126945244; +:112662414; T:268435456}
  54.         Lost Ratio: 0.472907886; Win Ratio: 0.419700198
  55. Level 29{-:254152625; +:226080318; T:536870912}
  56.         Lost Ratio: 0.473396154; Win Ratio: 0.421107408
  57. Level 30{-:508798604; +:453595341; T:1073741824}
  58.         Lost Ratio: 0.473855626; Win Ratio: 0.422443581
  59. Level 31{-:1018538560; +:909925794; T:2147483648}
  60.         Lost Ratio: 0.474293977; Win Ratio: 0.423717217
  61. Level 32{-:2038870881; +:1825052601; T:4294967296}
  62.         Lost Ratio: 0.474711620; Win Ratio: 0.424928172
  63. Level 33{-:4081149015; +:3660020992; T:8589934592}
  64.         Lost Ratio: 0.475108276; Win Ratio: 0.426082522
  65. Level 34{-:8168806568; +:7339006091; T:17179869184}
  66.         Lost Ratio: 0.475487123; Win Ratio: 0.427186378
  67. Level 35{-:16350068706; +:14714278862; T:34359738368}
  68.         Lost Ratio: 0.475849628; Win Ratio: 0.428241877
  69. Level 36{-:32723948523; +:29497991764; T:68719476736}
  70.         Lost Ratio: 0.476196125; Win Ratio: 0.429252276
  71. Level 37{-:65493519976; +:59129191502; T:137438953472}
  72.         Lost Ratio: 0.476528075; Win Ratio: 0.430221491
  73. Level 38{-:131074624997; +:118514143839; T:274877906944}
  74.         Lost Ratio: 0.476846708; Win Ratio: 0.431151944
  75. Level 39{-:262317425785; +:237519754398; T:549755813888}
  76.         Lost Ratio: 0.477152618; Win Ratio: 0.432045916
  77. Level 40{-:524958142500; +:475985181699; T:1099511627776}
  78.         Lost Ratio: 0.477446649; Win Ratio: 0.432906001
  79. Level 41{-:1050538666974; +:953791746232; T:2199023255552}
  80.         Lost Ratio: 0.477729676; Win Ratio: 0.433734270
  81. Level 42{-:2102276334809; +:1911094220329; T:4398046511104}
  82.         Lost Ratio: 0.478002297; Win Ratio: 0.434532517
  83. Level 43{-:4206864396623; +:3828962014178; T:8796093022208}
  84.         Lost Ratio: 0.478265110; Win Ratio: 0.435302583
  85. Level 44{-:8418190639762; +:7671004379270; T:17592186044416}
  86.         Lost Ratio: 0.478518737; Win Ratio: 0.436046115
  87. Level 45{-:16844999783923; +:15367286674854; T:35184372088832}
  88.         Lost Ratio: 0.478763689; Win Ratio: 0.436764557
  89. Level 46{-:33706658979762; +:30783461520417; T:70368744177664}
  90.         Lost Ratio: 0.479000434; Win Ratio: 0.437459299
  91. Level 47{-:67445546718318; +:61661546052970; T:140737488355328}
  92.         Lost Ratio: 0.479229433; Win Ratio: 0.438131636
  93. Level 48{-:134953487689979; +:123506359586330; T:281474976710656}
  94.         Lost Ratio: 0.479451102; Win Ratio: 0.438782733
  95. Level 49{-:270027848607006; +:247367912956234; T:562949953421312}
  96.         Lost Ratio: 0.479665816; Win Ratio: 0.439413684
  97. Level 50{-:540290017770539; +:495424686385921; T:1125899906842624}
  98.         Lost Ratio: 0.479873934; Win Ratio: 0.440025515
  99. Level 51{-:1081034575458005; +:992186165234042; T:2251799813685248}
  100.         Lost Ratio: 0.480075790; Win Ratio: 0.440619170
  101. Level 52{-:2162951403461284; +:1986968023977076; T:4503599627370496}
  102.         Lost Ratio: 0.480271690; Win Ratio: 0.441195530
  103. Level 53{-:4327616247886287; +:3978979098703842; T:9007199254740992}
  104.         Lost Ratio: 0.480461920; Win Ratio: 0.441755421
  105. Level 54{-:8658562105558546; +:7967761493171689; T:18014398509481984}
  106.         Lost Ratio: 0.480646750; Win Ratio: 0.442299613
  107. Level 55{-:17323597897095126; +:15954589880068658; T:36028797018963968}
  108.         Lost Ratio: 0.480826431; Win Ratio: 0.442828826
  109. Level 56{-:34659789001937499; +:31946282845475983; T:72057594037927936}
  110.         Lost Ratio: 0.481001197; Win Ratio: 0.443343735
  111. Level 57{-:69344087881466419; +:63964801743634604; T:144115188075855872}
  112.         Lost Ratio: 0.481171269; Win Ratio: 0.443844973
  113. Level 58{-:138735901938024056; +:128070306599995123; T:288230376151711744}
  114.         Lost Ratio: 0.481336852; Win Ratio: 0.444333135
  115. Level 59{-:277564780813682810; +:256414803751661558; T:576460752303423488}
  116.         Lost Ratio: 0.481498141; Win Ratio: 0.444808780
  117. Level 60{-:555310775241402235; +:513364164018228986; T:1152921504606846976}
  118.         Lost Ratio: 0.481655319; Win Ratio: 0.445272434
  119. Level 61{-:1110974893383673726; +:1027770934429489042; T:2305843009213693952}
  120.         Lost Ratio: 0.481808557; Win Ratio: 0.445724592
  121. Level 62{-:2222639050259509267; +:2057576223894455283; T:4611686018427387904}
  122.         Lost Ratio: 0.481958017; Win Ratio: 0.446165722
  123. Level 63{-:4446623192062333919; +:4119123512725195326; T:9223372036854775808}
  124.         Lost Ratio: 0.482103853; Win Ratio: 0.446596266
  125. Level 64{-:8895872357517637214; +:8246001554861115252; T:18446744073709551616}
  126.         Lost Ratio: 0.482246207; Win Ratio: 0.447016640
  127. Level 65{-:17796873271053029653; +:16507151512508666042; T:36893488147419103232}
  128.         Lost Ratio: 0.482385217; Win Ratio: 0.447427238
  129. Level 66{-:35603766388874739620; +:33043906056811623823; T:73786976294838206464}
  130.         Lost Ratio: 0.482521011; Win Ratio: 0.447828434
  131. Level 67{-:71227115962775090666; +:66145682802046447046; T:147573952589676412928}
  132.         Lost Ratio: 0.482653712; Win Ratio: 0.448220581
  133. Level 68{-:142492519428947769307; +:132404535159512224412; T:295147905179352825856}
  134.         Lost Ratio: 0.482783435; Win Ratio: 0.448604015
  135. Level 69{-:285059920909917280960; +:265030453542522009918; T:590295810358705651712}
  136.         Lost Ratio: 0.482910290; Win Ratio: 0.448979052
  137. Level 70{-:570266342991310380669; +:530494118345662224495; T:1180591620717411303424}
  138.         Lost Ratio: 0.483034381; Win Ratio: 0.449345997
  139. Level 71{-:1140819396071763147249; +:1061836226580767416414; T:2361183241434822606848}
  140.         Lost Ratio: 0.483155808; Win Ratio: 0.449705134
  141. Level 72{-:2282200071943826876012; +:2125332856811397927619; T:4722366482869645213696}
  142.         Lost Ratio: 0.483274663; Win Ratio: 0.450056738
  143. Level 73{-:4565499267737216265302; +:4253917822433577627128; T:9444732965739290427392}
  144.         Lost Ratio: 0.483391038; Win Ratio: 0.450401069
  145. Level 74{-:9133151520435651789217; +:8514207139227413146745; T:18889465931478580854784}
  146.         Lost Ratio: 0.483505016; Win Ratio: 0.450738373
  147. Level 75{-:18270521550270342212311; +:17040900728868720133282; T:37778931862957161709568}
  148.         Lost Ratio: 0.483616679; Win Ratio: 0.451068887
  149. Level 76{-:36549311041555539630538; +:34106278272314587246334; T:75557863725914323419136}
  150.         Lost Ratio: 0.483726104; Win Ratio: 0.451392834
  151. Level 77{-:73114830956673371034931; +:68260550426788450056342; T:151115727451828646838272}
  152.         Lost Ratio: 0.483833365; Win Ratio: 0.451710431
  153. Level 78{-:146261446921943725859682; +:136615231045505248590849; T:302231454903657293676544}
  154.         Lost Ratio: 0.483938533; Win Ratio: 0.452021882
  155. Level 79{-:292585239027218816407710; +:273415125650727515981898; T:604462909807314587353088}
  156.         Lost Ratio: 0.484041674; Win Ratio: 0.452327382
  157. Level 80{-:585292796430823286927275; +:547192610993271223091380; T:1208925819614629174706176}
  158.         Lost Ratio: 0.484142854; Win Ratio: 0.452627119
  159. Level 81{-:1170825634177077110870280; +:1095096439280899592527454; T:2417851639229258349412352}
  160.         Lost Ratio: 0.484242133; Win Ratio: 0.452921272
  161. Level 82{-:2342122444333080831069525; +:2191589137328140534359061; T:4835703278458516698824704}
  162.         Lost Ratio: 0.484339570; Win Ratio: 0.453210011
  163. Level 83{-:4685169971453576402114239; +:4385920026959752499395522; T:9671406556917033397649408}
  164.         Lost Ratio: 0.484435221; Win Ratio: 0.453493502
  165. Level 84{-:9372156612423209494930690; +:8777225067884161265859068; T:19342813113834066795298816}
  166.         Lost Ratio: 0.484529140; Win Ratio: 0.453771901
  167. Level 85{-:18747881569295018566227193; +:17565029010192229555683562; T:38685626227668133590597632}
  168.         Lost Ratio: 0.484621380; Win Ratio: 0.454045358
  169. Level 86{-:37502773668565344580054000; +:35150844640588479920099541; T:77371252455336267181195264}
  170.         Lost Ratio: 0.484711989; Win Ratio: 0.454314019
  171. Level 87{-:75019323427359402521240804; +:70342541716306389892694826; T:154742504910672534362390528}
  172.         Lost Ratio: 0.484801015; Win Ratio: 0.454578021
  173. Level 88{-:150065723199619521733844549; +:140765387879978358194901747; T:309485009821345068724781056}
  174.         Lost Ratio: 0.484888503; Win Ratio: 0.454837499
  175. Level 89{-:300184674501703905185838253; +:281688662926108928889257276; T:618970019642690137449562112}
  176.         Lost Ratio: 0.484974498; Win Ratio: 0.455092580
  177. Level 90{-:600474008067095161152981134; +:563687808773224635460498999; T:1237940039285380274899124224}
  178.         Lost Ratio: 0.485059041; Win Ratio: 0.455343386
  179. Level 91{-:1201153839991509749206642088; +:1127986292896084679593168094; T:2475880078570760549798248448}
  180.         Lost Ratio: 0.485142172; Win Ratio: 0.455590036
  181. Level 92{-:2402712531475335480184774453; +:2257173917801257953591374762; T:4951760157141521099596496896}
  182.         Lost Ratio: 0.485223932; Win Ratio: 0.455832643
  183. Level 93{-:4806221543467443573003097204; +:4516711544274268550994147514; T:9903520314283042199192993792}
  184.         Lost Ratio: 0.485304356; Win Ratio: 0.456071316
  185. Level 94{-:9614010315089867177184044101; +:9038074678253724183092135879; T:19807040628566084398385987584}
  186.         Lost Ratio: 0.485383480; Win Ratio: 0.456306161
  187. Level 95{-:19231104991729941404294079361; +:18085304892440684110986199974; T:39614081257132168796771975168}
  188.         Lost Ratio: 0.485461341; Win Ratio: 0.456537280
  189. Level 96{-:38468281157842911503464095780; +:36188633299318103514887654313; T:79228162514264337593543950336}
  190.         Lost Ratio: 0.485537970; Win Ratio: 0.456764768
  191. Level 97{-:76948514655739529604967508868; +:72412753410981598089324159996; T:158456325028528675187087900672}
  192.         Lost Ratio: 0.485613399; Win Ratio: 0.456988722
  193. Level 98{-:153920563783770743671444551799; +:144895388740592532690382440637; T:316912650057057350374175801344}
  194.         Lost Ratio: 0.485687661; Win Ratio: 0.457209230
  195. Level 99{-:307887475013879139393113690181; +:289928413318724861004451642914; T:633825300114114700748351602688}
  196.         Lost Ratio: 0.485760784; Win Ratio: 0.457426381
  197. Level 100{-:615866238418960422359689555420; +:580127949239420834381088427404; T:1267650600228229401496703205376}
  198.         Lost Ratio: 0.485832798; Win Ratio: 0.457640259
复制代码

而对于长度为100,方案A的各种得分差分布为

  1. count[-50]=1
  2. count[-49]=1325
  3. count[-48]=294050
  4. count[-47]=26617290
  5. count[-46]=1330255815
  6. count[-45]=42919935835
  7. count[-44]=983156559210
  8. count[-43]=17033316749820
  9. count[-42]=233400608147735
  10. count[-41]=2614381239414735
  11. count[-40]=24550574713787010
  12. count[-39]=197150946519643550
  13. count[-38]=1375679410685414450
  14. count[-37]=8451073972164127108
  15. count[-36]=46210399961145343413
  16. count[-35]=227004362149489184022
  17. count[-34]=1009860516432421484187
  18. count[-33]=4096712177858121360399
  19. count[-32]=15247749308938974542421
  20. count[-31]=52350824044788156054216
  21. count[-30]=166607171077709190756060
  22. count[-29]=493645720376366009163516
  23. count[-28]=1367143433188619109053352
  24. count[-27]=3551954012109459164577376
  25. count[-26]=8686109884277283187997106
  26. count[-25]=20055225149893348816333554
  27. count[-24]=43844627549786945958589680
  28. count[-23]=91001422499460503626585260
  29. count[-22]=179763829541066577971612952
  30. count[-21]=338757354861894875655388932
  31. count[-20]=610315290987050592852426198
  32. count[-19]=1053386609896119310058220228
  33. count[-18]=1745118407135736558029089726
  34. count[-17]=2780043435628079169902430486
  35. count[-16]=4265870818552696769971996446
  36. count[-15]=6315241299298077313067374248
  37. count[-14]=9033468660829178932648222012
  38. count[-13]=12503156034451523603337781244
  39. count[-12]=16767474523347110492502105992
  40. count[-11]=21814598828347171620337357152
  41. count[-10]=27566098692592563661052910714
  42. count[-9]=33871849156423377148712374730
  43. count[-8]=40513231768576837533202703640
  44. count[-7]=47215173793461455702590625004
  45. count[-6]=53666145312218517883076816204
  46. count[-5]=59543892735365660957139789376
  47. count[-4]=64543704258920714616943515626
  48. count[-3]=68405570616760641713507980732
  49. count[-2]=70936793516426715075493432331
  50. count[-1]=72027343751505931141583428951
  51. count[0]=71656412569848144755925222552
  52. count[1]=69889902879368773013173398330
  53. count[2]=66869833498941600008977020285
  54. count[3]=62797584077826886590138297533
  55. count[4]=57913469629702003919294540728
  56. count[5]=52475267875032276436535696432
  57. count[6]=46738074687809409100604254222
  58. count[7]=40937334350174219405131043774
  59. count[8]=35276210892780037700873584024
  60. count[9]=29917762478918476882474277364
  61. count[10]=24981757635389467855166986572
  62. count[11]=20545499627554709440186102728
  63. count[12]=16647734116451790331493872286
  64. count[13]=13294601803478278796908527364
  65. count[14]=10466633422619434205715329714
  66. count[15]=8125926604510988498320158730
  67. count[16]=6222846658893522578565699494
  68. count[17]=4701814476526100204432324608
  69. count[18]=3505952179066875448077681428
  70. count[19]=2580529813081249595335291068
  71. count[20]=1875284165409224711691937404
  72. count[21]=1345762480733919638881619816
  73. count[22]=953884541799647548467422492
  74. count[23]=667924788912881555961042316
  75. count[24]=462101645635764580234757556
  76. count[25]=315933195502895341298309504
  77. count[26]=213484478528509628644574020
  78. count[27]=142597606903299702697618140
  79. count[28]=94165295328566214405929076
  80. count[29]=61483190066811250498536216
  81. count[30]=39697162852338816024840079
  82. count[31]=25348214742043061522139419
  83. count[32]=16008996325093659482849398
  84. count[33]=10001161522302185560020758
  85. count[34]=6180791128771176344008963
  86. count[35]=3779023811996709991594019
  87. count[36]=2286066208917365558991896
  88. count[37]=1368359999967026032354752
  89. count[38]=810476154998045342538654
  90. count[39]=475041466638122452084414
  91. count[40]=275546274649221072591904
  92. count[41]=158178293697206665493492
  93. count[42]=89867648637382149651024
  94. count[43]=50533126782451168142548
  95. count[44]=28123845113051129416418
  96. count[45]=15491932054735130750508
  97. count[46]=8446422906616520626494
  98. count[47]=4558036012110548547798
  99. count[48]=2434549498994866786034
  100. count[49]=1287036656999057467424
  101. count[50]=673422983571685912648
  102. count[51]=348737888851294898280
  103. count[52]=178735377499734476360
  104. count[53]=90658265801360274016
  105. count[54]=45506194887963205806
  106. count[55]=22603387487011330494
  107. count[56]=11109477277752161064
  108. count[57]=5402634939088716388
  109. count[58]=2599348281853560988
  110. count[59]=1237186710532642568
  111. count[60]=582504495903896934
  112. count[61]=271258374586669636
  113. count[62]=124915774672520357
  114. count[63]=56888561881025689
  115. count[64]=25615767980815224
  116. count[65]=11399249487823014
  117. count[66]=5014926877132547
  118. count[67]=2180915576957059
  119. count[68]=936384359299208
  120. count[69]=397188128932528
  121. count[70]=166612052646818
  122. count[71]=68893011316114
  123. count[72]=28088731372888
  124. count[73]=11348888534124
  125. count[74]=4513130425164
  126. count[75]=1759354998368
  127. count[76]=683049732010
  128. count[77]=261506110220
  129. count[78]=96634341361
  130. count[79]=35818805501
  131. count[80]=13299438184
  132. count[81]=4606342574
  133. count[82]=1599386433
  134. count[83]=586908453
  135. count[84]=189264458
  136. count[85]=58562524
  137. count[86]=21967781
  138. count[87]=6714397
  139. count[88]=1655690
  140. count[89]=664210
  141. count[90]=206498
  142. count[91]=32856
  143. count[92]=14727
  144. count[93]=5330
  145. count[94]=390
  146. count[95]=198
  147. count[96]=101
  148. count[97]=2
  149. count[98]=1
  150. count[99]=1
复制代码

评分

参与人数 1威望 +6 金币 +6 贡献 +6 经验 +6 鲜花 +6 收起 理由
wayne + 6 + 6 + 6 + 6 + 6 赞一个!

查看全部评分

毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
回复

使用道具 举报

发表于 2024-5-4 10:01:12 | 显示全部楼层
我就不算的这么细了,先算前15项,然后只统计大于,等于,小于三种情况的频率。很快找到分别对应A371358, A163493A371564, 也发现了生成函数。
  1. tmp=Table[{n,Map[Length,GroupBy[Table[Count[p,0]-Count[p,1],{p,MovingMap[FromDigits[#,10]&,#,1]&/@Tuples[{0,1},n]}],Sign]]},{n,2,10}];
  2. #[1]&/@tmp[[All,2]]
  3. #[0]&/@tmp[[All,2]]
  4. #[-1]&/@tmp[[All,2]]
复制代码

  1. expr={1/(2 (1-2 x))-(1+x)/(2 Sqrt[(1-x) (1-2 x) (1+x+2 x^2)]),1/(2 (1-x))+(1+2 x)/(2 Sqrt[(1-2 x) (1-x) (1+x+2 x^2)]),1/2  x(1/(1-3 x+2 x^2)-1/Sqrt[(1-x) (1-2 x) (1+x+2 x^2)])};
  2. SeriesCoefficient[expr,{x,0,100}]/2^100
复制代码

{145031987309855208595272106851/316912650057057350374175801344,8957051571231018094490652819/158456325028528675187087900672,153966559604740105589922388855/316912650057057350374175801344}
也就是{0.45764, 0.0565269, 0.485833}

毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
回复

使用道具 举报

发表于 2024-5-7 19:15:07 | 显示全部楼层
好像很容易证啊,遍历所有由H和T组成的长度为n的序列,其中HH(或任何其它两位组合)出现的总次数F(n)=(n-1)*2^(n-2),所以两种选择胜率相同。

评分

参与人数 1金币 +12 鲜花 +12 收起 理由
wayne + 12 + 12 欢迎元老小朋友 归来

查看全部评分

毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
回复

使用道具 举报

发表于 2024-5-7 19:38:26 | 显示全部楼层
好地方 发表于 2024-5-7 19:15
好像很容易证啊,遍历所有由H和T组成的长度为n的序列,其中HH(或任何其它两位组合)出现的总次数F(n)=(n-1)* ...

啊不对,可能出现HH平均赢的分差更大,但赢的次数少的情况
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
回复

使用道具 举报

发表于 2024-5-8 10:08:02 | 显示全部楼层
mathe 发表于 2024-3-21 21:44
设n个硬币的所有排列中,HH比HT多s个的方案中最后一个为HEAD的计数为count[n][HEAD][ s ],
最后一个为TAIL ...

mathe的算法,我用Mathematica实现了一遍,结果完全一致
  1. With[{n=100},ans=Nest[KeySort@Merge[Flatten[{Table[Association[t-><|s-1->#[h][s]|>,h-><|s+1->#[h][s]|>],{s,Keys[#[h]]}],Table[Association[t-><|s->#[t][s]|>,h-><|s->#[t][s]|>],{s,Keys[#[t]]}]},1],KeySort@Merge[#,Total]&]&,<|h-><|0->1,1->1|>,t-><|-1->1,0->1|>|>,n-2];
  2. GroupBy[Normal[Merge[Values[ans],Total]],Sign[#[[1]]]&,Total[#[[All,2]]]&]]
复制代码
  1. <|-1->615866238418960422359689555420,0->71656412569848144755925222552,1->580127949239420834381088427404|>
复制代码
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

小黑屋|手机版|数学研发网 ( 苏ICP备07505100号 )

GMT+8, 2024-12-4 02:00 , Processed in 0.031330 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表