<?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%a8%a1%e5%9e%8b/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/computer-science/preliminary-computer-theory-algorithms-and-calculation-model.html</link>
		<comments>http://zhiqiang.org/blog/science/computer-science/preliminary-computer-theory-algorithms-and-calculation-model.html#comments</comments>
		<pubDate>Wed, 16 Aug 2006 01:27:26 +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/390.html</guid>
		<description><![CDATA[博客 » 计算机科学 » 模型，理论计算机，算法，算法模型初步 » 下面是wikipedia上算法的定义： 算法是指完成一个任务所需要的具体步骤和方法。也就是说给定初始状态或输入数据，经过计算机程序的有限次运算，能够得出所要求或期望的终止状态或输出数据。 算法常常含有重复的步骤和一些比较或逻辑判断。如果一个算法有缺陷，或不适合于某个问题，执行这个算法将不...]]></description>
			<content:encoded><![CDATA[<p id="breadcrumb" class="breadcrumb"><a href="http://zhiqiang.org/blog/">博客</a> » <a href="http://zhiqiang.org/blog/category/science/computer-science">计算机科学</a> » <a href="http://zhiqiang.org/blog/tag/%e6%a8%a1%e5%9e%8b" 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" 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/%e7%ae%97%e6%b3%95%e6%a8%a1%e5%9e%8b%e5%88%9d%e6%ad%a5" rel="tag">算法模型初步</a> » </p><p dir="ltr">下面是wikipedia上<a href="http://zh.wikipedia.org/wiki/算法" target="_blank">算法的定义</a>：</p>
<blockquote dir="ltr" style="margin-right: 0px"><p>算法是指完成一个任务所需要的具体步骤和方法。也就是说给定初始状态或输入数据，经过<font color="#ff0000">计算机程序</font>的有限次运算，能够得出所要求或期望的终止状态或输出数据。</p>
<p>算法常常含有重复的步骤和一些比较或逻辑判断。如果一个算法有缺陷，或不适合于某个问题，执行这个算法将不会解决这个问题。不同的算法可能用不同的时间、空间或效率来完成同样的任务。一个算法的优劣可以用空间复杂度与时间复杂度来衡量。</p></blockquote>
<p dir="ltr" align="left">一个简单而且耳熟能详的算法的例子是求最大公约数的<strong>辗转相除法</strong>：给出两个数，要求出他们俩的最大公约数。在小学的时候，我们就知道这样做就行了：将大数除以小数，用所得余数替换大数，继续用这两个数中大者除以小者，用所得余数替换较大者，继续下去，直到所得余数为0，此时除数即为所求的最大公约数。下面是一个实例：(15, 21) = (15, 6) = (3, 6) = (3, 0) = 3。又如，要判断某个数是否为质数，只需枚举所有比它小的数，检验是否其约数即可。</p>
<p dir="ltr" align="left">算法是理论计算机的灵魂。几乎所有问题都围绕它而来。为了讨论算法的性质，在理论计算机中，算法已不限于只是上面定义中的计算机程序。或者说，这里计算机的含义被大大扩广了。</p>
<p dir="ltr" align="left">我们平时所说和所使用的计算机，基于图灵提出的<strong>确定型图灵机</strong>模型。它是最好理解的：给出固定的程式，模型按照程式和输入完全<font color="#ff0000">确定性</font>地运行。</p>
<p dir="ltr" align="left">但为了理解算法和这种确定型图灵机的能力，人们又发展了许多其它各式各样的图灵机模型。其中最为有名的是<strong>非确定型图灵机</strong>。这种计算模型，它在进行计算的时候，会自动选择最优路径进行计算。通俗地说，它<font color="#ff0000">有预测能力</font>。比如说，为了说明某个数是合数，非确定型图灵机会猜测一个数，恰好是其因子，从而证明了它不是质数。</p>
<p dir="ltr" align="left">确定型和非确定型图灵机的计算性能所引起的<strong>P vs NP</strong>问题，一直是理论计算机科学的核心问题，这点下面专文论述。</p>
<p dir="ltr" align="left">另一个引起广泛关注的计算机模型是<strong>量子计算机模型</strong>。与上面的非确定型图灵机只存在于人们的想象中不同，量子计算机在物理上是可以实现的。关于量子计算理论，以后也有单独的介绍性文章。</p>
<p dir="ltr" align="left">虽然上面的各种计算模型的效率可能不同，比如非确定性图灵机判定一个数是合数便要快得多，但是它们的计算能力是完全一样的。也就是在某个计算模型上面运行的算法，可以被其余模型模拟实现。</p>
<p dir="ltr" align="left">这些计算模型的计算能力是一样的，那是不是世界上所有问题都有算法呢？看上去这似乎是一个哲学问题，但答案早就有了，有些问题是不可能能通过算法求解的，连下面这个看上去很简单的问题都不行：给出一些分数（指12/23，18/9这样的），问是否可以从中选出若干个分数数（可以重复选取），使得按一定顺序排起来，其分母连起来和分子连起来恰好一样？</p>
<div><h4>相关文章</h4><ul><li class='currentpost'><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/introduction-communication-complexity.html">通讯复杂性简单介绍</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/another-perfect-shuffle-algorithm.html">Perfect Shuffle的算法</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><li ><a href="http://zhiqiang.org/blog/science/computer-science/how-google-search-similar-images.html">图片搜索的原理</a></li><li ><a href="http://zhiqiang.org/blog/science/computer-science/max-drawdown-algorithm.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>, 2006. | <a href="http://zhiqiang.org/blog/science/computer-science/preliminary-computer-theory-algorithms-and-calculation-model.html">&#38142;&#25509;</a> | <a href="http://zhiqiang.org/blog/science/computer-science/preliminary-computer-theory-algorithms-and-calculation-model.html#comments">15 &#26465;&#35780;&#35770;</a></p>]]></content:encoded>
			<wfw:commentRss>http://zhiqiang.org/blog/science/computer-science/preliminary-computer-theory-algorithms-and-calculation-model.html/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

