首页 > 试题广场 >

Consider you are in a coin gam

[单选题]
Consider you are in a coin game with the following rules, 
There are 2 players in the game - you and your rival.
There are random numbers of coins on the table, you and your rival take turns to grab the coins.
Your rival takes the first turn.
Each person must grab at least one coin and up to 3 coins in his/her turn. 
The person left with the last coin on the table loses.
What’s the likelihood of you winning the game given both you and your rival adopts the most optimized strategy?
  • 0%
  • 10%
  • 20%
  • 25%
具体看这堆硬币有多少: 如果是4n+1枚,(n为非负整数)先手必输。因为不管先手每轮怎么拿(拿x个),后手每轮补到4个(即拿4-x个),最后后手能拿到4n,先手必拿第4n+1,也就是最后一枚。 如果是4n+x枚,(n为非负整数,x={0,2,3})先手必胜。我们把x=0看作x=4,n=n-1。此时先手第一轮只要拿x-1枚,就能将问题转化为:先手变后手,后手变先手,取4n+1枚硬币的问题。这个问题之前讨论过,此时是转变后的后手必胜,也就是转变前的先手必胜。 如果硬币总数N%4==1,后手必胜,其他情况先手必胜,所以总胜率25%。
编辑于 2021-08-19 10:58:02 回复(0)