不可计算理论.doc_第1页
不可计算理论.doc_第2页
不可计算理论.doc_第3页
不可计算理论.doc_第4页
不可计算理论.doc_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

精品文档不可计算理论 计算机有着强大的计算能力,那是不是当计算机的计算能力达到极高水平时就可以解决所有问题呢?要回答这个问题,首先我们得明确计算机所能做的事计算。什么是计算呢?直观地看,计算一般是指运用事先规定的规则,将一组数值变换为另一(所需的)数值的过程。对某一类问题,如果能找到一组确定的规则,按这组规则,当给出这类问题中的任一具体问题后,就可以完全机械地在有限步内求出结果,则说这类问题是可计算的。这种规则就是算法,这类可计算问题也可称之为存在算法的问题。这就是直观上的能行可计算或算法可计算的概念。在20世纪以前,人们普遍认为,所有的问题类都是有算法的,人们的计算研究就是找出算法来。但是20世纪初,人们发现有许多问题已经过长期研究,却仍然找不到算法。于是人们开始怀疑,是否对这些问题来说,根本就不存在算法,即它们是不可计算的。这种不存在性当然需要证明,这时人们才发现,无论对算法还是对可计算性,都没有精确的定义!按前述对直观的可计算性的陈述,根本无法作出不存在算法的证明,因为“完全机械地”指什么?“确定的规则”又指什么?仍然是不明确的。 解决问题的需要促使人们不断作出探索。1934年,哥德尔提出了一般递归函数的概念,并指出:凡算法可计算函数都是一般递归函数,反之亦然。同年,丘奇证明了他提出的可定义函数与一般递归函数是等价的,并提出算法可计算函数等同于一般递归函数或可定义函数,这就是著名的“丘奇论点”。用一般递归函数虽给出了可计算函数的严格数学定义,但在具体的计算过程中,就某一步运算而言,选用什么初始函数和基本运算仍有不确定性。为消除所有的不确定性,图灵在他的“论可计算数及其在判定问题中的应用”一文中从一个全新的角度定义了可计算函数。他全面分析了人的计算过程,把计算归结为最简单、最基本、最确定的操作动作,从而用一种简单的方法来描述那种直观上具有机械性的基本计算程序,使任何机械(能行)的程序都可以归约为这些动作。这种简单的方法是以一个抽象自动机概念为基础的,其结果是:算法可计算函数就是这种自动机能计算的函数。这不仅给计算下了一个完全确定的定义,而且第一次把计算和自动机联系起来,对后世产生了巨大的影响,这种“自动机”后来被人们称为“图灵机”。图灵机有一条无限长的纸带,纸带被分成若干小方格方格内可以是一个符号,也可以是空白,除此之外还有一个有限状态控制器。纸带起着存储器的作用,控制器上的读写头可以在带上左右移动,而读写头可以根据当前状态和看到的方格内的符号,采取下列三种行动之一:左移一格,右移一格,或者静止不动,具体采取哪一种行动应根据该图灵机的控制规则。或者可以从另一个角度来理解,由于读写头每次只对应一个小方格且它本身具有一定的状态,比如接受,拒绝或进入循环。当其进入接受或者拒绝状态时,就会发生停机(停机问题),即读写头不再操作,不会再产生新的格局;如果其一直处于循环状态,将一直产生新的格局。针对读写头的两种状态,可以看出:有一类图灵机,它们对任何输入都会停机(要么接受,要么拒绝)。这类图灵机又被称为判定器,被判定器识别的语言叫做可判定语言。那么,是否存在一个不可判定语言(不存在一个图灵机可以判定该语言)呢?答案是肯定的,并不是所有的语言都可以被判定。下面简短的证明一下。假设一个语言A = (,) | 是表示图灵机M的字符串,是一个字符串。M接受。即语言A中的字符串都有两部分组成:第一部分是一个图灵机M的字符串表示;第二部分是一个字符串,且M接受。假设语言A是可判定的,也就是存在一个判定器H。当M接受时,H接受(,);当M不接受时,H拒绝(,)。 (注意H是一个判定器,它总会停机,接受或拒绝(,))。那么我们对H稍加改造,将它的结果取一下反:当M接受时,H拒绝 (,);当M不接受时,H接受(,)。这很容易,只要把H的接收状态和拒绝状态互换一下身份即可。但是若把H自己的序列化字符串提供给H会发生什么?可以看出,当H接受时,H拒绝;当H不接受时,H接受。在此导出了矛盾,从而唯一的结论只能是,假设的H是不可能存在的。对于这种不可判定的语言,是无法构造出一个图灵机来接受或拒绝该字符串的。一个不可判定的语言,就是一个不可计算的问题,不可计算问题就是超出了计算能力的问题,不能被任何有步骤的,确定性的算法所能解决的问题。在如上图灵机的例子中我们可以把有限状态读写头看作是机器的程序执行代码,而存储带上存的只是被处理的数据。图灵在描述他的另一个机器模型通用机器时还提出了可以把有限状态指令也存放在存储带上,让读写头根据读入的指令进行下一步操作。可以证明这样存储有指令的通用图灵机能够实现任何一个图灵机,也就是说可以解决任意一个图灵可计算问题。现在我们广泛使用的计算机的确就是采用了存储指令这一原理因而可以解决“万能”计算问题的。具体实现方法是:对于需要解决的问题用软件编制程序,再把程序和数据都存放在同一个存储器(内存)里,由中央处理器(CPU)根据指令对数据进行操作。这样的机器也叫做“存储程序计算机”。在为第一台存储程序计算机研发计划做顾问时,约翰冯诺伊曼写了一个草案报告描述了这种带有中央处理器、内存、I/O、总线的存储程序计算机。因此可以说我们今天使用的存储程序计算机就是图灵机理论的实现。 图灵机的概念有十分独特的意义:如果把图灵机的内部状态解释为指令,用字母表的字来表示,与输出字输入字同样存贮在机器里,那就成为电子计算机了。由此开创了“自动机”这一学科分支,促进了电子计算机的研制工作。图灵机模型帮助我们了解了计算机的工作,因而我们能说“计算机并不能解决所有问题”,例如停机问题。我们也可以构造出其他不可判定的问题,这些问题是计算机不能解决的,也就是说有不可能存在的程序Programs That Never ExistIts clear and explicit that various programs which can do many things in our daily life. They do everything based on clear, explicit and valid instructions that has been given to them by the programmers in advance to deal with different circumstances.But, can computer do everything that is explicit and clear? The answer is NO.SIMPLE FACTSWe are attempting to prove that the answer is NO, which is absolute, starting from some obvious facts that is beyond doubt.1. Computers always do things based on the instructions given.2. All programs has to obey logical rules, or they will never really exist.3. Proof by contradiction is valid. That is, if A is true lead to the fact that B is also true, and we know exactly B cannot be true, we can conclude that A is false.4. Computer programs can accept any type of input if that is within the range of the ability given, even the programs themselves.EXAMPLE1 “AlwaysYes.exe”Before giving the first typical example, a kind of boring programs should be mentioned first. They are called YES-NO programs, that is, they accept all kinds of input, and can judge whether the input follows the rules, with the only two kinds of output: “YES” & “NO”. If an unexpected input cannot be judged, the output will be “NO” again.For example, one program (Suppose it is called “isPhoto.exe”) (Suffix “.exe” is used here just to represent it is an executable program, which is taken from Microsoft Windows) is meant to tell whether the input is a photo (Photos should end with “.png”, .or “.jpg”, etc. In that case, if “1.png” is the input, the program will give the output “YES”, and “a.exe” will result in “NO”. Another example is “isFileNameLengthPositive.exe”, which return whether the length of the name is positive (greater than zero), which is always TRUE. So, exactly we will always get the output “YES” whatever we use as input.So, we are attempting to create a program that is used to detect whether a program is always giving “YES” under any circumstances. We can call it “AlwaysYes.exe”. That is, meaningful input of the program has to be programs, otherwise, youll only get a “NO”. If one program is always giving “YES” as the output (like the “isFileNameLengthPositive.exe” mentioned above), then “AlwaysYes.exe” will give the output “YES”, otherwise, “NO”.So, we are going to prove, this kind of program cannot be created. We can use the method, proof with contradiction to prove that, this kind of program never exist, which seems incredible.Suppose we can REALLY make out such a program. In that case, we are capable of doing an easier thing, that is, we can make out a program, namely “YesOnSelf.exe”. The new program only do such things: check whether the output of the input program (the program to be tested) is “YES” if the input of the input program is the input program itself. For instance, if we take “isPhoto.exe” as the input of “YesOnSelf.exe”, the output will be “NO”, since “isPhoto.exe” is not a photo and it will result in the fact that the output of “isPhoto.exe” is “NO”, and result in the fact that the output of “YesOnSelf.exe” is “NO”. We can see clearly that “YesOnSelf.exe” can do only a little part of what “AlwaysYes.exe” can do.So, here comes the big problem. What will happen if we run “YesOnSelf.exe” on itself?Luckily, we only have two probable answers, so we can consider each one in turn. If the output is “YES”, we know that (according to the denition of “YesOnSelf.exe”), “YesOnSelf.exe” should output “YES” when run on itself. But what if the output of “YesOnSelf.exe” when run on itself happened to be “NO”? Well, it would mean that (again, according to the denition of “YesOnSelf.exe”) “YesOnSelf.exe” should output “NO” when run on itself. Again, this statement is perfectly consistent. It seems like “YesOnSelf.exe” can actually choose what its output should be. This is not practical when dealing with programs, since we cannot figure out what computers are going to do.What is more interesting is that we can create a program named “AntiYesOnSelf.exe”, which gives the contradictory answer of “YesOnSelf.exe”. When an input causes “YesOnSelf.exe” to give an output “YES”, it gives “NO”.And, the problem comes. What will happen if we run “AntiYesOnSelf.exe” on itself?Luckily again, we only have two answers to discuss. If the output is “YES”, it means when it runs on itself, the output should be “NO”, because “YesOnSelf.exe” should give “NO”. This makes no sense. On the other hand, if it gives “NO” as the output, the output should be “YES” according to “YesOnSelf.exe”.Anyway, the program can never exist logically. Let us see through the process. First we suppose that “AlwaysYes.exe” exists and in that case, “YesOnSelf.exe” exists, which means “AntiYesOnSelf.exe” exists. Now, we can conclude “AlwaysYes.exe” never exists.EXAMPLE2 “CanCrash.exe”Sometimes we come across some unsatisfying circumstances that a program that we are running can crash during the process. Maybe we are always trying to find a way to detect whether a program can automatically crash. We can just call it “CanCrash.exe”, which gives “YES” when the input is an executable program and can crash by itself. Now we can use the same method to prove that this kind of program does not exist.Suppose we have REALLY made such kind of program and compiled it into an executable program, and it can do exactly what we need it to do. Then we can easily make up such a program “CanCrashWeird.exe” as can crash based on the input whenever “CanCrash.exe” gives “YES”. Furthermore, we can create a program “CrashOnSelf.exe”, which do exactly as follows:When the input can crash, the new program crash, too.On other circumstances, it gives “NO”Similarly we can find that when we run the new program on itself, well get involved in a logical jam. Think of the outcomes. If it REALLY crashes, then it should crash due to the definition. If it DOES NOT crash, then it should give “NO”, and that is what it does. It looks like that the answer is perfectly persistent on any circumstance. However, similarly to example 1, we can create the program “AntiCrashOnSelf.exe”, which do the opposite due to “CrashOnSelf.exe”. In that case, we can similarly conclude this kind of program never exists, and, “CanCrash.exe” never exists.SIMILAR INTERESTING THINGS IN LOGICAL FIELDIn logics, there are some strange propositions that we can claim them neither true nor false. For example, here comes proposition “The proposition itself is false.” The proposition is neither true nor false. We can make assumptions to see clearly what it is. If it IS true, then it should be false according to itself. If it IS false, then the proposition is displaying the true fact, and it should be true. So it is neither true nor falseactually we cannot tell whether it has the attribute of being true or false. This kind of proposition is called “paradox”, which is a mysterious part of logics.CONCLUSION & MOREWe can now come to the conclusion that some kind of program REALLY DOES NOT exist, even it is as easy as “AlwaysYes.exe” or as simple and useful as “CanCrash.exe”. We have to say we can exactly tell whether human beings logical system is complete.In that case, we have to think about more questions about our computers and ourselves.1. How can we deal with the possibility of programs crashing and shutting down if these problems are unpredictable?2. What is the influence of these unpredictable problems on the

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论