<?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"
	>

<channel>
	<title>阅微堂 &#187; 科学</title>
	<atom:link href="http://zhiqiang.org/blog/category/science/feed/" rel="self" type="application/rss+xml" />
	<link>http://zhiqiang.org/blog</link>
	<description>科学，人文，民主</description>
	<pubDate>Thu, 17 Jul 2008 13:44:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7-bleeding</generator>
	<language>en</language>
			<item>
		<title>算法百科全书 - Encyclopedia of Algorithms</title>
		<link>http://zhiqiang.org/blog/posts/download-encyclopedia-of-algorithm.html</link>
		<comments>http://zhiqiang.org/blog/posts/download-encyclopedia-of-algorithm.html#comments</comments>
		<pubDate>Wed, 16 Jul 2008 04:50:20 +0000</pubDate>
		<dc:creator>zhiqiang</dc:creator>
		
		<category><![CDATA[网络资源]]></category>

		<category><![CDATA[计算机科学]]></category>

		<category><![CDATA[Encyclopedia of Algorithms]]></category>

		<category><![CDATA[算法]]></category>

		<guid isPermaLink="false">http://zhiqiang.org/blog/posts/download-encyclopedia-of-algorithm.html</guid>
		<description><![CDATA[Xie Xie推荐了一本今年出版的一本新书，Encyclopedia of Algorithms，全书1200页，涵盖各类有名问题的算法，概率算法，近似算法，量子算法等。
翻了一下，很多算法都不是直接给出的，只是给出一些原理描述和参考文献。看来这本也真只能当当索引用了。
没事做的话可以先欣赏一下第698页的O(n)的平面图判定算法。
按照推荐人xiexie的说法，看在原书高达309欧元的价格份上，也得下...]]></description>
			<content:encoded><![CDATA[<p>Xie Xie推荐了一本今年出版的一本新书，<em>Encyclopedia of Algorithms</em>，全书1200页，涵盖各类有名问题的算法，概率算法，近似算法，量子算法等。</p>
<p>翻了一下，很多算法都不是直接给出的，只是给出一些原理描述和参考文献。看来这本也真只能当当索引用了。</p>
<p>没事做的话可以先欣赏一下第698页的O(n)的平面图判定算法。</p>
<p>按照推荐人xiexie的说法，看在原书高达309欧元的价格份上，也得下载一本回来爽一爽。</p>
<p>听说个人blog上不要放版权材料，下载地址大家自己找吧。<a href="http://ifile.it/vucae2q/__3930210__via_gigapedia.info__.html" target="_blank"></a></p>
<div><h2>相关文章</h2><ul><li><a href="http://zhiqiang.org/blog/posts/median-algorithm-of-ordered-matrix.html">有序矩阵的中位数算法</a><br/>给定$$n\times n$$的实数矩阵，每行和每列都是递增的，求这$$n^2$$个数的中位数。 使用类似Tarjan的线性中位数的方法，每次找每列中位数，然后找中位数...</li><li><a href="http://zhiqiang.org/blog/posts/another-perfect-shuffle-algorithm.html">Perfect Shuffle的算法</a><br/>珍爱生命，远离政治。我们继续讨论算法。 2008/04/01补充：此算法有重大缺陷。详情请见留言部分。 一年前，我们讨论过一个算法问题，perfect shuffle，...</li><li><a href="http://zhiqiang.org/blog/posts/complexity-of-prime-sieve.html">素数筛法的复杂度</a><br/>Xie Xie给我看了一个链接性能调优--永远超乎想象，里面提到了素数筛法的复杂度，作者用实验发现此筛法是线形的。 所谓素数筛法就是那个求小于n的...</li><li><a href="http://zhiqiang.org/blog/posts/programs-depend-on-date-struct-not-algorithm.html">编程的核心是数据结构，而不是算法</a><br/>Rob Pike, 最伟大的 C 语言大师之一 , 在Notes on C Programming(英文原文)中从另一个稍微不同的角度表述了 Unix 的哲学:   你无法断定程序会在什么地方耗费运...</li><li><a href="http://zhiqiang.org/blog/posts/graph-isomorphism-is-polynomial.html">图同构问题属于P？</a><br/>更新：证明的关键一步发现错误，作者更新了论文，结论甚至论文标题都改了（废话），新版本On the graph isomorphism problem。  提交论文到arxiv不需要审阅...</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/posts/download-encyclopedia-of-algorithm.html">&#38142;&#25509;</a> | <a href="http://zhiqiang.org/blog/posts/download-encyclopedia-of-algorithm.html#comments">7 &#26465;&#35780;&#35770;</a></p>]]></content:encoded>
			<wfw:commentRss>http://zhiqiang.org/blog/posts/download-encyclopedia-of-algorithm.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Proofs from the Book - 来自圣经的证明</title>
		<link>http://zhiqiang.org/blog/posts/recommend-proofs-from-the-book.html</link>
		<comments>http://zhiqiang.org/blog/posts/recommend-proofs-from-the-book.html#comments</comments>
		<pubDate>Thu, 19 Jun 2008 01:57:49 +0000</pubDate>
		<dc:creator>zhiqiang</dc:creator>
		
		<category><![CDATA[科学]]></category>

		<category><![CDATA[Erdos]]></category>

		<category><![CDATA[proof from the book]]></category>

		<category><![CDATA[数学]]></category>

		<guid isPermaLink="false">http://zhiqiang.org/blog/?p=802</guid>
		<description><![CDATA[
&#34;Good mathematics&#34; could refer (in no particular order) to
...... Elegant mathematics (e.g. Paul Erdos's concept of &#34;proofs from the Book&#34; achieving a difficult result with a minimum of effort);
Terry Tao in What is Good Mathematics

我很早就听说过这本书，但真正引起我的兴趣是在看到那个Sylvester-Gallai定理的证明之后。
Sylvester-Gallai定理：平面上不全共线的个点，必有一条直线恰过其中两个点。

这个定理的最原始的...]]></description>
			<content:encoded><![CDATA[<blockquote>
<p>&quot;Good mathematics&quot; could refer (in no particular order) to</p>
<p>...... <strong>Elegant mathematics</strong> (e.g. Paul Erdos's concept of &quot;<strong>proofs from the Book</strong>&quot; achieving a difficult result with a minimum of effort);</p>
<p align="right">Terry Tao in <a href="http://arxiv.org/PS_cache/math/pdf/0702/0702396v1.pdf" target="_blank">What is Good Mathematics</a></p>
</blockquote>
<p>我很早就听说过这本书，但真正引起我的兴趣是在看到那个Sylvester-Gallai定理的证明之后。</p>
<blockquote><p><strong>Sylvester-Gallai定理</strong>：平面上不全共线的<img src="http://zhiqiang.org/blog/wp-content/cache/tex_89bcaa1d9d43ec4ff5b4a71ed93ec73e.png" style="vertical-align:middle; " class="tex" alt="n(n&gt;2)" />个点，必有一条直线恰过其中两个点。</p>
</blockquote>
<p>这个定理的最原始的证明我很早就见过，极端法的经典例子，很多人都知道；但书里给的方法可谓绝妙。这还说明不了什么，我们不能单为了绝妙而去弄不必要的证明。但同样的视角（对偶原理）可以用来证明Motzkin-Rabin定理，后者是我想了好久都没想出来怎么做的问题，而且这个定理<a href="http://citeseer.ist.psu.edu/cache/papers/cs/27665/http:zSzzSzmaths.unisa.ac.zazSz~swanekjzSzmotzkin-rabin.pdf/pretorius02algorithmic.pdf" target="_blank">其它的证明</a>都繁复无比。</p>
<blockquote><p><strong>Motzkin-Rabin定理</strong>：平面上不全共线的<img src="http://zhiqiang.org/blog/wp-content/cache/tex_89bcaa1d9d43ec4ff5b4a71ed93ec73e.png" style="vertical-align:middle; " class="tex" alt="n(n&gt;2)" />个点，每个点红黑二染色后，存在一条直线穿过至少两个点且颜色全部相同。</p>
</blockquote>
<p>书中这两个定理的证明已经有人<a href="http://fwjmath.spaces.live.com/blog/cns!6A37A2A4F21FF4DE!856.entry" target="_blank">翻译整理放到网上</a>。</p>
<p>读一读这本书吧，你会喜欢上数学的。</p>
<p><iframe style="border-right: #dde5e9 1px solid; padding-right: 0px; border-top: #dde5e9 1px solid; padding-left: 0px; float: right; padding-bottom: 0px; margin: 3px; border-left: #dde5e9 1px solid; width: 240px; padding-top: 0px; border-bottom: #dde5e9 1px solid; height: 66px; background-color: #ffffff" marginwidth="0" marginheight="0" src="http://cid-0b88dcc4eabdd13c.skydrive.live.com/embedrowdetail.aspx/Public/%e7%a7%91%e5%ad%a6/Proofs.from.the.Book.2004|53rd|6.pdf" frameborder="0" scrolling="no"></iframe><b>Download 下载(英文版)</b><br />[Rapidshare]<a href="http://rapidshare.com/files/73695030/770_Proofs.from.the.Book.2004_3rd_.rar">Proofs.from.the.Book.2004_3rd_.rar</a><br />[Mirror] <a href="http://depositfiles.com/files/2564309">http://depositfiles.com/files/2564309</a></p>
<p>注：这本书中文译名为《来自圣经的证明》，但也有说是《来自天书的证明》的。</p>
<div><h2>相关文章</h2><ul><li><a href="http://zhiqiang.org/blog/posts/tung-and-the-poincare-conjecture.html">丘成桐和庞加莱猜想</a><br/>昨天，丘成桐在友谊宾馆举办了一个讲座，提到了庞加莱猜想证明的更多细节，听说还请到了霍金到场。今天在同一地方，曹怀东和朱熹平每人又给了1...</li><li><a href="http://zhiqiang.org/blog/posts/poincare-conjecture-was-that.html">庞加莱猜想被证明？</a><br/>Stephen SMALE 解决4维以上广义庞加莱猜想获1966菲尔兹奖
Michael H. FREEDMAN 解决4维广义庞加莱猜想获1986菲尔兹奖
但本来的庞加莱猜想未解决。 Clay 数学所...</li><li><a href="http://zhiqiang.org/blog/posts/chinese-mathematician-named-to-the-research-results.html">以华人数学家命名的研究成果</a><br/>[据少年数学网消息]中华民族是一个具有灿烂文化和悠久历史的民族，在灿烂的文化瑰宝中数学在世界也同样具有许多耀眼的光环，我国古代算术的许...</li><li><a href="http://zhiqiang.org/blog/posts/cattle-people-story-xiang-tang-zz.html">牛人故事：唐翔 (zz)</a><br/>唐翔是我认识的最牛的人。
这句话得好好解释一下：首先，什么叫做认识？认识当然指的是相互关系。比如说，我的老板姜伯驹和王诗宬，一个是两...</li><li><a href="http://zhiqiang.org/blog/posts/tan-xue-few-gan-zz.html">学数甘苦谈 (zz)</a><br/>http://www.rainbowplan.org/bbs/topic.php?topic=1189&select=&forum=1

送交者: 元江 于 2005-08-18 12:50:29

送交者: 摘星子 2005年8月17日19:10:05 于 [教育与学术]http://www.bbsla...</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/posts/recommend-proofs-from-the-book.html">&#38142;&#25509;</a> | <a href="http://zhiqiang.org/blog/posts/recommend-proofs-from-the-book.html#comments">5 &#26465;&#35780;&#35770;</a></p>]]></content:encoded>
			<wfw:commentRss>http://zhiqiang.org/blog/posts/recommend-proofs-from-the-book.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Windows游戏中的NP完全问题</title>
		<link>http://zhiqiang.org/blog/posts/most-windows-game-are-np-complete.html</link>
		<comments>http://zhiqiang.org/blog/posts/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/posts/minesweeper-is-np-complete.html">扫雷是NP完全问题</a><br/>本科时有同学扫雷最快可以在60多秒完成高级难度，让我这种最快130秒的人非常惭愧，当时就想着编一个全自动的扫雷程序，不过一直也没写。今天才...</li><li><a href="http://zhiqiang.org/blog/posts/15-puzzle.html">15 puzzle</a><br/>注：此游戏很有名，有同学问我其算法，我在网上找了一下，居然没多少中文资料，这里按照以前看过的一份答案回忆整理贴出。 游戏规则很简单，4*4...</li><li><a href="http://zhiqiang.org/blog/posts/np-hard.html">TCS：NP-hard</a><br/>好久没有写我的理论计算机初步系列了，其实复杂性这一块，虽然平时经常遇到，但由于问题都过于本质和困难，想这方面问题的时间反而不多。Ko教...</li><li><a href="http://zhiqiang.org/blog/posts/theoritical-analysis-marfia-game.html">杀人的理论分析</a><br/>“杀人”，英文名为"Mafia Game"，广泛流传于国内外。上个星期我们在玩的时候被Elchanan Mossel发现，然后他给了一个talk，内容就是杀人的理论分析。

...</li><li><a href="http://zhiqiang.org/blog/posts/strategy-games-doctors-and-patients-i.html">策略游戏：医生和病人（I）</a><br/>我很早之前就想过这个问题，但一直只知道一个trivial的答案。前两天无意中发现网上已经有高手给出了更好的方案，故记录在此。有兴趣的可以自己想...</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/posts/most-windows-game-are-np-complete.html">&#38142;&#25509;</a> | <a href="http://zhiqiang.org/blog/posts/most-windows-game-are-np-complete.html#comments">1&#26465;&#35780;&#35770;</a></p>]]></content:encoded>
			<wfw:commentRss>http://zhiqiang.org/blog/posts/most-windows-game-are-np-complete.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>扫雷是NP完全问题</title>
		<link>http://zhiqiang.org/blog/posts/minesweeper-is-np-complete.html</link>
		<comments>http://zhiqiang.org/blog/posts/minesweeper-is-np-complete.html#comments</comments>
		<pubDate>Wed, 11 Jun 2008 14:38:21 +0000</pubDate>
		<dc:creator>zhiqiang</dc:creator>
		
		<category><![CDATA[计算机科学]]></category>

		<category><![CDATA[NP hard]]></category>

		<category><![CDATA[扫雷]]></category>

		<guid isPermaLink="false">http://zhiqiang.org/blog/?p=797</guid>
		<description><![CDATA[本科时有同学扫雷最快可以在60多秒完成高级难度，让我这种最快130秒的人非常惭愧，当时就想着编一个全自动的扫雷程序，不过一直也没写。今天才知道，原来扫雷问题是NP完全的...
结果于2000年发表在Mathematical Intelligencer上，论文题目是Minesweeper is NP-complete，这里有作者的简单的问题和证明介绍。证明方法是证明扫雷问题可以编码任何逻辑电路，包括NP-hard的3SAT问题。作者还...]]></description>
			<content:encoded><![CDATA[<p>本科时有同学扫雷最快可以在60多秒完成高级难度，让我这种最快130秒的人非常惭愧，当时就想着编一个全自动的扫雷程序，不过一直也没写。今天才知道，原来扫雷问题是<a href="http://zhiqiang.org/blog/posts/np-hard.html" target="_blank">NP完全的</a>...</p>
<p>结果于2000年发表在<em>Mathematical Intelligencer</em>上，论文题目是Minesweeper is NP-complete，这里有<a href="http://web.mat.bham.ac.uk/R.W.Kaye/minesw/ordmsw.htm" target="_blank">作者的简单的问题和证明介绍</a>。证明方法是证明扫雷问题可以编码任何逻辑电路，包括NP-hard的3SAT问题。作者还有一个<a href="http://web.mat.bham.ac.uk/R.W.Kaye/minesw/ASE2003.pdf" target="_blank">非常直观的PPT</a>演示证明过程，比如下图展示如何编码AND逻辑门：<img src="http://zhiqiang.org/blog/wp-content/cache/tex_e3cb701ac0ea4b7279633cec474ae96b.png" style="vertical-align:middle; padding-bottom:2px;" class="tex" alt="t=u\wedge v" /></p>
<p align="center"><img src="http://lh4.ggpht.com/mathzqy/SE_idBu0a5I/AAAAAAAAC4g/1-YdNAowPg8/20080611223237750.jpg?imgmax=576"/> </p>
<p>它是NP完全问题说明如果程序要想完全正确，所费的时间最坏情况下将是指数的。不过我猜测对于大部分的扫雷的实例还是很容易的，而且NPC所用的规约实例特别大，所以编一个能较快速度解决大部分windows自带的那个高级难度的扫雷问题还是可行的，不知道是否已经有这方面的程序。</p>
<div><h2>相关文章</h2><ul><li><a href="http://zhiqiang.org/blog/posts/most-windows-game-are-np-complete.html">Windows游戏中的NP完全问题</a><br/>上篇文章扫雷是NP完全问题之后，You Xu提到＂不光扫雷是NP 完全问题，空当接龙问题也极有可能是一个NP完全问题。目前最好的通用 planner只能解半副牌...</li><li><a href="http://zhiqiang.org/blog/posts/np-hard.html">TCS：NP-hard</a><br/>好久没有写我的理论计算机初步系列了，其实复杂性这一块，虽然平时经常遇到，但由于问题都过于本质和困难，想这方面问题的时间反而不多。Ko教...</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/posts/minesweeper-is-np-complete.html">&#38142;&#25509;</a> | <a href="http://zhiqiang.org/blog/posts/minesweeper-is-np-complete.html#comments">15 &#26465;&#35780;&#35770;</a></p>]]></content:encoded>
			<wfw:commentRss>http://zhiqiang.org/blog/posts/minesweeper-is-np-complete.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>有序矩阵的中位数算法</title>
		<link>http://zhiqiang.org/blog/posts/median-algorithm-of-ordered-matrix.html</link>
		<comments>http://zhiqiang.org/blog/posts/median-algorithm-of-ordered-matrix.html#comments</comments>
		<pubDate>Mon, 09 Jun 2008 03:23:03 +0000</pubDate>
		<dc:creator>zhiqiang</dc:creator>
		
		<category><![CDATA[计算机科学]]></category>

		<category><![CDATA[中位数]]></category>

		<category><![CDATA[矩阵]]></category>

		<category><![CDATA[算法]]></category>

		<guid isPermaLink="false">http://zhiqiang.org/blog/posts/median-algorithm-of-ordered-matrix.html</guid>
		<description><![CDATA[给定的实数矩阵，每行和每列都是递增的，求这个数的中位数。
使用类似Tarjan的线性中位数的方法，每次找每列中位数，然后找中位数的中位数，之后可以删除前一半列的上半部分或者后一半列的下半部分，这样可以实现复杂性。
但是这个问题是有的算法的，在Top Language Google Group的Obtuse Sword的指点下，找到了这个问题的原始论文：Generalized Selection and Ranking: Sorted Matrices。事...]]></description>
			<content:encoded><![CDATA[<p>给定<img src="http://zhiqiang.org/blog/wp-content/cache/tex_607acaa73c762411b20745149a11e90b.png" style="vertical-align:middle; padding-bottom:2px;" class="tex" alt="n\times n" />的实数矩阵，每行和每列都是递增的，求这<img src="http://zhiqiang.org/blog/wp-content/cache/tex_6595d679e306a127a3fe53268bcaddb2.png" style="vertical-align:middle; padding-bottom:1px;" class="tex" alt="n^2" />个数的中位数。</p>
<p>使用类似Tarjan的线性中位数的方法，每次找每列中位数，然后找中位数的中位数，之后可以删除前一半列的上半部分或者后一半列的下半部分，这样可以实现复杂性<img src="http://zhiqiang.org/blog/wp-content/cache/tex_f7abf0190aa2a37a63aff83e6af0da07.png" style="vertical-align:middle; " class="tex" alt="O(n\log^2n)" />。</p>
<p>但是这个问题是有<img src="http://zhiqiang.org/blog/wp-content/cache/tex_7ba55e7c64a9405a0b39a1107e90ca94.png" style="vertical-align:middle; " class="tex" alt="O(n)" />的算法的，在<a href="http://groups.google.com/group/pongba" target="_blank">Top Language Google Group</a>的<a href="http://groups.google.com/group/pongba/msg/c2e0e047c127c2b7" target="_blank">Obtuse Sword的指点</a>下，找到了这个问题的原始论文：<a href="http://scitation.aip.org/getabs/servlet/GetabsServlet?prog=normal&amp;id=SMJCAT000013000001000014000001&amp;idtype=cvips&amp;gifs=yes" target="_blank">Generalized Selection and Ranking: Sorted Matrices</a>。事实上这篇论文证明了更强的结论：</p>
<blockquote><p>对于一个<img src="http://zhiqiang.org/blog/wp-content/cache/tex_252d3754c0db62a55b9e25c870a524a5.png" style="vertical-align:middle; padding-bottom:2px;" class="tex" alt="n\times m" />(<img src="http://zhiqiang.org/blog/wp-content/cache/tex_a9c6d1101125bbf3954a5821e556cced.png" style="vertical-align:middle; padding-bottom:1px;" class="tex" alt="n\leq m" />)的矩阵，若每行和每列都是递增的，则可以在<img src="http://zhiqiang.org/blog/wp-content/cache/tex_2a5a84e2d2b3faed163740163b33fb7b.png" style="vertical-align:middle; " class="tex" alt="O(n\log2m/n)" />找到第<img src="http://zhiqiang.org/blog/wp-content/cache/tex_8ce4b16b22b58894aa86c421e8759df3.png" style="vertical-align:middle; padding-bottom:1px;" class="tex" alt="k" />大的数。</p>
</blockquote>
<p>算法的基本思路是将矩阵依次对半划分成更小的子矩阵，然后删除不可能包含所求中位数的子矩阵。通过对每次划分后子矩阵个数的估计，发现此算法时间复杂度为<img src="http://zhiqiang.org/blog/wp-content/cache/tex_2a5a84e2d2b3faed163740163b33fb7b.png" style="vertical-align:middle; " class="tex" alt="O(n\log2m/n)" />。</p>
<p>使用同样的技巧，可以证明更更强的结论(这个算法具体过程就没细看了):</p>
<blockquote><p>一堆<img src="http://zhiqiang.org/blog/wp-content/cache/tex_677228ad87e3811d7e2772f3b3897674.png" style="vertical-align:middle; padding-bottom:2px;" class="tex" alt="n_i\times m_i" />(<img src="http://zhiqiang.org/blog/wp-content/cache/tex_29e47411160e0bc1091c57173a55b0d3.png" style="vertical-align:middle; padding-bottom:1px;" class="tex" alt="n_i\leq m_i" />)的矩阵，若每个矩阵的每行和每列都是递增的，则selection problem（即找第<img src="http://zhiqiang.org/blog/wp-content/cache/tex_8ce4b16b22b58894aa86c421e8759df3.png" style="vertical-align:middle; padding-bottom:1px;" class="tex" alt="k" />大的数）的时间复杂度为<img src="http://zhiqiang.org/blog/wp-content/cache/tex_12294fa07ca565682ae047f236a83874.png" style="vertical-align:middle; " class="tex" alt="O(\sum n_i\log2m_i/n_i)" />。</p>
</blockquote>
<div><h2>相关文章</h2><ul><li><a href="http://zhiqiang.org/blog/posts/download-encyclopedia-of-algorithm.html">算法百科全书 - Encyclopedia of Algorithms</a><br/>Xie Xie推荐了一本今年出版的一本新书，Encyclopedia of Algorithms，全书1200页，涵盖各类有名问题的算法，概率算法，近似算法，量子算法等。 翻了一下，...</li><li><a href="http://zhiqiang.org/blog/posts/another-perfect-shuffle-algorithm.html">Perfect Shuffle的算法</a><br/>珍爱生命，远离政治。我们继续讨论算法。 2008/04/01补充：此算法有重大缺陷。详情请见留言部分。 一年前，我们讨论过一个算法问题，perfect shuffle，...</li><li><a href="http://zhiqiang.org/blog/posts/complexity-of-prime-sieve.html">素数筛法的复杂度</a><br/>Xie Xie给我看了一个链接性能调优--永远超乎想象，里面提到了素数筛法的复杂度，作者用实验发现此筛法是线形的。 所谓素数筛法就是那个求小于n的...</li><li><a href="http://zhiqiang.org/blog/posts/programs-depend-on-date-struct-not-algorithm.html">编程的核心是数据结构，而不是算法</a><br/>Rob Pike, 最伟大的 C 语言大师之一 , 在Notes on C Programming(英文原文)中从另一个稍微不同的角度表述了 Unix 的哲学:   你无法断定程序会在什么地方耗费运...</li><li><a href="http://zhiqiang.org/blog/posts/graph-isomorphism-is-polynomial.html">图同构问题属于P？</a><br/>更新：证明的关键一步发现错误，作者更新了论文，结论甚至论文标题都改了（废话），新版本On the graph isomorphism problem。  提交论文到arxiv不需要审阅...</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/posts/median-algorithm-of-ordered-matrix.html">&#38142;&#25509;</a> | <a href="http://zhiqiang.org/blog/posts/median-algorithm-of-ordered-matrix.html#comments">3 &#26465;&#35780;&#35770;</a></p>]]></content:encoded>
			<wfw:commentRss>http://zhiqiang.org/blog/posts/median-algorithm-of-ordered-matrix.html/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
