<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>阅微堂 &#187; 游戏</title>
	<atom:link href="http://zhiqiang.org/blog/tag/%e6%b8%b8%e6%88%8f/feed" rel="self" type="application/rss+xml" />
	<link>http://zhiqiang.org/blog</link>
	<description>zhiqiang&#039;s personal blog</description>
	<lastBuildDate>Thu, 02 Sep 2010 00:59:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>堵猫游戏</title>
		<link>http://zhiqiang.org/blog/entertainment/cat-game.html</link>
		<comments>http://zhiqiang.org/blog/entertainment/cat-game.html#comments</comments>
		<pubDate>Fri, 15 May 2009 04:26:37 +0000</pubDate>
		<dc:creator>zhiqiang</dc:creator>
				<category><![CDATA[休闲娱乐]]></category>
		<category><![CDATA[flash游戏]]></category>
		<category><![CDATA[游戏]]></category>

		<guid isPermaLink="false">http://yueweitang.org/blog/?p=928</guid>
		<description><![CDATA[试试吧。

当在全平面棋盘上玩这个游戏的时候，我们总是可以把猫围在一个特定的区域之内，但是这个游戏提供的范围太小了，好像并不总能够把猫堵死。它类似下面这个经典智力题：

魔鬼在一无穷大棋盘上捕捉天使，设定魔鬼一次能设置1个陷阱（该陷阱可设在任一格子），而天使一次能走1个格子。问魔鬼能否捉住天使？若天使的法力提高到一次能走过N个格子呢？

相关...]]></description>
			<content:encoded><![CDATA[<p>试试吧。</p>
<p><object width="454" height="384" data="/blog/resource/cat.swf" type="application/x-shockwave-flash"><param name="src" value="/blog/resource/cat.swf" /><param name="wmode" value="transparent" /></object></p>
<p>当在全平面棋盘上玩这个游戏的时候，我们总是可以把猫围在一个特定的区域之内，但是这个游戏提供的范围太小了，好像并不总能够把猫堵死。它类似下面这个经典智力题：</p>
<div class="postbody">
<blockquote><p>魔鬼在一无穷大棋盘上捕捉天使，设定魔鬼一次能设置1个陷阱（该陷阱可设在任一格子），而天使一次能走1个格子。问魔鬼能否捉住天使？若天使的法力提高到一次能走过N个格子呢？</p></blockquote>
</div>
<div><h2>相关文章</h2><ul><li><a href="http://zhiqiang.org/blog/science/15-puzzle.html">15 puzzle</a> <small>注：此游戏很有名，有同学问我其算法，我在网上找了一下，居然没多少中文资料，这里按照以前看过的一份答案回忆整理贴出。 游戏规则很简单，4*4...</small></li><li><a href="http://zhiqiang.org/blog/science/computer-science/most-windows-game-are-np-complete.html">Windows游戏中的NP完全问题</a> <small>上篇文章扫雷是NP完全问题之后，You Xu提到＂不光扫雷是NP 完全问题，空当接龙问题也极有可能是一个NP完全问题。目前最好的通用 planner只能解半副牌...</small></li><li><a href="http://zhiqiang.org/blog/science/rotate-coin-games.html">硬币游戏</a> <small>Alice和Bob两人玩一种硬币游戏。游戏在一个$$2\times2$$的棋盘上进行，棋盘上每个格子上都有一枚硬币。在每一回合，Alice可以决定选择翻转某两枚或者一...</small></li><li><a href="http://zhiqiang.org/blog/science/two-taking-coins-game.html">取硬币游戏</a> <small>$$n$$枚硬币排成一排，两人轮流取，每人每次可取其中一枚或者相邻的两枚。  取到最后一枚硬币的赢得游戏。分析游戏策略。  取到最后一枚硬币的算...</small></li><li><a href="http://zhiqiang.org/blog/entertainment/fan-tan-game-empty-when-most-difficult-relationship.html">空当接龙中最难的关</a> <small>空当接龙可说是最耐玩的Windows小游戏之一，尤其在办公一族中长盛不衰。Win98中的空当接龙有32000局，在XP里面则增加到了  1000000关，不过前32000关与Win9...</small></li><li><a href="http://zhiqiang.org/blog/science/computer-science/boxes-problem-on-static-data-structure-problems.html">摸箱子问题以及在Static data structure problems上的应用</a> <small>以前提到过，理论计算机这门课会邀请一些正在这边访问的教授来讲课，由于是本科生，所以这些教授一般都是讲些有趣的东西，比如之前的overhang 堆...</small></li><li><a href="http://zhiqiang.org/blog/resource/game-tower-defense-review.html">Tower Defense游戏盘点</a> <small>PS1：Work hard, play hard PS2：星际争霸里有一类block的RPG游戏，差不多是诸多RPG里面最流行的。Tow Defense可以视作block RPG游戏的网页版，玩起来更方便。 正...</small></li><li><a href="http://zhiqiang.org/blog/science/strategy-games-doctors-and-patients-i.html">策略游戏：医生和病人（I）</a> <small>我很早之前就想过这个问题，但一直只知道一个trivial的答案。前两天无意中发现网上已经有高手给出了更好的方案，故记录在此。有兴趣的可以自己想...</small></li><li><a href="http://zhiqiang.org/blog/science/theoritical-analysis-marfia-game.html">杀人的理论分析</a> <small>“杀人”，英文名为"Mafia Game"，广泛流传于国内外。上个星期我们在玩的时候被Elchanan Mossel发现，然后他给了一个talk，内容就是杀人的理论分析。

...</small></li></ul></div>    <p></p>
    <hr noshade style="margin:0;height:1px" />
    <p>&copy; zhiqiang for <a href="http://zhiqiang.org/blog">阅微堂</a>, 2009. | <a href="http://zhiqiang.org/blog/entertainment/cat-game.html">&#38142;&#25509;</a> | <a href="http://zhiqiang.org/blog/entertainment/cat-game.html#comments">28 &#26465;&#35780;&#35770;</a></p>]]></content:encoded>
			<wfw:commentRss>http://zhiqiang.org/blog/entertainment/cat-game.html/feed</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>摸箱子问题以及在Static data structure problems上的应用</title>
		<link>http://zhiqiang.org/blog/science/computer-science/boxes-problem-on-static-data-structure-problems.html</link>
		<comments>http://zhiqiang.org/blog/science/computer-science/boxes-problem-on-static-data-structure-problems.html#comments</comments>
		<pubDate>Tue, 16 Dec 2008 08:24:54 +0000</pubDate>
		<dc:creator>zhiqiang</dc:creator>
				<category><![CDATA[计算机科学]]></category>
		<category><![CDATA[概率]]></category>
		<category><![CDATA[游戏]]></category>
		<category><![CDATA[理论计算机笔记]]></category>
		<category><![CDATA[策略]]></category>

		<guid isPermaLink="false">http://zhiqiang.org/blog/posts/boxes-problem-on-static-data-structure-problems.html</guid>
		<description><![CDATA[以前提到过，理论计算机这门课会邀请一些正在这边访问的教授来讲课，由于是本科生，所以这些教授一般都是讲些有趣的东西，比如之前的overhang 堆积木 - 能伸出桌面多远？。今天这次课，来自Aarhus的Peter Bro Miltersen讲了一个很有趣的游戏问题。
现在有100个箱子，有一个学生，一张写着他的名字的名片被放在某个随机选择的箱子里面。现在这个学生可以检查不超过一半也就...]]></description>
			<content:encoded><![CDATA[<p>以前提到过，理论计算机这门课会邀请一些正在这边访问的教授来讲课，由于是本科生，所以这些教授一般都是讲些有趣的东西，比如之前的<a href="http://zhiqiang.org/blog/posts/overhang-stacking-wood-how-far-can-extend-desktop.html">overhang 堆积木 - 能伸出桌面多远？</a>。今天这次课，来自Aarhus的<a href="http://www.brics.dk/%7Ebromille/">Peter Bro Miltersen</a>讲了一个很有趣的游戏问题。</p>
<p>现在有100个箱子，有一个学生，一张写着他的名字的名片被放在某个随机选择的箱子里面。现在这个学生可以检查不超过一半也就是50个箱子，希望能够把它的名字找出来。</p>
<p>很显然，这个学生没有什么好的方法，随机选择50个箱子打开，有一半的概率可以发现含有它的名字纸条的箱子。</p>
<p>OK，现在还是100个箱子，但是有100个学生，写着这些学生的名字的100张纸条随机放入100个箱子里(每个箱子恰好一张纸条)。现在每个学生可以检查不超过一半也就是50个箱子，每个学生希望能找到含有自己名字的箱子。如果在游戏中，所有学生都是独立的（他们不能互相讨论以及看到其他人的开箱结果），问所有学生都实现目标的概率有多大？</p>
<p>如果把每个学生的结果认为是独立的，那么成功的概率只有<img src="http://zhiqiang.org/blog/wp-content/cache/tex_5deb1f2a4cb23a636322677c5b5711f8.png" style="vertical-align:middle; padding-bottom:1px;" class="tex" alt="2^{-100}" />，但其实我们可以做的比这要好得多。事实上，让每个学生都找到含有自己名字的箱子的概率可以高达0.3。</p>
<p>假设学生的名字就是它的编号，从1到100。第<img src="http://zhiqiang.org/blog/wp-content/cache/tex_865c0c0b4ab0e063e5caa3387c1a8741.png" style="vertical-align:middle; padding-bottom:1px;" class="tex" alt="i" />个箱子里的编号是<img src="http://zhiqiang.org/blog/wp-content/cache/tex_337778f4c628d9c80045adbc3a9a81b0.png" style="vertical-align:middle; " class="tex" alt="\pi(i)" />。第<img src="http://zhiqiang.org/blog/wp-content/cache/tex_865c0c0b4ab0e063e5caa3387c1a8741.png" style="vertical-align:middle; padding-bottom:1px;" class="tex" alt="i" />个学生这样做：先打开第<img src="http://zhiqiang.org/blog/wp-content/cache/tex_865c0c0b4ab0e063e5caa3387c1a8741.png" style="vertical-align:middle; padding-bottom:1px;" class="tex" alt="i" />个箱子，再打开第<img src="http://zhiqiang.org/blog/wp-content/cache/tex_337778f4c628d9c80045adbc3a9a81b0.png" style="vertical-align:middle; " class="tex" alt="\pi(i)" />个箱子，再打开第<img src="http://zhiqiang.org/blog/wp-content/cache/tex_30e74848e17f1241028df30d37626fb5.png" style="vertical-align:middle; " class="tex" alt="\pi(\pi(i))" />个箱子，以此继续下去，直到发现写着自己名字（也就是<img src="http://zhiqiang.org/blog/wp-content/cache/tex_865c0c0b4ab0e063e5caa3387c1a8741.png" style="vertical-align:middle; padding-bottom:1px;" class="tex" alt="i" />）的纸条或者打开箱子数到达50个为止。</p>
<p>那么当且仅当在<img src="http://zhiqiang.org/blog/wp-content/cache/tex_865c0c0b4ab0e063e5caa3387c1a8741.png" style="vertical-align:middle; padding-bottom:1px;" class="tex" alt="i" />到<img src="http://zhiqiang.org/blog/wp-content/cache/tex_337778f4c628d9c80045adbc3a9a81b0.png" style="vertical-align:middle; " class="tex" alt="\pi(i)" />这个置换中含有长度超过50的圈时，有学生找不到含有自己名字的箱子。这个概率是<img src="http://zhiqiang.org/blog/wp-content/cache/tex_8dde40b065bb39ce68f1acf77b65f3d8.png" style="vertical-align:middle; " class="tex" alt="\sum_{j=51}^{100}1/j \sim \ln 2" />（注意一个随机置换里含有一个长度为<img src="http://zhiqiang.org/blog/wp-content/cache/tex_363b122c528f54df4a0446b6bab05515.png" style="vertical-align:middle; padding-bottom:1px;" class="tex" alt="j" />的圈的概率为<img src="http://zhiqiang.org/blog/wp-content/cache/tex_f1efbba87e0ef8aba62fd9bfbd5605b8.png" style="vertical-align:middle; " class="tex" alt="1/j" />）。</p>
<p>所以上面策略的成功概率为 <img src="http://zhiqiang.org/blog/wp-content/cache/tex_162fba3f0bfe98f043fa4148428acf72.png" style="vertical-align:middle; padding-bottom:1px;" class="tex" alt="1-\ln 2 \sim 0.3" />。</p>
<p>类似于以前提到的<a href="http://zhiqiang.org/blog/posts/game-one-hat.html">帽子游戏一</a>以及<a href="http://zhiqiang.org/blog/posts/game-two-hats.html">帽子游戏二</a>，我们要最大化一个团体都成功的概率，但是每个单个个体成功的概率又是一定的，那么我们只需要设计策略时，让大家要么几乎同时成功，要么几乎同时失败。就像上面的策略里，如果有人失败，意味着排列中有一个长度很大（大于n/2）的圈，这个圈上所有人同时也会失败，通过把失败的实例重合到一起，这样就提高了总体成功的概率。</p>
<p>上面这个问题不是孤立的，它可以应用在static data structure problems的下界证明上。对于后面这个问题，在最近是一个很热门的研究领域，但在这里写了也没人看，知道这个问题的也不需要看，所以我只提一下我们还可以做什么，下面是一个open problem，可以直接得出一个data structure问题的一个下界，是一个可以写学术论文的题目：</p>
<blockquote><p>Open problem：假设现在有<img src="http://zhiqiang.org/blog/wp-content/cache/tex_21e2c0c0472b331622877accbe29b91b.png" style="vertical-align:middle; padding-bottom:1px;" class="tex" alt="2n" />个箱子，<img src="http://zhiqiang.org/blog/wp-content/cache/tex_7b8b965ad4bca0e41ab51de7b31363a1.png" style="vertical-align:middle; padding-bottom:2px;" class="tex" alt="n" />个学生，学生们的名字纸条被放入随机选中的<img src="http://zhiqiang.org/blog/wp-content/cache/tex_7b8b965ad4bca0e41ab51de7b31363a1.png" style="vertical-align:middle; padding-bottom:2px;" class="tex" alt="n" />个箱子里。现在每个学生可以检查不超过一半也就是<img src="http://zhiqiang.org/blog/wp-content/cache/tex_7b8b965ad4bca0e41ab51de7b31363a1.png" style="vertical-align:middle; padding-bottom:2px;" class="tex" alt="n" />个箱子，以找到含有自己名字的箱子。问这时候学生可以采取什么样的策略最大化所有学生都成功找到含有自己名字的箱子的概率。</p>
</blockquote>
<p>期望结果：证明指数级小的下界或者找到常数概率的策略。</p>
<p>有兴趣的可以参考<a href="http://www.brics.dk/~bromille/Papers/succinct.pdf" target="_blank">The cell probe complexity of succinct data structures</a>.</p>
<div><h2>相关文章</h2><ul><li><a href="http://zhiqiang.org/blog/science/tcs-classroom-notes-the-best-dating-strategy.html">最佳约会策略</a> <small>题外话：最近阅微堂发的都是网友转发的政治方面的文章，不爱看的人会比较痛苦。现在讨论一个轻松一点的话题。其问题，已经被研究了很多年，有...</small></li><li><a href="http://zhiqiang.org/blog/science/how-n-people-divide-a-cake-fairly.html">征集3个人分蛋糕的方法</a> <small> Yao在课程《理论计算机II》的第一节课上提到的一个问题：  三个人如何平分一块蛋糕？ 要求每个人拿到不少于1/3的蛋糕——这里指的是每个人认为自...</small></li><li><a href="http://zhiqiang.org/blog/science/theoritical-analysis-marfia-game.html">杀人的理论分析</a> <small>“杀人”，英文名为"Mafia Game"，广泛流传于国内外。上个星期我们在玩的时候被Elchanan Mossel发现，然后他给了一个talk，内容就是杀人的理论分析。

...</small></li><li><a href="http://zhiqiang.org/blog/science/game-two-hats.html">帽子游戏二</a> <small>这个题目听说是MSRA的面试题。

在这个游戏的开头，我们设想自己要参加一个电视游戏大奖赛。规则呢，是这样。我们有 n 个人，作为一个小组来参...</small></li><li><a href="http://zhiqiang.org/blog/science/rotate-coin-games.html">硬币游戏</a> <small>Alice和Bob两人玩一种硬币游戏。游戏在一个$$2\times2$$的棋盘上进行，棋盘上每个格子上都有一枚硬币。在每一回合，Alice可以决定选择翻转某两枚或者一...</small></li><li><a href="http://zhiqiang.org/blog/science/strategy-games-doctors-and-patients-i.html">策略游戏：医生和病人（I）</a> <small>我很早之前就想过这个问题，但一直只知道一个trivial的答案。前两天无意中发现网上已经有高手给出了更好的方案，故记录在此。有兴趣的可以自己想...</small></li><li><a href="http://zhiqiang.org/blog/science/the-perfect-number-of-shuffling-7-times.html">&quot;完美&quot;的洗牌次数 - 7次</a> <small>在大家玩牌的时候，每一局之前都需要重新洗牌——一次洗牌指将牌分为左右两垛然后穿插放牌，但多少次洗牌才是正当的呢？就我多次打牌的观察，...</small></li><li><a href="http://zhiqiang.org/blog/science/googles-crazy-face-questions.html">Google的疯狂面试题</a> <small>有一些是火星题，比如最后一个海盗分金，不太可能还用来作为面试题，估计是被拉过来凑数的。  原文（英文）直接到这里看吧，27floors给出了中文翻...</small></li><li><a href="http://zhiqiang.org/blog/science/three-doors-related-problems.html">三门问题及相关</a> <small>写篇三门问题的终结版。欢迎补充材料。 三门问题，亦称为蒙特霍问题（英文：Monty Hall problem），最初的表述形式：  参赛者会看见三扇关闭了的门，...</small></li><li><a href="http://zhiqiang.org/blog/science/two-taking-coins-game.html">取硬币游戏</a> <small>$$n$$枚硬币排成一排，两人轮流取，每人每次可取其中一枚或者相邻的两枚。  取到最后一枚硬币的赢得游戏。分析游戏策略。  取到最后一枚硬币的算...</small></li></ul></div>    <p></p>
    <hr noshade style="margin:0;height:1px" />
    <p>&copy; zhiqiang for <a href="http://zhiqiang.org/blog">阅微堂</a>, 2008. | <a href="http://zhiqiang.org/blog/science/computer-science/boxes-problem-on-static-data-structure-problems.html">&#38142;&#25509;</a> | <a href="http://zhiqiang.org/blog/science/computer-science/boxes-problem-on-static-data-structure-problems.html#comments">15 &#26465;&#35780;&#35770;</a></p>]]></content:encoded>
			<wfw:commentRss>http://zhiqiang.org/blog/science/computer-science/boxes-problem-on-static-data-structure-problems.html/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>取硬币游戏</title>
		<link>http://zhiqiang.org/blog/science/two-taking-coins-game.html</link>
		<comments>http://zhiqiang.org/blog/science/two-taking-coins-game.html#comments</comments>
		<pubDate>Sat, 30 Aug 2008 01:01:11 +0000</pubDate>
		<dc:creator>zhiqiang</dc:creator>
				<category><![CDATA[自然科学]]></category>
		<category><![CDATA[游戏]]></category>
		<category><![CDATA[硬币]]></category>

		<guid isPermaLink="false">http://zhiqiang.org/blog/posts/two-taking-coins-game.html</guid>
		<description><![CDATA[枚硬币排成一排，两人轮流取，每人每次可取其中一枚或者相邻的两枚。

取到最后一枚硬币的赢得游戏。分析游戏策略。  
取到最后一枚硬币的算输。分析游戏策略。 

第二种情况的特殊情形()是今天软件实验班的招生考试试题。
此问题的留言可能对最终解决此问题特别是第二种情况有帮助。
相关文章15 puzzle 注：此游戏很有名，有同学问我其算法，我在网上找了一下，居然...]]></description>
			<content:encoded><![CDATA[<p><img src="http://zhiqiang.org/blog/wp-content/cache/tex_7b8b965ad4bca0e41ab51de7b31363a1.png" style="vertical-align:middle; padding-bottom:2px;" class="tex" alt="n" />枚硬币排成一排，两人轮流取，每人每次可取其中一枚或者<strong>相邻的</strong>两枚。</p>
<ol>
<li>取到最后一枚硬币的赢得游戏。分析游戏策略。  </li>
<li>取到最后一枚硬币的算输。分析游戏策略。 </li>
</ol>
<p>第二种情况的特殊情形(<img src="http://zhiqiang.org/blog/wp-content/cache/tex_662f2f63485160658057cdacac083dc8.png" style="vertical-align:middle; padding-bottom:1px;" class="tex" alt="n=8" />)是<strong>今天</strong>软件实验班的<a href="http://zhiqiang.org/blog/posts/chinese-math-students-believe-destinity-is-in-numbers.html">招生</a>考试试题。</p>
<p>此问题的留言可能对最终解决此问题特别是第二种情况有帮助。</p>
<div><h2>相关文章</h2><ul><li><a href="http://zhiqiang.org/blog/science/15-puzzle.html">15 puzzle</a> <small>注：此游戏很有名，有同学问我其算法，我在网上找了一下，居然没多少中文资料，这里按照以前看过的一份答案回忆整理贴出。 游戏规则很简单，4*4...</small></li><li><a href="http://zhiqiang.org/blog/science/computer-science/most-windows-game-are-np-complete.html">Windows游戏中的NP完全问题</a> <small>上篇文章扫雷是NP完全问题之后，You Xu提到＂不光扫雷是NP 完全问题，空当接龙问题也极有可能是一个NP完全问题。目前最好的通用 planner只能解半副牌...</small></li><li><a href="http://zhiqiang.org/blog/science/rotate-coin-games.html">硬币游戏</a> <small>Alice和Bob两人玩一种硬币游戏。游戏在一个$$2\times2$$的棋盘上进行，棋盘上每个格子上都有一枚硬币。在每一回合，Alice可以决定选择翻转某两枚或者一...</small></li><li><a href="http://zhiqiang.org/blog/science/computer-science/boxes-problem-on-static-data-structure-problems.html">摸箱子问题以及在Static data structure problems上的应用</a> <small>以前提到过，理论计算机这门课会邀请一些正在这边访问的教授来讲课，由于是本科生，所以这些教授一般都是讲些有趣的东西，比如之前的overhang 堆...</small></li><li><a href="http://zhiqiang.org/blog/entertainment/fan-tan-game-empty-when-most-difficult-relationship.html">空当接龙中最难的关</a> <small>空当接龙可说是最耐玩的Windows小游戏之一，尤其在办公一族中长盛不衰。Win98中的空当接龙有32000局，在XP里面则增加到了  1000000关，不过前32000关与Win9...</small></li><li><a href="http://zhiqiang.org/blog/entertainment/cat-game.html">堵猫游戏</a> <small>试试吧。



当在全平面棋盘上玩这个游戏的时候，我们总是可以把猫围在一个特定的区域之内，但是这个游戏提供的范围太小了，好像并不总能够...</small></li><li><a href="http://zhiqiang.org/blog/resource/game-tower-defense-review.html">Tower Defense游戏盘点</a> <small>PS1：Work hard, play hard PS2：星际争霸里有一类block的RPG游戏，差不多是诸多RPG里面最流行的。Tow Defense可以视作block RPG游戏的网页版，玩起来更方便。 正...</small></li><li><a href="http://zhiqiang.org/blog/science/strategy-games-doctors-and-patients-i.html">策略游戏：医生和病人（I）</a> <small>我很早之前就想过这个问题，但一直只知道一个trivial的答案。前两天无意中发现网上已经有高手给出了更好的方案，故记录在此。有兴趣的可以自己想...</small></li><li><a href="http://zhiqiang.org/blog/science/theoritical-analysis-marfia-game.html">杀人的理论分析</a> <small>“杀人”，英文名为"Mafia Game"，广泛流传于国内外。上个星期我们在玩的时候被Elchanan Mossel发现，然后他给了一个talk，内容就是杀人的理论分析。

...</small></li></ul></div>    <p></p>
    <hr noshade style="margin:0;height:1px" />
    <p>&copy; zhiqiang for <a href="http://zhiqiang.org/blog">阅微堂</a>, 2008. | <a href="http://zhiqiang.org/blog/science/two-taking-coins-game.html">&#38142;&#25509;</a> | <a href="http://zhiqiang.org/blog/science/two-taking-coins-game.html#comments">35 &#26465;&#35780;&#35770;</a></p>]]></content:encoded>
			<wfw:commentRss>http://zhiqiang.org/blog/science/two-taking-coins-game.html/feed</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>硬币游戏</title>
		<link>http://zhiqiang.org/blog/science/rotate-coin-games.html</link>
		<comments>http://zhiqiang.org/blog/science/rotate-coin-games.html#comments</comments>
		<pubDate>Sun, 27 Jul 2008 11:51:24 +0000</pubDate>
		<dc:creator>zhiqiang</dc:creator>
				<category><![CDATA[自然科学]]></category>
		<category><![CDATA[游戏]]></category>
		<category><![CDATA[策略]]></category>

		<guid isPermaLink="false">http://zhiqiang.org/blog/posts/rotate-coin-games.html</guid>
		<description><![CDATA[Alice和Bob两人玩一种硬币游戏。游戏在一个的棋盘上进行，棋盘上每个格子上都有一枚硬币。在每一回合，Alice可以决定选择翻转某两枚或者一枚硬币，接着Bob可以选择将棋盘旋转90，180或者270度，也可以什么都不做。  
游戏轮流进行直到棋盘上所有硬币都正面朝上或者反面朝上，Alice获得胜利。  
如果Alice在游戏过程中无法看到棋盘上的银币，也不知道游戏刚开始的状态，甚至...]]></description>
			<content:encoded><![CDATA[<p>Alice和Bob两人玩一种硬币游戏。游戏在一个<img src="http://zhiqiang.org/blog/wp-content/cache/tex_b6afe64110f5c78ec57c6cc87f09efb4.png" style="vertical-align:middle; padding-bottom:1px;" class="tex" alt="2\times2" />的棋盘上进行，棋盘上每个格子上都有一枚硬币。在每一回合，Alice可以决定选择翻转某两枚或者一枚硬币，接着Bob可以选择将棋盘旋转90，180或者270度，也可以什么都不做。  </p>
<p>游戏轮流进行直到棋盘上所有硬币都正面朝上或者反面朝上，Alice获得胜利。  </p>
<p>如果Alice在游戏过程中无法看到棋盘上的银币，也不知道游戏刚开始的状态，甚至不知道Bob每回合是否旋转了棋盘，那么Alice有策略能够获得胜利么？他的最优策略是什么？  </p>
<p>接下来我们推广这个游戏。共有<img src="http://zhiqiang.org/blog/wp-content/cache/tex_7b8b965ad4bca0e41ab51de7b31363a1.png" style="vertical-align:middle; padding-bottom:2px;" class="tex" alt="n" />枚硬币，分别放在一个正<img src="http://zhiqiang.org/blog/wp-content/cache/tex_7b8b965ad4bca0e41ab51de7b31363a1.png" style="vertical-align:middle; padding-bottom:2px;" class="tex" alt="n" />边形棋盘的顶点上。每回合Alice可以翻转任何一些银币，Bob则可任意以<img src="http://zhiqiang.org/blog/wp-content/cache/tex_7b8b965ad4bca0e41ab51de7b31363a1.png" style="vertical-align:middle; padding-bottom:2px;" class="tex" alt="n" />种不同的方式(旋转<img src="http://zhiqiang.org/blog/wp-content/cache/tex_8d7849cc8b48fa064e62426a29994817.png" style="vertical-align:middle; " class="tex" alt="360/n" />的倍数角度)之一旋转棋盘。游戏一直到所有硬币正面朝上或者反面朝上，Alice获得胜利。  </p>
<p>这时候Alice还能取胜吗？  </p>
<p><a href="http://zhiqiang.org/blog/posts/rotate-coin-game-solution.html">解答在此</a>，但强烈推荐独立思考此题，特别是<img src="http://zhiqiang.org/blog/wp-content/cache/tex_aa415f33717e0cf5151a7712cb4f2f59.png" style="vertical-align:middle; padding-bottom:1px;" class="tex" alt="n=4" />的情况。 </p>
<p><font color="#808080">via </font><a href="http://valis.cs.uiuc.edu/blog/?p=1808" target="_blank"><font color="#808080">Sariel’s blog</font></a></p>
<div><h2>相关文章</h2><ul><li><a href="http://zhiqiang.org/blog/science/computer-science/boxes-problem-on-static-data-structure-problems.html">摸箱子问题以及在Static data structure problems上的应用</a> <small>以前提到过，理论计算机这门课会邀请一些正在这边访问的教授来讲课，由于是本科生，所以这些教授一般都是讲些有趣的东西，比如之前的overhang 堆...</small></li><li><a href="http://zhiqiang.org/blog/science/strategy-games-doctors-and-patients-i.html">策略游戏：医生和病人（I）</a> <small>我很早之前就想过这个问题，但一直只知道一个trivial的答案。前两天无意中发现网上已经有高手给出了更好的方案，故记录在此。有兴趣的可以自己想...</small></li><li><a href="http://zhiqiang.org/blog/science/game-one-hat.html">帽子游戏一</a> <small>在这个游戏的开头，我们设想自己要参加一个电视游戏大奖赛。规则呢，是这样。我们有 n 个人，作为一个小组来参加游戏。游戏中，主持人会给我们...</small></li><li><a href="http://zhiqiang.org/blog/science/computer-science/most-windows-game-are-np-complete.html">Windows游戏中的NP完全问题</a> <small>上篇文章扫雷是NP完全问题之后，You Xu提到＂不光扫雷是NP 完全问题，空当接龙问题也极有可能是一个NP完全问题。目前最好的通用 planner只能解半副牌...</small></li><li><a href="http://zhiqiang.org/blog/science/game-two-hats.html">帽子游戏二</a> <small>这个题目听说是MSRA的面试题。

在这个游戏的开头，我们设想自己要参加一个电视游戏大奖赛。规则呢，是这样。我们有 n 个人，作为一个小组来参...</small></li><li><a href="http://zhiqiang.org/blog/science/rotate-coin-game-solution.html">硬币游戏的答案</a> <small>前两天贴出了一个硬币游戏，希望寻找一种胜利策略。这是一个非常有意思的题目，没事做的时候可以用来锻炼思考能力。我迫不及待的想在这里公布...</small></li><li><a href="http://zhiqiang.org/blog/resource/game-tower-defense-review.html">Tower Defense游戏盘点</a> <small>PS1：Work hard, play hard PS2：星际争霸里有一类block的RPG游戏，差不多是诸多RPG里面最流行的。Tow Defense可以视作block RPG游戏的网页版，玩起来更方便。 正...</small></li><li><a href="http://zhiqiang.org/blog/science/two-taking-coins-game.html">取硬币游戏</a> <small>$$n$$枚硬币排成一排，两人轮流取，每人每次可取其中一枚或者相邻的两枚。  取到最后一枚硬币的赢得游戏。分析游戏策略。  取到最后一枚硬币的算...</small></li><li><a href="http://zhiqiang.org/blog/science/how-n-people-divide-a-cake-fairly.html">征集3个人分蛋糕的方法</a> <small> Yao在课程《理论计算机II》的第一节课上提到的一个问题：  三个人如何平分一块蛋糕？ 要求每个人拿到不少于1/3的蛋糕——这里指的是每个人认为自...</small></li><li><a href="http://zhiqiang.org/blog/entertainment/cat-game.html">堵猫游戏</a> <small>试试吧。



当在全平面棋盘上玩这个游戏的时候，我们总是可以把猫围在一个特定的区域之内，但是这个游戏提供的范围太小了，好像并不总能够...</small></li></ul></div>    <p></p>
    <hr noshade style="margin:0;height:1px" />
    <p>&copy; zhiqiang for <a href="http://zhiqiang.org/blog">阅微堂</a>, 2008. | <a href="http://zhiqiang.org/blog/science/rotate-coin-games.html">&#38142;&#25509;</a> | <a href="http://zhiqiang.org/blog/science/rotate-coin-games.html#comments">24 &#26465;&#35780;&#35770;</a></p>]]></content:encoded>
			<wfw:commentRss>http://zhiqiang.org/blog/science/rotate-coin-games.html/feed</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Windows游戏中的NP完全问题</title>
		<link>http://zhiqiang.org/blog/science/computer-science/most-windows-game-are-np-complete.html</link>
		<comments>http://zhiqiang.org/blog/science/computer-science/most-windows-game-are-np-complete.html#comments</comments>
		<pubDate>Fri, 13 Jun 2008 02:13:08 +0000</pubDate>
		<dc:creator>zhiqiang</dc:creator>
				<category><![CDATA[计算机科学]]></category>
		<category><![CDATA[NP hard]]></category>
		<category><![CDATA[游戏]]></category>
		<category><![CDATA[空当接龙]]></category>
		<category><![CDATA[蜘蛛纸牌]]></category>

		<guid isPermaLink="false">http://zhiqiang.org/blog/?p=798</guid>
		<description><![CDATA[上篇文章扫雷是NP完全问题之后，You Xu提到＂不光扫雷是NP 完全问题，空当接龙问题也极有可能是一个NP完全问题。目前最好的通用 planner只能解半副牌＂。他说对了，不光扫雷，Windows自带的游戏都是NP完全的。Windows自带的游戏除了扫雷，还有空当接龙和蜘蛛纸牌。
空当接龙是NP完全问题
论文：Malte Helmert, Complexity results for standard benchmark domains in planning, Artificial Intelligence Journal ...]]></description>
			<content:encoded><![CDATA[<p>上篇文章<a href="http://zhiqiang.org/blog/posts/minesweeper-is-np-complete.html">扫雷是NP完全问题</a>之后，<a href="http://youxu.info" target="_blank">You Xu</a>提到＂不光扫雷是NP 完全问题，<a href="http://zhiqiang.org/blog/posts/fan-tan-game-empty-when-most-difficult-relationship.html">空当接龙</a>问题也极有可能是一个NP完全问题。目前最好的通用 planner只能解半副牌＂。他说对了，不光扫雷，Windows自带的游戏都是NP完全的。Windows自带的游戏除了扫雷，还有空当接龙和蜘蛛纸牌。</p>
<h3>空当接龙是NP完全问题</h3>
<p>论文：Malte Helmert, <a href="ftp://ftp.informatik.uni-freiburg.de/documents/papers/ki/helmert-aij03.ps.gz" target="_blank">Complexity results for standard benchmark domains in planning</a>, Artificial Intelligence Journal 143(2):219-262, 2003.</p>
<h3>蜘蛛纸牌是NP完全问题</h3>
<p>论文：Springer Berlin, Heidelberg, <a href="http://www.springerlink.com/content/b40703p37h74j220/" target="_blank">The Complexity of Solitaire</a>, Mathematical Foundations of Computer Science 2007: 182-193, 2007</p>
<p>顺便提一下蜘蛛纸牌的可以获胜的概率高达82-91.5%。而我平时自己玩的时候20%都不到。差距啊。</p>
<div><h2>相关文章</h2><ul><li><a href="http://zhiqiang.org/blog/entertainment/cat-game.html">堵猫游戏</a> <small>试试吧。



当在全平面棋盘上玩这个游戏的时候，我们总是可以把猫围在一个特定的区域之内，但是这个游戏提供的范围太小了，好像并不总能够...</small></li><li><a href="http://zhiqiang.org/blog/science/computer-science/np-hard.html">TCS：NP-hard</a> <small>好久没有写我的理论计算机初步系列了，其实复杂性这一块，虽然平时经常遇到，但由于问题都过于本质和困难，想这方面问题的时间反而不多。Ko教...</small></li><li><a href="http://zhiqiang.org/blog/science/computer-science/database-query-is-np-hard.html">数据库查询是NP-Hard问题</a> <small>问题来自美人他爹和Wangjianshuo's blog  一个查询的例子：NOT (AND ((C1&gt;5), OR ((C2&lt;6),(C3&lt;&gt;9))))  问题1：给出两个这样的查询Q1和Q2，如何确定Q1的结果是...</small></li><li><a href="http://zhiqiang.org/blog/science/15-puzzle.html">15 puzzle</a> <small>注：此游戏很有名，有同学问我其算法，我在网上找了一下，居然没多少中文资料，这里按照以前看过的一份答案回忆整理贴出。 游戏规则很简单，4*4...</small></li><li><a href="http://zhiqiang.org/blog/science/computer-science/minesweeper-is-np-complete.html">扫雷是NP完全问题</a> <small>本科时有同学扫雷最快可以在60多秒完成高级难度，让我这种最快130秒的人非常惭愧，当时就想着编一个全自动的扫雷程序，不过一直也没写。今天才...</small></li><li><a href="http://zhiqiang.org/blog/science/rotate-coin-games.html">硬币游戏</a> <small>Alice和Bob两人玩一种硬币游戏。游戏在一个$$2\times2$$的棋盘上进行，棋盘上每个格子上都有一枚硬币。在每一回合，Alice可以决定选择翻转某两枚或者一...</small></li><li><a href="http://zhiqiang.org/blog/entertainment/fan-tan-game-empty-when-most-difficult-relationship.html">空当接龙中最难的关</a> <small>空当接龙可说是最耐玩的Windows小游戏之一，尤其在办公一族中长盛不衰。Win98中的空当接龙有32000局，在XP里面则增加到了  1000000关，不过前32000关与Win9...</small></li><li><a href="http://zhiqiang.org/blog/science/two-taking-coins-game.html">取硬币游戏</a> <small>$$n$$枚硬币排成一排，两人轮流取，每人每次可取其中一枚或者相邻的两枚。  取到最后一枚硬币的赢得游戏。分析游戏策略。  取到最后一枚硬币的算...</small></li><li><a href="http://zhiqiang.org/blog/resource/game-tower-defense-review.html">Tower Defense游戏盘点</a> <small>PS1：Work hard, play hard PS2：星际争霸里有一类block的RPG游戏，差不多是诸多RPG里面最流行的。Tow Defense可以视作block RPG游戏的网页版，玩起来更方便。 正...</small></li><li><a href="http://zhiqiang.org/blog/science/theoritical-analysis-marfia-game.html">杀人的理论分析</a> <small>“杀人”，英文名为"Mafia Game"，广泛流传于国内外。上个星期我们在玩的时候被Elchanan Mossel发现，然后他给了一个talk，内容就是杀人的理论分析。

...</small></li></ul></div>    <p></p>
    <hr noshade style="margin:0;height:1px" />
    <p>&copy; zhiqiang for <a href="http://zhiqiang.org/blog">阅微堂</a>, 2008. | <a href="http://zhiqiang.org/blog/science/computer-science/most-windows-game-are-np-complete.html">&#38142;&#25509;</a> | <a href="http://zhiqiang.org/blog/science/computer-science/most-windows-game-are-np-complete.html#comments">3 &#26465;&#35780;&#35770;</a></p>]]></content:encoded>
			<wfw:commentRss>http://zhiqiang.org/blog/science/computer-science/most-windows-game-are-np-complete.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
