<?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%b4%97%e7%89%8c/feed" rel="self" type="application/rss+xml" />
	<link>http://zhiqiang.org/blog</link>
	<description>数学、金融、计算机</description>
	<lastBuildDate>Sat, 19 May 2012 13:47:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>魔方里的数学</title>
		<link>http://zhiqiang.org/blog/science/mathmatics-in-rubik-cube-and-algorithm.html</link>
		<comments>http://zhiqiang.org/blog/science/mathmatics-in-rubik-cube-and-algorithm.html#comments</comments>
		<pubDate>Wed, 26 Sep 2007 12:26:48 +0000</pubDate>
		<dc:creator>zhiqiang</dc:creator>
				<category><![CDATA[自然科学]]></category>
		<category><![CDATA[Rubik's Cube]]></category>
		<category><![CDATA[图论]]></category>
		<category><![CDATA[洗牌]]></category>
		<category><![CDATA[算法]]></category>
		<category><![CDATA[解法]]></category>
		<category><![CDATA[魔方]]></category>

		<guid isPermaLink="false">http://zhiqiang.org/blog/posts/mathmatics-in-rubik-cube-and-algorithm-2.html</guid>
		<description><![CDATA[博客 » 自然科学 » Rubik's Cube，图论，洗牌，算法，解法，魔方 » 今天香港中文大学的Prof. Cai给我们上graph algorithm。第一节课上教我们玩魔方，先给每人发了一个。我喜欢这样的教学方法 。 魔方的解法，在网上已经有无数了，基本上的思路都是几个定式，玩的时候记住这些定式即可。课上Cai给我们演示了一个他自创的定式，很可惜，我目前为止只学会弄出一面来。 OK，这篇...]]></description>
			<content:encoded><![CDATA[<p id="breadcrumb" class="breadcrumb"><a href="http://zhiqiang.org/blog/">博客</a> » <a href="http://zhiqiang.org/blog/category/science">自然科学</a> » <a href="http://zhiqiang.org/blog/tag/rubiks-cube" rel="tag">Rubik's Cube</a>，<a href="http://zhiqiang.org/blog/tag/%e5%9b%be%e8%ae%ba" rel="tag">图论</a>，<a href="http://zhiqiang.org/blog/tag/%e6%b4%97%e7%89%8c" rel="tag">洗牌</a>，<a href="http://zhiqiang.org/blog/tag/%e7%ae%97%e6%b3%95" rel="tag">算法</a>，<a href="http://zhiqiang.org/blog/tag/%e8%a7%a3%e6%b3%95" rel="tag">解法</a>，<a href="http://zhiqiang.org/blog/tag/%e9%ad%94%e6%96%b9" rel="tag">魔方</a> » </p><p><a href="http://zhiqiang.org/blog/wp-content/uploads/2fd8c30091e6_11914/d6f5f80ad070.jpg"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="240" alt="魔方" src="http://zhiqiang.org/blog/wp-content/uploads/2fd8c30091e6_11914/_thumb.jpg" width="233" align="right" border="0"/></a>今天香港中文大学的<a title="CAI, Leizhen" href="http://www.cse.cuhk.edu.hk/~lcai/" target="_blank">Prof. Cai</a>给我们上graph algorithm。第一节课上教我们玩魔方，先给每人发了一个。我喜欢这样的教学方法 <img src='http://zhiqiang.org/blog/wp-includes/images/smilies/smile.gif' alt=':)' class='wp-smiley' /> 。 </p>
<p>魔方的解法，在网上已经有<a title="在Google里搜索 魔方 玩法" href="http://www.google.com.hk/search?hl=en&amp;newwindow=1&amp;q=%E9%AD%94%E6%96%B9%E3%80%80%E7%8E%A9%E6%B3%95" target="_blank">无数</a>了，基本上的思路都是几个定式，玩的时候记住这些定式即可。课上Cai给我们演示了一个他自创的定式，很可惜，我目前为止只学会弄出一面来。</p>
<p>OK，这篇文章的主要目的是讲魔方里的数学，对魔方的群结构研究网上也已经有很多，这里不谈了。魔方总共有(8! × 3<sup>8−1</sup>) × (12! × 2<sup>12−1</sup>)/2 = 43252003274489856000=4.3× 10<sup>19</sup>个不同的状态。每个状态看作图上的一个点，则解魔方问题可以视作求一个超大图上的路径问题。这个图是如此之大，使得看上去求最短路这么简单的问题都变得非常困难，事实上，用计算机也不可能直接算。</p>
<p>虽然这个图是如此之大，而且边很少（每个顶点只引出12条边），但这个图的直径却非常小。可以证明，任何一种魔方的状态，都<font color="#ff0000">可以在26步之内复原</font>。（见<a href="http://en.wikipedia.org/wiki/Optimal_solutions_for_Rubik's_Cube" target="_blank">Optimal solutions for Rubik's Cube</a>)</p>
<p>这样的图与以前提到过的<a href="http://zhiqiang.org/blog/science/the-perfect-number-of-shuffling-7-times.html" target="_blank">洗牌模型</a>里面的图非常相似，结构简单，定点巨多，但混合速度却特别快（从一点会以非常快的速度达到其它点），做算法的很喜欢这种图。</p>
<div><h4>相关文章</h4><ul><li class='currentpost'><a href="http://zhiqiang.org/blog/science/mathmatics-in-rubik-cube-and-algorithm.html">魔方里的数学</a></li><li ><a href="http://zhiqiang.org/blog/science/the-perfect-number-of-shuffling-7-times.html">&quot;完美&quot;的洗牌次数 - 7次</a></li><li ><a href="http://zhiqiang.org/blog/science/a-open-graph-problem.html">一个图论题</a></li><li ><a href="http://zhiqiang.org/blog/science/computer-science/preliminary-computer-theory-algorithms-and-calculation-model.html">理论计算机初步：算法和计算模型</a></li><li ><a href="http://zhiqiang.org/blog/science/computer-science/an-algorithm-face-interviews-question-test.html">一个算法面试题 &#038; 面试题库</a></li><li ><a href="http://zhiqiang.org/blog/science/computer-science/graph-isomorphism-is-polynomial.html">图同构问题属于P？</a></li><li ><a href="http://zhiqiang.org/blog/science/computer-science/complexity-of-prime-sieve.html">素数筛法的复杂度</a></li><li ><a href="http://zhiqiang.org/blog/science/computer-science/median-algorithm-of-ordered-matrix.html">有序矩阵的中位数算法</a></li><li ><a href="http://zhiqiang.org/blog/science/computer-science/download-encyclopedia-of-algorithm.html">算法百科全书 - Encyclopedia of Algorithms</a></li><li ><a href="http://zhiqiang.org/blog/science/computer-science/inverse-square-root-algorithm-analysis.html">求平方根倒数的算法</a></li></ul></div>    <p></p>
    <hr noshade style="margin:0;height:1px" />
    <p>&copy; zhiqiang for <a href="http://zhiqiang.org/blog">阅微堂</a>, 2007. | <a href="http://zhiqiang.org/blog/science/mathmatics-in-rubik-cube-and-algorithm.html">&#38142;&#25509;</a> | <a href="http://zhiqiang.org/blog/science/mathmatics-in-rubik-cube-and-algorithm.html#comments">23 &#26465;&#35780;&#35770;</a></p>]]></content:encoded>
			<wfw:commentRss>http://zhiqiang.org/blog/science/mathmatics-in-rubik-cube-and-algorithm.html/feed</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>&quot;完美&quot;的洗牌次数 - 7次</title>
		<link>http://zhiqiang.org/blog/science/the-perfect-number-of-shuffling-7-times.html</link>
		<comments>http://zhiqiang.org/blog/science/the-perfect-number-of-shuffling-7-times.html#comments</comments>
		<pubDate>Fri, 15 Dec 2006 04:23:51 +0000</pubDate>
		<dc:creator>zhiqiang</dc:creator>
				<category><![CDATA[自然科学]]></category>
		<category><![CDATA[Diaconis]]></category>
		<category><![CDATA[概率]]></category>
		<category><![CDATA[洗牌]]></category>
		<category><![CDATA[理论计算机笔记]]></category>
		<category><![CDATA[随机算法]]></category>
		<category><![CDATA[魔术]]></category>

		<guid isPermaLink="false">http://zhiqiang.org/blog/498.html</guid>
		<description><![CDATA[博客 » 自然科学 » Diaconis，概率，洗牌，理论计算机笔记，随机算法，魔术 » 系列：理论计算机笔记 查看该系列所有文章 在大家玩牌的时候，每一局之前都需要重新洗牌——一次洗牌指将牌分为左右两垛然后穿插放牌，但多少次洗牌才是正当的呢？就我多次打牌的观察，多数人都不超过4次。 但就D. Aldous和P. Diaconis在1992的一个结果，要想达到“比较完美”的洗牌效果——洗...]]></description>
			<content:encoded><![CDATA[<p id="breadcrumb" class="breadcrumb"><a href="http://zhiqiang.org/blog/">博客</a> » <a href="http://zhiqiang.org/blog/category/science">自然科学</a> » <a href="http://zhiqiang.org/blog/tag/diaconis" rel="tag">Diaconis</a>，<a href="http://zhiqiang.org/blog/tag/%e6%a6%82%e7%8e%87" rel="tag">概率</a>，<a href="http://zhiqiang.org/blog/tag/%e6%b4%97%e7%89%8c" rel="tag">洗牌</a>，<a href="http://zhiqiang.org/blog/tag/%e7%90%86%e8%ae%ba%e8%ae%a1%e7%ae%97%e6%9c%ba%e7%ac%94%e8%ae%b0" rel="tag">理论计算机笔记</a>，<a href="http://zhiqiang.org/blog/tag/%e9%9a%8f%e6%9c%ba%e7%ae%97%e6%b3%95" rel="tag">随机算法</a>，<a href="http://zhiqiang.org/blog/tag/%e9%ad%94%e6%9c%af" rel="tag">魔术</a> » </p><div class="series"><span>系列：<b>理论计算机笔记</b></span><br/>
<a href="http://zhiqiang.org/blog/tag/%e7%90%86%e8%ae%ba%e8%ae%a1%e7%ae%97%e6%9c%ba%e7%ac%94%e8%ae%b0">查看该系列所有文章</a>
<div id='series'></div>
</div>  <p>在大家玩牌的时候，每一局之前都需要重新洗牌——一次洗牌指将牌分为左右两垛然后穿插放牌，但多少次洗牌才是正当的呢？就我多次打牌的观察，多数人都不超过4次。</p>
<p>但就D. Aldous和P. Diaconis<a href="http://www.dartmouth.edu/~chance/course/topics/winning_number.html" target="_blank">在1992的一个结果</a>，要想达到“比较完美”的洗牌效果——洗完牌后牌局基本上随机分布，至少需要5次，要达到“完美”洗牌，则需要7次。但更多次数不会有太多改进。这还是对于一副牌而言的。对于两副牌则需要9次，6副牌需要洗12次。</p>
<p>所用方法是计算图上随机游走达到稳定分布的速度。而这个方法就应用于上面这个结果之后，对于理论计算机的概率算法产生了深远的影响，这也使得P.Diaconis的<a href="http://www.dartmouth.edu/~chance/teaching_aids/books_articles/Mann.pdf" target="_blank">这篇论文</a>超出了它本身看似玩物的领域。</p>
<p>再谈一下<a href="http://www-stat.stanford.edu/~cgates/PERSI/" target="_blank">P. Diaconis</a>，此君14岁离家，去做职业魔术师，没上高中，后来用白天魔术表演挣来的钱晚上念大学课程，最后获得哈佛的博士和斯坦福的教职。另传说中，此人赌技惊人，是赌场不受欢迎之人物。</p>
<div><h4>相关文章</h4><ul><li class='currentpost'><a href="http://zhiqiang.org/blog/science/the-perfect-number-of-shuffling-7-times.html">&quot;完美&quot;的洗牌次数 - 7次</a></li><li ><a href="http://zhiqiang.org/blog/science/computer-science/boxes-problem-on-static-data-structure-problems.html">摸箱子问题以及应用</a></li><li ><a href="http://zhiqiang.org/blog/science/mathmatics-in-rubik-cube-and-algorithm.html">魔方里的数学</a></li><li ><a href="http://zhiqiang.org/blog/resource/magics-in-2009-spring-festival-gala.html">2009年的春节晚会魔术</a></li><li ><a href="http://zhiqiang.org/blog/science/computer-science/tcs-byzantine-failure-the-byzantine-generals-problem.html">TCS: 拜占庭将军问题 (The Byzantine Generals Problem)</a></li><li ><a href="http://zhiqiang.org/blog/science/computer-science/tcs-classroom-notes-database-storage-problems.html">TCS课堂笔记：数据库存储问题</a></li><li ><a href="http://zhiqiang.org/blog/science/how-n-people-divide-a-cake-fairly.html">征集3个人分蛋糕的方法</a></li><li ><a href="http://zhiqiang.org/blog/science/to-active-the-brain-active.html">来活跃活跃大脑</a></li><li ><a href="http://zhiqiang.org/blog/science/game-two-hats.html">帽子游戏二</a></li><li ><a href="http://zhiqiang.org/blog/science/googles-crazy-face-questions.html">Google的疯狂面试题</a></li></ul></div>    <p></p>
    <hr noshade style="margin:0;height:1px" />
    <p>&copy; zhiqiang for <a href="http://zhiqiang.org/blog">阅微堂</a>, 2006. | <a href="http://zhiqiang.org/blog/science/the-perfect-number-of-shuffling-7-times.html">&#38142;&#25509;</a> | <a href="http://zhiqiang.org/blog/science/the-perfect-number-of-shuffling-7-times.html#comments">6 &#26465;&#35780;&#35770;</a></p>]]></content:encoded>
			<wfw:commentRss>http://zhiqiang.org/blog/science/the-perfect-number-of-shuffling-7-times.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

