<?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://www.eaglefantasy.com/archives/tag/%e6%95%b0%e5%ad%a6%e6%b8%b8%e6%88%8f/feed" rel="self" type="application/rss+xml" />
	<link>http://www.eaglefantasy.com</link>
	<description>细推物理须行乐 何用浮名绊此身</description>
	<lastBuildDate>Mon, 30 Jan 2012 13:21:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>“少数决”游戏</title>
		<link>http://www.eaglefantasy.com/archives/725</link>
		<comments>http://www.eaglefantasy.com/archives/725#comments</comments>
		<pubDate>Fri, 12 Feb 2010 10:20:17 +0000</pubDate>
		<dc:creator>Eagle Fantasy</dc:creator>
				<category><![CDATA[Interesting Maths]]></category>
		<category><![CDATA[博弈]]></category>
		<category><![CDATA[巧妙]]></category>
		<category><![CDATA[数学游戏]]></category>

		<guid isPermaLink="false">http://www.eaglefantasy.com/?p=725</guid>
		<description><![CDATA[在SF神牛的鼎力推荐下看完了日剧《欺诈游戏》（Liar Game），大赞其游戏设计之强大，尤其是其中的“少数决”游戏。按照SF神牛的说法，看了这个日剧以后会觉得其他的博弈游戏都黯然失色...下面内容转载自http://www.matrix67.com/blog/archives/2591 欺诈游戏的第二场共有22人参加。这22个人集中在一个阴森的大厅里，参加一个叫做“少数决”的游戏。每一个游戏，从 Chinese PartyPoker 到象棋，都有它的规则。为了让游戏有意义规则必须被遵守，以便产生真正的胜者。当然，没有欺诈！游戏规则很有意思：主办方随机抽取一个人到台上来，向众人问一个二选一的问题，比如“你信春哥吗”。每个人手里都会得到两张选票，两张选票上都印有自己的名字，但其中一张纸上印有“YES”，另一张纸上印有“NO”。游戏者们有6个小时的时间进行交流和考虑，并要在时间结束前将自己的选择投入投票箱。时间结束后，主办方进行唱票，并规定票数较少的那一方取胜，多数派将全部被淘汰。获胜的选手将进行新一轮的游戏，主办方从剩下的人中重新选一位进行提问，并要求大家在6个小时内投票，唱票后仍然宣布少数派胜出。若某次投票后双方人数相等，则该轮游戏无效，继续下一轮。游戏一直进行下去，直到最后只剩下一人或两人为止（只剩两人时显然已无法分辨胜负）。所有被淘汰的人都必须缴纳罚金，这些罚金将作为奖金分给获胜者。 这个游戏有很多科学的地方，其中最有趣的地方就是，简单的结盟策略将变得彻底无效。如果游戏是多数人获胜，那你只要能成功说服其中11个人和你一起组队（并承诺最后将平分奖金），你们12个人便可以保证获胜。但在这里，票数少的那一方才算获胜，这个办法显然就不行了。因此，欺诈和诡辩将成为这个游戏中的最终手段。如果你是这22个参赛者中的其中一个，你会怎么做呢？ 其实，仔细思考后你会发现，结盟策略也是可行的。事实上，如果你能成功找到7个相信你的人和你结盟，那恭喜你，你们百分之百地获胜了。在游戏的第一轮中，你安排你们8个人中4个人投YES，4个人投NO，因此无论如何，在这一轮中总有你们的4个人存活下来。第一轮游戏的最坏情况是10:12胜出，因此存活下来的人中最多还有6个不是你们队的人。在第二轮比赛中，你们队的4个人按之前的战术安排，让其中2个投YES，另外2个投NO。因此这一轮后留下来的人中总有你们队的2个人，最坏情况下还有2个别的人。最后一轮中，你们两个人一个投YES，另一个投NO，这就可以保证获胜了。只要另外两个人是未经商量随机投票的，总会有一个时候他们俩恰好都投到一边去了，于是最终的胜出者永远是你们队的人。比赛结束后，胜出者按约定与队伍里的另外7人平分奖金，完成整个协议。 当然，这是一个充满欺诈和谎言的游戏。你无法确定你们队的7个人是否都是好人，会不会在拿到奖金之后逃之夭夭。同时，你自己也可以想方设法使自己存活到最后，在拿到奖金以后突然翻脸不认人，使自己的收益最大化。不过，成功骗7个人相信你很容易，但要保证自己能留到最后就很难了。不过，还有一种阴险狡诈的做法，可以保证你能揣走全部的奖金！当然前提是，你能成功骗过所有人，让大家都相信你自己。 首先，找7个人和你一起秘密地组一个队伍，把上述策略给大伙儿说。然后，再找另外7个人和你秘密地组建另一支队伍，并跟他们也部署好上面所说的必胜策略。现在不是应该还剩下7个人吗？把剩的这7个人也拉过来，秘密地组成第三支8人小队。现在的情况是这样，你成功地组建了三支8人小队，让每个人都坚信自己身在一个将要利用必胜法齐心协力获得并平分奖金的队伍里。除了你自己，大家都不知道还有其它队伍存在。在第一轮游戏中，你指示每个队伍里包括你自己在内的其中4个人投YES，其余的人都投NO。这样下来，投YES的一共就有10票，NO有12票，于是你和每个队伍里除你之外的另外三个人获胜。下一轮游戏中，你部署每个队伍里包括你在内的其中两人投YES，其它人都投NO，这样YES就有4票，NO有6票，你再次胜出。最后，你自己投YES，并叫每个人都投NO，这就保证了自己可以胜出。拿到奖金后，突然翻脸不认人，背叛所有人，逃之夭夭。 这在现实生活中虽然不真实，但游戏本身很具有科学性。如果你是这部剧的编剧，你还能想到哪些科学的策略和狡诈的伎俩？<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">我猜您也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F197&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F725">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">两个好玩的数学游戏</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F196&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F725">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">几道有意思的小数学题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F563&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F725">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Nim游戏的必胜策略和Xor运算的神奇应用</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F993&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F725">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">复数方法巧解平面几何题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F481&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F725">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">几个数学娱乐</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>在SF神牛的鼎力推荐下看完了日剧《欺诈游戏》（Liar Game），大赞其游戏设计之强大，尤其是其中的“少数决”游戏。按照SF神牛的说法，看了这个日剧以后会觉得其他的博弈游戏都黯然失色...下面内容转载自<a href="http://www.matrix67.com/blog/archives/2591">http://www.matrix67.com/blog/archives/2591</a></p>
<p>欺诈游戏的第二场共有22人参加。这22个人集中在一个阴森的大厅里，参加一个叫做“少数决”的游戏。每一个游戏，从 <a href="http://cn.partypoker.com/">Chinese PartyPoker</a> 到象棋，都有它的规则。为了让游戏有意义规则必须被遵守，以便产生真正的胜者。当然，没有欺诈！游戏规则很有意思：主办方随机抽取一个人到台上来，向众人问一个二选一的问题，比如“你信春哥吗”。每个人手里都会得到两张选票，两张选票上都印有自己的名字，但其中一张纸上印有“YES”，另一张纸上印有“NO”。游戏者们有6个小时的时间进行交流和考虑，并要在时间结束前将自己的选择投入投票箱。时间结束后，主办方进行唱票，并规定票数较少的那一方取胜，多数派将全部被淘汰。获胜的选手将进行新一轮的游戏，主办方从剩下的人中重新选一位进行提问，并要求大家在6个小时内投票，唱票后仍然宣布少数派胜出。若某次投票后双方人数相等，则该轮游戏无效，继续下一轮。游戏一直进行下去，直到最后只剩下一人或两人为止（只剩两人时显然已无法分辨胜负）。所有被淘汰的人都必须缴纳罚金，这些罚金将作为奖金分给获胜者。</p>
<p>这个游戏有很多科学的地方，其中最有趣的地方就是，简单的结盟策略将变得彻底无效。如果游戏是多数人获胜，那你只要能成功说服其中11个人和你一起组队（并承诺最后将平分奖金），你们12个人便可以保证获胜。但在这里，票数少的那一方才算获胜，这个办法显然就不行了。因此，欺诈和诡辩将成为这个游戏中的最终手段。如果你是这22个参赛者中的其中一个，你会怎么做呢？</p>
<p><span id="more-725"></span></p>
<p>其实，仔细思考后你会发现，结盟策略也是可行的。事实上，如果你能成功找到7个相信你的人和你结盟，那恭喜你，你们百分之百地获胜了。在游戏的第一轮中，你安排你们8个人中4个人投YES，4个人投NO，因此无论如何，在这一轮中总有你们的4个人存活下来。第一轮游戏的最坏情况是10:12胜出，因此存活下来的人中最多还有6个不是你们队的人。在第二轮比赛中，你们队的4个人按之前的战术安排，让其中2个投YES，另外2个投NO。因此这一轮后留下来的人中总有你们队的2个人，最坏情况下还有2个别的人。最后一轮中，你们两个人一个投YES，另一个投NO，这就可以保证获胜了。只要另外两个人是未经商量随机投票的，总会有一个时候他们俩恰好都投到一边去了，于是最终的胜出者永远是你们队的人。比赛结束后，胜出者按约定与队伍里的另外7人平分奖金，完成整个协议。</p>
<p>当然，这是一个充满欺诈和谎言的游戏。你无法确定你们队的7个人是否都是好人，会不会在拿到奖金之后逃之夭夭。同时，你自己也可以想方设法使自己存活到最后，在拿到奖金以后突然翻脸不认人，使自己的收益最大化。不过，成功骗7个人相信你很容易，但要保证自己能留到最后就很难了。不过，还有一种阴险狡诈的做法，可以保证你能揣走全部的奖金！当然前提是，你能成功骗过所有人，让大家都相信你自己。<br />
首先，找7个人和你一起秘密地组一个队伍，把上述策略给大伙儿说。然后，再找另外7个人和你秘密地组建另一支队伍，并跟他们也部署好上面所说的必胜策略。现在不是应该还剩下7个人吗？把剩的这7个人也拉过来，秘密地组成第三支8人小队。现在的情况是这样，你成功地组建了三支8人小队，让每个人都坚信自己身在一个将要利用必胜法齐心协力获得并平分奖金的队伍里。除了你自己，大家都不知道还有其它队伍存在。在第一轮游戏中，你指示每个队伍里包括你自己在内的其中4个人投YES，其余的人都投NO。这样下来，投YES的一共就有10票，NO有12票，于是你和每个队伍里除你之外的另外三个人获胜。下一轮游戏中，你部署每个队伍里包括你在内的其中两人投YES，其它人都投NO，这样YES就有4票，NO有6票，你再次胜出。最后，你自己投YES，并叫每个人都投NO，这就保证了自己可以胜出。拿到奖金后，突然翻脸不认人，背叛所有人，逃之夭夭。</p>
<p>这在现实生活中虽然不真实，但游戏本身很具有科学性。如果你是这部剧的编剧，你还能想到哪些科学的策略和狡诈的伎俩？</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">我猜您也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F197&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F725">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">两个好玩的数学游戏</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F196&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F725">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">几道有意思的小数学题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F563&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F725">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Nim游戏的必胜策略和Xor运算的神奇应用</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F993&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F725">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">复数方法巧解平面几何题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F481&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F725">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">几个数学娱乐</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.eaglefantasy.com/archives/725/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nim游戏的必胜策略和Xor运算的神奇应用</title>
		<link>http://www.eaglefantasy.com/archives/563</link>
		<comments>http://www.eaglefantasy.com/archives/563#comments</comments>
		<pubDate>Thu, 05 Nov 2009 03:17:44 +0000</pubDate>
		<dc:creator>Eagle Fantasy</dc:creator>
				<category><![CDATA[Interesting Maths]]></category>
		<category><![CDATA[证明]]></category>
		<category><![CDATA[趣题]]></category>
		<category><![CDATA[数学游戏]]></category>
		<category><![CDATA[游戏]]></category>

		<guid isPermaLink="false">http://www.eaglefantasy.cn/?p=563</guid>
		<description><![CDATA[上一篇日志里介绍了Nim游戏，他的必胜策略可不是那么好想的。这个游戏貌似很久以前就已经有了，可是必胜策略直至20世纪初才被哈佛大学的一个叫做Charles Leonard Bouton的数学家找到，可见其思维难度；可是，这个必胜策略却只要由一个运算就搞定了：Xor(异或)运算，可见Xor运算之神奇。没有好好学过程序设计的人估计对Xor运算不甚熟悉，更不可能知道他的神奇应用了，因此我先说一说Xor运算。 Xor运算是位运算的一种，和And、Or运算类似，假如a、b都是布尔变量，则a Xor b被定义为：a、b相异则为真(所以中文名字叫做异或)，a、b相同则为假。其真值表为：1Xor0=1, 0Xor1=1, 1Xor1=0, 0Xor0=0。众所周知，位运算也可以用于两个数之间，其定义就是把这两个数转化为二进制，然后一位一位的进行位运算。比如说1Xor4=(001)2 Xor(100)2=(101)2=5。位运算除了具有交换律、结合律这样的普通性质之外，还有几条神奇的性质。 Xor运算的神奇性质之一，就是他自己是自己的逆运算，即对于任何两个布尔变量或者数有(a Xor b)Xor b=a。这一点可以从真值表直接验证。有了这样一个性质，我们就可以把交换两个数的函数swap改进一下。大家应该都知道swap可以这么做： void swap(int a, int b) {a=a+b; b=a-b; a=a-b;}  现在我们知道了Xor运算是本身的逆运算之后，就可以把上面的函数改成这个样子：（在C/C++里面把Xor表示为^） void swap(int a, int b) {a=a^b; b=a^b; a=a^b;} 乍一看肯定会觉得这个交换函数写的非常诡异，但是仔细一看就知道其原理和刚才那个是一模一样的。而且因为计算机在执行位运算的时候肯定比加减法要快，所以用Xor写的交换函数实际上还更快呢。 这里有一个有意思的小问题：现在给你2n+1个正整数，其中有n对数和1个单独的数，（这里规定一对数的意思是这两个数相等），然后让你设计一种算法，把这个单独的数给找出来，要求时间复杂度为O(n)。比如说这2n+1个数是1 2 3 2 1，那么这个单独的数就是3。如果你的思路是依次挑出一个数然后和其余所有数比较一下看看是否相等，那就换个思路吧，因为这样的时间复杂度是O(n2)的。答案见本文末尾。 由这条性质还可以干一件很有意义的事情：当硬盘的一个部分损坏之后可以推算出来损坏部分数据！假定我们的硬盘划分成了4个区域，前三个区域用来存放真正的数据，而第四个部分则用来以防不时之需，这上面的数据定义为前三个部分的数据异或之后的结果。举个例子：假如说abc三个部分存放的数据如下： a: 1 0 0 1 b: 0 1 1 1 c: 1 0 1 0 则第四部分根据定义便是 d: 0 1 [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">我猜您也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F196&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F563">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">几道有意思的小数学题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F197&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F563">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">两个好玩的数学游戏</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F547&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F563">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">拈游戏</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F725&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F563">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">“少数决”游戏</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F191&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F563">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">趣题：空间四边形外切于给定球，求证四切点共面</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><a title="Nim游戏" href="http://www.eaglefantasy.com/archives/547" target="_blank">上一篇日志</a>里介绍了Nim游戏，他的必胜策略可不是那么好想的。这个游戏貌似很久以前就已经有了，可是必胜策略直至20世纪初才被哈佛大学的一个叫做Charles Leonard Bouton的数学家找到，可见其思维难度；可是，这个必胜策略却只要由一个运算就搞定了：Xor(异或)运算，可见Xor运算之神奇。没有好好学过程序设计的人估计对Xor运算不甚熟悉，更不可能知道他的神奇应用了，因此我先说一说Xor运算。</p>
<p>Xor运算是位运算的一种，和And、Or运算类似，假如a、b都是布尔变量，则a Xor b被定义为：a、b相异则为真(所以中文名字叫做异或)，a、b相同则为假。其真值表为：1Xor0=1, 0Xor1=1, 1Xor1=0, 0Xor0=0。众所周知，位运算也可以用于两个数之间，其定义就是把这两个数转化为二进制，然后一位一位的进行位运算。比如说1Xor4=(001)<sub>2</sub> Xor(100)<sub>2</sub>=(101)<sub>2</sub>=5。位运算除了具有交换律、结合律这样的普通性质之外，还有几条神奇的性质。</p>
<p>Xor运算的神奇性质之一，就是他自己是自己的逆运算，即对于任何两个布尔变量或者数有(a Xor b)Xor b=a。这一点可以从真值表直接验证。有了这样一个性质，我们就可以把交换两个数的函数swap改进一下。大家应该都知道swap可以这么做：</p>
<blockquote><p>void swap(int a, int b)</p>
<p>{a=a+b; b=a-b; a=a-b;} </p></blockquote>
<p>现在我们知道了Xor运算是本身的逆运算之后，就可以把上面的函数改成这个样子：（在C/C++里面把Xor表示为^）</p>
<blockquote><p>void swap(int a, int b)</p>
<p>{a=a^b; b=a^b; a=a^b;}</p></blockquote>
<p>乍一看肯定会觉得这个交换函数写的非常诡异，但是仔细一看就知道其原理和刚才那个是一模一样的。而且因为计算机在执行位运算的时候肯定比加减法要快，所以用Xor写的交换函数实际上还更快呢。</p>
<p>这里有一个有意思的小问题：现在给你2n+1个正整数，其中有n对数和1个单独的数，（这里规定一对数的意思是这两个数相等），然后让你设计一种算法，把这个单独的数给找出来，要求时间复杂度为O(n)。比如说这2n+1个数是1 2 3 2 1，那么这个单独的数就是3。如果你的思路是依次挑出一个数然后和其余所有数比较一下看看是否相等，那就换个思路吧，因为这样的时间复杂度是O(n<sup>2</sup>)的。答案见本文末尾。</p>
<p><span id="more-563"></span>由这条性质还可以干一件很有意义的事情：当硬盘的一个部分损坏之后可以推算出来损坏部分数据！假定我们的硬盘划分成了4个区域，前三个区域用来存放真正的数据，而第四个部分则用来以防不时之需，这上面的数据定义为前三个部分的数据异或之后的结果。举个例子：假如说abc三个部分存放的数据如下：</p>
<p>a: 1 0 0 1</p>
<p>b: 0 1 1 1</p>
<p>c: 1 0 1 0</p>
<p>则第四部分根据定义便是</p>
<p>d: 0 1 0 0</p>
<p>现在假如说系统检测到硬盘的第一部分损坏了，我们就可以利用现成的数据把它给恢复出来，只需要把现有的未损坏的几个部分都异或起来就可以了！因为：a xor b xor c=d  →  a xor a xor b xor c xor d xor d=d xor d xor a  → b xor c xor d=a！就这样，Xor运算应用在了乍一看完全不相干的地方。当然，硬盘分的部分更多一点也不影响这个结论的正确性。</p>
<p>Xor的第二个神奇性质，是他满足消去率，即由a Xor c=b Xor c可以推出a=b，可以用上面一条性质轻松验证。这一点是And、Or运算都不能满足的，是加法减法拥有的性质。有了这样一条性质是很有用的，比如说证明Nim游戏的必胜策略就需要用到，下面我们进入Nim游戏必胜策略的介绍和证明。</p>
<p>因为3堆硬币的情况和N堆的策略是一样的，我就直接拿N堆说事。设这N堆硬币的数量分别为a1,a2,...,an。因为总是打Xor太麻烦，下面我就用C++的习惯用^来代替Xor。</p>
<p> 要知道，像Nim游戏这种博弈问题，最重要的是寻找必败态。这个必败态的的意思就是，这样一种局面摆在面前的话先手必败。其严格定义如下：1.无法进行任何移动的局面是必败态；2.可以移动到必败态的局面是非必败态；3.在必败态做的所有操作的结果都是非必败态。这个还是很好理解的吧，就是自己处在非必败态上总能移动到必败态把必败态留给对方，而对方处在必败态的话总是只能移动到非必败态，把非必败态留给自己，然后自己继续虐对方。</p>
<p>而对于Nim游戏，局面是必败态当且仅当所有堆硬币的数量都异或起来结果为0，即a1^a2^...^an=0！！！为了证明之，我们只要证明它满足上述必败态的三条性质即可。</p>
<p>第一个命题显然，最终局面只有一个，就是全0，异或仍然是0。</p>
<p>第二个命题，对于某个局面(a1,a2,...,an)，若a1^a2^...^an!=0(不等号就用C++的习惯用!=来表示了)，一定存在某个合法的移动，将ai改变成ai'后满足a1^a2^...^ai'^...^an=0。不妨设a1^a2^...^an=k，则一定存在某个ai，它的二进制表示在k的最高位上是1（否则k的最高位那个1是怎么得到的）。这时ai^k&lt;ai一定成立。则我们可以将ai改变成ai'=ai^k，此时a1^a2^...^ai'^...^an=a1^a2^...^an^k=0。</p>
<p>第三个命题，对于某个局面(a1,a2,...,an)，若a1^a2^...^an=0，一定不存在某个合法的移动，将ai改变成ai'后满足a1^a2^...^ai'^...^an=0。因为异或运算满足消去率，由a1^a2^...^an=a1^a2^...^ai'^...^an可以得到ai=ai'。所以将ai改变成ai'不是一个合法的移动。证毕。</p>
<p>就这样，一个简单而神奇的运算，就搞定了这么个让我绞尽脑汁也毫无头绪的游戏，而Xor运算的出现，又是乍一看完全与问题毫不相干！这正是Xor的奇妙之处，吸引人之处。</p>
<p>————————————</p>
<p>最后给出“找出单独的数”问题的算法：根据Xor运算是本身的逆运算的性质，只要把所有数都Xor起来就可以了！比如说，1Xor2Xor3Xor2Xor1就一定是3了。就这么简单！</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">我猜您也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F196&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F563">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">几道有意思的小数学题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F197&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F563">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">两个好玩的数学游戏</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F547&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F563">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">拈游戏</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F725&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F563">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">“少数决”游戏</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F191&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F563">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">趣题：空间四边形外切于给定球，求证四切点共面</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.eaglefantasy.com/archives/563/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>两个好玩的数学游戏</title>
		<link>http://www.eaglefantasy.com/archives/197</link>
		<comments>http://www.eaglefantasy.com/archives/197#comments</comments>
		<pubDate>Fri, 30 May 2008 14:09:23 +0000</pubDate>
		<dc:creator>Eagle Fantasy</dc:creator>
				<category><![CDATA[Interesting Maths]]></category>
		<category><![CDATA[博弈]]></category>
		<category><![CDATA[数学游戏]]></category>
		<category><![CDATA[佘飞]]></category>

		<guid isPermaLink="false">http://www.eaglefantasy.cn/?p=197</guid>
		<description><![CDATA[这两个数学游戏，为佘飞所发明，个人认为相当有意思，我们玩儿了好长时间了，作为无聊繁重的课业之余的休闲娱乐活动。 1. 两人轮流从1～20中写数字，谁写下的数字中有4个之和为40谁就是赢家。写数字的时候每一轮都是分别写好然后再同时亮出来，已经写过的数字以后不可以再重复写。如果出现某一轮两人写的数各自可以凑成和为40，则这一轮两人写下的数字被划掉，而且以后也不准再写这个数。如果某一轮两人写了同一个数字，其中甲可以用它凑出40，而乙不行，则甲的那个数就被划掉，而乙的则保留下来。如果某一轮两人写了9同一个数字而且都无法用其凑出40，则同时被保留。 下面是一次游戏作为例子： 甲 乙 10 10 9 7 8 14（前三轮写数比较随意） 5 13（乙写13是因为：想防止甲此时写13而凑出40；甲写5是随便写的，属于失误） 13 9（甲写13是因为想凑40；乙写9也是因为欲凑40） 16 3（还是都想凑40） 6 17（双方都无法一次凑得40，故新写一数开始新一轮战斗） 17 6（双方都想凑40） 19 19（甲写19是为了凑40，但甲这次很不幸，被乙猜中，因为乙写19凑不出40所以甲的19被划掉而乙的19被留下） 4 1（这一轮乙有1、2、4三个数可以凑出40，但是甲已经没有什么可以凑40的数了，所以蒙了一个，结果不幸蒙错，至此乙获胜。7+13+19+1=40） Hint:这个游戏对于算数有较高要求，我就因为算数太烂玩的很吃力。有的时候心理战很重要，你要猜对方可能写什么，还要尽量不让对方猜中你想些什么，否则会很吃亏。这是个较完备的游戏，不存在必胜策略，玩起来惊心动魄，相当有趣。 2. 俄罗斯方块棋。类似于俄罗斯方块，画一张10×10的网格，方块可以从上往下落。两人轮流选择一种方块让它往下落，但是规定块在下落过程中不可以左右平移或者旋转，只能从指定的列竖着往下落。谁填上最后一块方块而让对方无法再放新块谁就是赢家。 下面这张图是个例子（块中的数字表示先后顺序）： 上面的例子中在黄色块10号落下后，蓝色没有地方落了，故黄方赢。其实在黄8号块落下时，蓝方已经败局已定了。这个例子没有保证每一步都是最优的。 Hint:我非常喜欢玩这个游戏，但是由于佘飞玩的实在太好，我老是算得没有他远，所以总是挨虐…<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">我猜您也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F725&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F197">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">“少数决”游戏</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F563&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F197">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Nim游戏的必胜策略和Xor运算的神奇应用</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F196&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F197">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">几道有意思的小数学题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F481&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F197">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">几个数学娱乐</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F111&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F197">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">圈套</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>这两个数学游戏，为佘飞所发明，个人认为相当有意思，我们玩儿了好长时间了，作为无聊繁重的课业之余的休闲娱乐活动。</p>
<p>1. 两人轮流从1～20中写数字，谁写下的数字中有4个之和为40谁就是赢家。写数字的时候每一轮都是分别写好然后再同时亮出来，已经写过的数字以后不可以再重复写。如果出现某一轮两人写的数各自可以凑成和为40，则这一轮两人写下的数字被划掉，而且以后也不准再写这个数。如果某一轮两人写了同一个数字，其中甲可以用它凑出40，而乙不行，则甲的那个数就被划掉，而乙的则保留下来。如果某一轮两人写了9同一个数字而且都无法用其凑出40，则同时被保留。</p>
<p>下面是一次游戏作为例子：<span id="more-197"></span><br />
甲 乙<br />
10 10<br />
9 7<br />
8 14（前三轮写数比较随意）<br />
5 13（乙写13是因为：想防止甲此时写13而凑出40；甲写5是随便写的，属于失误）<br />
<span style="text-decoration: line-through;">13</span> <span style="text-decoration: line-through;">9</span>（甲写13是因为想凑40；乙写9也是因为欲凑40）<br />
<span style="text-decoration: line-through;">16</span> <span style="text-decoration: line-through;">3</span>（还是都想凑40）<br />
6 17（双方都无法一次凑得40，故新写一数开始新一轮战斗）<br />
<span style="text-decoration: line-through;">17</span> <span style="text-decoration: line-through;">6</span>（双方都想凑40）<br />
<span style="text-decoration: line-through;">19</span> 19（甲写19是为了凑40，但甲这次很不幸，被乙猜中，因为乙写19凑不出40所以甲的19被划掉而乙的19被留下）<br />
4 1（这一轮乙有1、2、4三个数可以凑出40，但是甲已经没有什么可以凑40的数了，所以蒙了一个，结果不幸蒙错，至此乙获胜。7+13+19+1=40）</p>
<p>Hint:这个游戏对于算数有较高要求，我就因为算数太烂玩的很吃力。有的时候心理战很重要，你要猜对方可能写什么，还要尽量不让对方猜中你想些什么，否则会很吃亏。这是个较完备的游戏，不存在必胜策略，玩起来惊心动魄，相当有趣。</p>
<p>2. 俄罗斯方块棋。类似于俄罗斯方块，画一张10×10的网格，方块可以从上往下落。两人轮流选择一种方块让它往下落，但是规定块在下落过程中不可以左右平移或者旋转，只能从指定的列竖着往下落。谁填上最后一块方块而让对方无法再放新块谁就是赢家。</p>
<p>下面这张图是个例子（块中的数字表示先后顺序）：</p>
<p><img style="float: none;" src="/images/eluosifangkuaiqi.jpg" alt="" width="214" height="207" /></p>
<p>上面的例子中在黄色块10号落下后，蓝色没有地方落了，故黄方赢。其实在黄8号块落下时，蓝方已经败局已定了。这个例子没有保证每一步都是最优的。</p>
<p>Hint:我非常喜欢玩这个游戏，但是由于佘飞玩的实在太好，我老是算得没有他远，所以总是挨虐…</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">我猜您也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F725&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F197">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">“少数决”游戏</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F563&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F197">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Nim游戏的必胜策略和Xor运算的神奇应用</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F196&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F197">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">几道有意思的小数学题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F481&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F197">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">几个数学娱乐</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F111&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F197">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">圈套</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.eaglefantasy.com/archives/197/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>几道有意思的小数学题</title>
		<link>http://www.eaglefantasy.com/archives/196</link>
		<comments>http://www.eaglefantasy.com/archives/196#comments</comments>
		<pubDate>Sat, 24 May 2008 13:36:43 +0000</pubDate>
		<dc:creator>Eagle Fantasy</dc:creator>
				<category><![CDATA[Interesting Maths]]></category>
		<category><![CDATA[证明]]></category>
		<category><![CDATA[趣题]]></category>
		<category><![CDATA[巧妙]]></category>
		<category><![CDATA[数学游戏]]></category>

		<guid isPermaLink="false">http://www.eaglefantasy.cn/?p=196</guid>
		<description><![CDATA[1.“一切无理数的无理数次方一定是无理数”，试证明此命题或举出反例。 2.两人在1，2，3，……，9这九个数字中轮流取数，不准重复，谁先取到三数之和为15谁就赢了。问先走者有没有一个稳操胜券的策略？ 3.汽油危机已经来临，大家都在叫油荒。分散在长长的环形公路各处的加油站所存的油量仅仅够你跑一圈而无点滴富余。请证明，如果你在一个合适的加油站开始启程，把空油箱加足了汽油，你有充分把握可以跑完一圈，不会中途抛锚。 请先仔细思考再看解答.             1.“一切无理数的无理数次方一定是无理数”，试证明此命题或举出反例。 Solution:这个命题是错误的，有一个构造巧妙的反例：我们设 如果x是有理数，那x就是该命题的反例；如果x是无理数，那么我们来看看x的根2次方是多少——它就是2！！！于是反例找到了。 2.两人在1，2，3，……，9这九个数字中轮流取数，不准重复，谁先取到三数之和为15谁就赢了。问先走者有没有一个稳操胜券的策略？ Solution:答案是没有必胜策略。解决这个问题的最简单办法是把它转化成另一个我们都很熟悉的问题。首先构造幻方如下： 4 9 2 3 5 7 8 1 6 横行竖列对角线的和都是15，因此他们两个人玩得其实就是“吃井字”游戏(“吃井字”游戏就是在3×3的格子里画圈叉，三个连成一条线就赢了的那个游戏)！我们都知道“吃井字”游戏是没有必胜策略的，双方可以打成平局，所以原问题也没有必胜策略。 3.汽油危机已经来临，大家都在叫油荒。分散在长长的环形公路各处的加油站所存的油量仅仅够你跑一圈而无点滴富余。请证明，如果你在一个合适的加油站开始启程，把空油箱加足了汽油，你有充分把握可以跑完一圈，不会中途抛锚。 Solution:设想你在第一站带上足够的燃料，沿着公路环行，每到一处，便做好记录油箱里还有多少油，并把那里的汽油全部倒进油箱。当你回到第一站时，你将发现，油箱里的剩油与出发时一样多。总有一站油箱里的油量最小，我们就从这站开始启程，这样保证环行一周途中不愁汽油断档。<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">我猜您也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F191&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F196">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">趣题：空间四边形外切于给定球，求证四切点共面</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F563&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F196">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Nim游戏的必胜策略和Xor运算的神奇应用</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F1123&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F196">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">代数基本定理的一个最简单证明</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F201&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F196">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">棋盘覆盖问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F77&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F196">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">一个超级赖皮的数学证明方法——例证法</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>1.“一切无理数的无理数次方一定是无理数”，试证明此命题或举出反例。</p>
<p>2.两人在1，2，3，……，9这九个数字中轮流取数，不准重复，谁先取到三数之和为15谁就赢了。问先走者有没有一个稳操胜券的策略？</p>
<p>3.汽油危机已经来临，大家都在叫油荒。分散在长长的环形公路各处的加油站所存的油量仅仅够你跑一圈而无点滴富余。请证明，如果你在一个合适的加油站开始启程，把空油箱加足了汽油，你有充分把握可以跑完一圈，不会中途抛锚。</p>
<p>请先仔细思考再看解答.</p>
<p> <span id="more-196"></span></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>1.“一切无理数的无理数次方一定是无理数”，试证明此命题或举出反例。</p>
<p>Solution:这个命题是错误的，有一个构造巧妙的反例：我们设</p>
<p><img class="shutter" style="float:none;" src="/images/gongshi1.gif" alt="" /></p>
<p>如果x是有理数，那x就是该命题的反例；如果x是无理数，那么我们来看看x的根2次方是多少——它就是2！！！于是反例找到了。</p>
<p>2.两人在1，2，3，……，9这九个数字中轮流取数，不准重复，谁先取到三数之和为15谁就赢了。问先走者有没有一个稳操胜券的策略？</p>
<p>Solution:答案是没有必胜策略。解决这个问题的最简单办法是把它转化成另一个我们都很熟悉的问题。首先构造幻方如下：<br />
4 9 2<br />
3 5 7<br />
8 1 6<br />
横行竖列对角线的和都是15，因此他们两个人玩得其实就是“吃井字”游戏(“吃井字”游戏就是在3×3的格子里画圈叉，三个连成一条线就赢了的那个游戏)！我们都知道“吃井字”游戏是没有必胜策略的，双方可以打成平局，所以原问题也没有必胜策略。</p>
<p>3.汽油危机已经来临，大家都在叫油荒。分散在长长的环形公路各处的加油站所存的油量仅仅够你跑一圈而无点滴富余。请证明，如果你在一个合适的加油站开始启程，把空油箱加足了汽油，你有充分把握可以跑完一圈，不会中途抛锚。</p>
<p>Solution:设想你在第一站带上足够的燃料，沿着公路环行，每到一处，便做好记录油箱里还有多少油，并把那里的汽油全部倒进油箱。当你回到第一站时，你将发现，油箱里的剩油与出发时一样多。总有一站油箱里的油量最小，我们就从这站开始启程，这样保证环行一周途中不愁汽油断档。</p>
<p style="margin:0;padding:0;height:1px;overflow:hidden;">
    <script type="text/javascript"><!--
        var wumiiSitePrefix = "http://www.eaglefantasy.com";
        var wumiiEnableCustomPos = false;
        var wumiiParams = "&#038;num=10&#038;mode=3&#038;displayInFeed=1&#038;version=1.0.5.5&#038;pf=WordPress3.3.1";
    //--></script><script type="text/javascript" src="http://widget.wumii.com/ext/relatedItemsWidget.htm"></script><a href="http://www.wumii.com/widget/relatedItems.htm" style="border:0;"><img src="http://static.wumii.com/images/pixel.png" alt="无觅相关文章插件，快速提升流量" style="border:0;padding:0;margin:0;" /></a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">我猜您也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F191&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F196">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">趣题：空间四边形外切于给定球，求证四切点共面</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F563&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F196">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Nim游戏的必胜策略和Xor运算的神奇应用</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F1123&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F196">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">代数基本定理的一个最简单证明</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F201&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F196">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">棋盘覆盖问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F77&from=http%3A%2F%2Fwww.eaglefantasy.com%2Farchives%2F196">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">一个超级赖皮的数学证明方法——例证法</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.eaglefantasy.com/archives/196/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

