版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、,An Introductionto Computer Science,计算机科学引论,XIANG, Hui 向辉Shandong University,2,Chapter 12: Theory of Computation,12.1 Functions and Their Computation 12.2 Turing Machines 12.3 Universal Programming Languages 12.4 A Noncomputable Function 12.5 Complexity of Problems 12.6 Public-Key Cryptography,3,Fun
2、ctions,Function: A correspondence between a collection of possible input values and a collection of possible output values so that each possible input is assigned a single output,4,Functions (continued),Computing a function: Determining the output value associated with a given set of input values No
3、ncomputable function: A function that cannot be computed by any algorithm,5,Figure 12.1 An attempt to display the function that converts measurements in yards into meters,6,Figure 12.2 The components of a Turing machine,7,Turing Machine Operation,Inputs at each step State Value at current tape posit
4、ion Actions at each step Write a value at current tape position Move read/write head Change state,8,Figure 12.3 A Turing machine for incrementing a value,9,Church-Turing Thesis,The functions that are computable by a Turing machine are exactly the functions that can be computed by any algorithmic mea
5、ns.,10,Universal Programming Language,A language with which a solution to any computable function can be expressed Examples: “Bare Bones” and most popular programming languages,11,The Bare Bones Language,Bare Bones is a simple, yet universal language. Statements clear name; incr name; decr name; whi
6、le name not 0 do; end;,12,Figure 12.4 A Bare Bones program for computing X x Y,13,Figure 12.5 A Bare Bones implementation of the instruction “copy Today to Tomorrow”,14,The Halting Problem,Given the encoded version of any program, return 1 if the program is self-terminating, or 0 if the program is n
7、ot.,15,Figure 12.6 Testing a program for self-termination,16,Figure 12.7 Proving the unsolvability of the halting program,17,Complexity of Problems,Time Complexity: The number of instruction executions required Unless otherwise noted, “complexity” means “time complexity.” A problem is in class O(f(n
8、) if it can be solved by an algorithm in Q(f(n). A problem is in class Q(f(n) if the best algorithm to solve it is in class Q(f(n).,18,Figure 12.8 A procedure MergeLists for merging two lists,19,Figure 12.9 The merge sort algorithm implemented as a procedure MergeSort,20,Figure 12.10 The hierarchy o
9、f problems generated by the merge sort algorithm,21,Figure 12.11 Graphs of the mathematical expressions n, lg n, n lg n, and n2,22,P versus NP,Class P: All problems in any class Q(f(n), where f(n) is a polynomial Class NP: All problems that can be solved by a nondeterministic algorithm in polynomial
10、 time Nondeterministic algorithm = an “algorithm” whose steps may not be uniquely and completely determined by the process state Whether the class NP is bigger than class P is currently unknown.,23,Figure 12.12 A graphic summation of the problem classification,24,Public-Key Cryptography,Key: A value
11、 used to encrypt or decrypt a message Public key: Used to encrypt messages Private key: Used to decrypt messages RSA: A popular public key cryptographic algorithm Relies on the (presumed) intractability of the problem of factoring large numbers,25,Encrypting the Message 10111,Encrypting keys: n = 91 and e = 5 10111two = 23ten 23e = 235 = 6,436,343 6,436,343 91 has a remainder of 4 4ten = 100two Therefore, encrypted version of 10111 is 100.,26,Decrypting the Message 100,Decrypting keys: d = 29, n = 91 100two = 4ten 4d = 429 = 288,230,376,151,711,744 288,230,376,151,711,744 91 ha
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 别墅建筑设计
- 高中化学选择性必修一课时作业8
- 礼服毕业设计
- 急诊科:创伤患者处理流程培训
- 妇科子宫内膜异位症手术后护理流程
- 室内设计毕设模板
- 青光眼预防监测培训措施
- 市场方案设计
- 服装设计毕业作品开发全流程
- 情绪内稳态科普
- 2026年北京市石景山区初三二模物理试卷(含答案)
- 2026年山东省核事故应急管理中心公开招聘人员(2名)笔试备考题库及答案解析
- 2026年六安霍山县顺通巴士有限公司招聘3名考试备考题库及答案解析
- 相信自己从容赴考课件-高三(7)班临门一脚主题班会
- 2026年医师定期考核考前冲刺模拟题库附完整答案详解【典优】
- 2025-2026苏教版三年级数学下册第五单元长方形和正方形综合测试卷(含答案)
- 雨课堂学堂在线学堂云《现代农业创新与乡村振兴战略(扬州)》单元测试考核答案
- 苏教版三年级科学下册全册教案(2026年)
- 重庆市事业单位2026招聘公共基础知识高频考点题库含易错解析
- AutoCAD 2016基础与应用案例教程
- 2026年绿色工厂数字化能碳管理平台建设方案
评论
0/150
提交评论