找回密码
 立即注册
搜索
总共850条微博

动态微博

查看: 2161|回复: 4
打印 上一主题 下一主题
收起左侧

好多堆石子

[复制链接]

15

主题

42

帖子

807

积分

跳转到指定楼层
楼主
发表于 2005-2-27 12:29:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

桌面上有10堆珠子,每堆的数目分别为a1,a2...a10,每次可以从中拿出一个或3个或拿走一堆。拿最后一一手的人获胜,但最后一把只能拿一个或3个(拿三个只能从同堆中拿),请你分析胜负并说明理由。

www.ddhw.com

 
回复

使用道具 举报

53

主题

363

帖子

4139

积分

沙发
发表于 2005-2-28 18:08:03 | 只看该作者

回复:好多堆石子


Not 100% sure whether it is correct:www.ddhw.com
 
Suppose there are K piles among the 10 that have an even number of beads. If it is your turn and K = 0, 4, 6, 8, 10, you lose. Otherwise you win.
www.ddhw.com

 
回复 支持 反对

使用道具 举报

53

主题

363

帖子

4139

积分

板凳
发表于 2005-3-1 18:46:34 | 只看该作者

General Strategy


This is an interesting game, quite different from the NIM game, where no restriction exists for the number of beads you can take from one pile.
 www.ddhw.com
For this game we define a state as the number of piles (N) and how many of the piles have even number of beads (K). A state is a losing state if the current player will lose as long as his opponent does not make a mistake. A state is a winning state if the current player can make a move to produce a losing state. If a state is not a losing state, then it is a winning state.
 
The following is a complete list of losing states.
 
1. N = 1, K = 1.
2. N = 2, K = 0.
3. N > 1 and is an odd number, K = 2.www.ddhw.com
4. N > 2 and is even, K = 0, 4, 6, ..., N.
 
So the strategy is to always produce a losing state for your opponent.
 
Here is a proof for the above result.
 
1. N = 1, K = 1. This means one pile with even number of beads. Obviously you cannot win.
2. N = 2, K = 0. Two piles both odd. Let's call the state (O, O). Then you can produce either (O) or (O, E). And you opponent will give you (E), which is above.www.ddhw.com
3. Let's consider (O, E, E). Then the possible sequences are
 a) (O, E, E) -> (E, E) -> (E)
 b) (O, E, E) -> (O, E) -> (E)
 c) (O, E, E) -> (O, O, E) -> (O, O)
 d) (O, E, E) -> (E, E, E) -> (O, E, E)
And you always lose.
Now we start from the states (O, E, E) and (O, O), and we can prove 3 and 4 using induction. I omitted the proof. If you like, you can fill in youself.
www.ddhw.com

 
回复 支持 反对

使用道具 举报

15

主题

42

帖子

807

积分

地板
 楼主| 发表于 2005-3-2 10:49:26 | 只看该作者

答案


一堆的时候,奇数个先取胜,偶数个后取胜
因此两堆的时候,都是奇数则后取胜,至少一堆是偶数则先取胜
三堆的时候,都是奇数或者两奇一偶则先取胜,
两偶一奇则后取胜,三偶则先取胜
四堆的时候,0或3堆奇数则后取胜,1 2或4堆奇数则后取胜
等等,10堆的时候,有0 3 6或9堆奇数则后取胜,否则先取胜。
一般地,当奇数堆个数减偶数堆个数被3除余2时后取胜,否则先取胜
fzy® 的答案我还没有时间仔细看,你先看看我的答案

 

www.ddhw.com

 
回复 支持 反对

使用道具 举报

53

主题

363

帖子

4139

积分

5#
发表于 2005-3-2 18:09:20 | 只看该作者

回复:答案


We are the same up to three. For 4, I have 0或4堆奇数则后取胜,1 2或3堆奇数则先取胜. For 10, I have 有0, 2, 4, 6, 或10堆奇数则后取胜,否则先取胜.www.ddhw.com
 
I have a proof. Can you give your proof?
www.ddhw.com

 
回复 支持 反对

使用道具 举报

24小时热帖
    一周热门
      原创摄影
        美食美文
          您需要登录后才可以回帖 登录 | 立即注册

          本版积分规则

          Archiver|手机版|珍珠湾ART

          Powered by Discuz! X3 © 2001-2013 All Rights Reserved