Chapter 11 Theory of Computation. © 2005 Pearson Addison-Wesley. All rights reserved 11-2 Chapter 11: Theory of Computation 11.1 Functions and Their Computation.

Slides:



Advertisements
Similar presentations
Copyright © 2012 Pearson Education, Inc. Chapter 12: Theory of Computation Computer Science: An Overview Eleventh Edition by J. Glenn Brookshear.
Advertisements

CS 345: Chapter 9 Algorithmic Universality and Its Robustness
JAYASRI JETTI CHINMAYA KRISHNA SURYADEVARA
Class 39: Universality cs1120 Fall 2009 David Evans University of Virginia.
Programming Languages Wrap-up. Your Toolkit Object-oriented Imperative Functional Logic.
Computability & Complexity. Scenario I can’t write this program because I’m too dumb.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 11: Structure and Union Types Problem Solving & Program Design.
Algorithms Sipser 3.3 (pages ). CS 311 Mount Holyoke College 2 Computability Hilbert's Tenth Problem: Find “a process according to which it can.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
Recursively Enumerable and Recursive Languages
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
1 Other Models of Computation. 2 Models of computation: Turing Machines Recursive Functions Post Systems Rewriting Systems.
CS1001 Lecture 23. Overview Incompleteness and the Halting Problem Incompleteness and the Halting Problem Methods in Artificial Intelligence Methods in.
Foundations of (Theoretical) Computer Science
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 5 Reducibility Contents Undecidable Problems from Language Theory.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 1 Overview of Computers and Programming. Copyright ©2004 Pearson Addison-Wesley. All rights reserved.1-2 Figure 1.3 Components of a Computer.
Theory of Computation. Computation Computation is a general term for any type of information processing that can be represented as an algorithm precisely.
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
Definition: Let M be a deterministic Turing Machine that halts on all inputs. Space Complexity of M is the function f:N  N, where f(n) is the maximum.
More Theory of Computing
By: Er. Sukhwinder kaur.  Computation Computation  Algorithm Algorithm  Objectives Objectives  What do we study in Theory of Computation ? What do.
Remaining Topics Decidability Concept 4.1 The Halting Problem 4.2
Introduction to the Theory of Computation
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
The Complexity of Primality Testing. What is Primality Testing? Testing whether an integer is prime or not. – An integer p is prime if the only integers.
Unsolvability and Infeasibility. Computability (Solvable) A problem is computable if it is possible to write a computer program to solve it. Can all problems.
CSCI 2670 Introduction to Theory of Computing November 29, 2005.
1 Theory: Models of Computation  Readings:  Chapter 11 & Chapter 3.6 of [SG]  Content:  What is a Model  Model of Computation  Model of a Computing.
©Brooks/Cole, 2003 Chapter 17 Theory of Computation.
©Brooks/Cole, 2003 Chapter 17 Theory of Computation.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
Complexity & Computability. Limitations of computer science  Major reasons useful calculations cannot be done:  execution time of program is too long.
Computer Theory Michael J. Watts
Capabilities of computing systems Numeric and symbolic Computations A look at Computability theory Turing Machines.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Computer Science: An Overview Eleventh Edition by J. Glenn Brookshear Chapter.
Chapter 15 P, NP, and Cook’s Theorem. 2 Computability Theory n Establishes whether decision problems are (only) theoretically decidable, i.e., decides.
Fundamentals of Informatics Lecture 12 The Halting Problem Bas Luttik.
Recursively Enumerable and Recursive Languages
Chapter 11 Theory of Computation © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 17: Limitations of Computing Chapter 17 Limitations of Computing Page 196 What problems cannot be solved on a computer? What problems cannot be.
 2004 SDU 1 Algorithm Informally speaking, an algorithm is a collection of simple instructions for carrying out a task. Example:  Elementary arithmetic.
Chapter 12 Theory of Computation Introduction to CS 1 st Semester, 2014 Sanghyun Park.
Theory of Computation Foundations of Computer Science  Cengage Learning.
1 P and NP. 2 Introduction The Traveling Salesperson problem and thousands of other problems are equally hard in the sense that if we had an efficient.
Theory of Computational Complexity Yuji Ishikawa Avis lab. M1.
Recall last lecture and Nondeterministic TMs Ola Svensson.
Chapter 9 Turing Machines What would happen if we change the stack in Pushdown Automata into some other storage device? Truing Machines, which maintains.
Turing Machines CS 130 Theory of Computation HMU Textbook: Chap 8.
Theory of Computational Complexity TA : Junichi Teruyama Iwama lab. D3
1 Recursively Enumerable and Recursive Languages.
Modeling Arithmetic, Computation, and Languages Mathematical Structures for Computer Science Chapter 8 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesTuring.
Chapter 12: Theory of Computation
Chapter 12: Theory of Computation
Chapter 11 Theory of Computation © 2007 Pearson Addison-Wesley.
can be solved on a computer in a reasonable time, using a reasonable
CSE 105 theory of computation
Ch. 11 Theory of Computation
Chapter 9 TURING MACHINES.
Chapter 12: Theory of Computation
CLASSES P AND NP.
Recall last lecture and Nondeterministic TMs
4-9问题的形式化描述.
Chapter 17 Theory of Computation.
Presentation transcript:

Chapter 11 Theory of Computation

© 2005 Pearson Addison-Wesley. All rights reserved 11-2 Chapter 11: Theory of Computation 11.1 Functions and Their Computation 11.2 Turing Machines 11.3 Universal Programming Languages 11.4 A Noncomputable Function 11.5 Complexity of Problems 11.6 Public Key Cryptography

© 2005 Pearson Addison-Wesley. All rights reserved 11-3 Functions Function = the 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 –Computing a function = determining the output value associated with a given set of input values –Noncomputable function = a function that cannot be computed by any algorithm

© 2005 Pearson Addison-Wesley. All rights reserved 11-4 Figure 11.1 An attempt to display the function that converts measurements in yards into meters

© 2005 Pearson Addison-Wesley. All rights reserved 11-5 Figure 11.2 The components of a Turing machine

© 2005 Pearson Addison-Wesley. All rights reserved 11-6 Turing machine operation Inputs at each step –State –Value at current tape position Actions at each step –Write a value at current tape position –Move read/write head –Change state

© 2005 Pearson Addison-Wesley. All rights reserved 11-7 Figure 11.3 A Turing machine for incrementing a value

© 2005 Pearson Addison-Wesley. All rights reserved 11-8 Universal programming language Church-Turing thesis: A Turing machine can compute any computable function. –Restatement: any computable function is Turing computable –Not proven, but generally accepted Universal programming language = a language that can express a program to compute any computable function –Examples: “Bare Bones” and most popular programming languages

© 2005 Pearson Addison-Wesley. All rights reserved 11-9 The Bare Bones language Bare Bones is a simple, yet universal language. Statements –clear name; –incr name; –decr name; –while name not 0 do; … end ;

© 2005 Pearson Addison-Wesley. All rights reserved Figure 11.4 A Bare Bones program for computing X x Y

© 2005 Pearson Addison-Wesley. All rights reserved Figure 11.5 A Bare Bones implementation of the instruction “copy Today to Tomorrow”

© 2005 Pearson Addison-Wesley. All rights reserved The halting problem Given the encoded version of any program, return 1 if the program will eventually halt, or 0 if the program will run forever.

© 2005 Pearson Addison-Wesley. All rights reserved Figure 11.6 Testing a program for self-termination

© 2005 Pearson Addison-Wesley. All rights reserved Figure 11.7 Proving the unsolvability of the halting program

© 2005 Pearson Addison-Wesley. All rights reserved Complexity of problems Time complexity = number of instruction executions required –Unless otherwise noted, “complexity” means “time complexity.” A problem is in class O(f(n)) if it can be solved by an algorithm in  (f(n)). A problem is in class  (f(n)) if the best algorithm to solve it is in class  (f(n)).

© 2005 Pearson Addison-Wesley. All rights reserved Figure 11.8 A procedure MergeLists for merging two lists

© 2005 Pearson Addison-Wesley. All rights reserved Figure 11.9 The merge sort algorithm implemented as a procedure MergeSort

© 2005 Pearson Addison-Wesley. All rights reserved Figure The hierarchy of problems generated by the merge sort algorithm

© 2005 Pearson Addison-Wesley. All rights reserved Figure Graphs of the mathematical expression n, lg, n, n lg n, and n 2

© 2005 Pearson Addison-Wesley. All rights reserved Class P Class P = all problems in any class  (f(n)), where f(n) is a polynomial Intractable = all problems too complex to be solved practically –Most computer scientists consider all problems not in class P to be intractable.

© 2005 Pearson Addison-Wesley. All rights reserved Class NP Class NP = all problems that can be solved by a nondeterministic algorithm in class P –Nondeterministic algorithm = an “algorithm” whose steps may not be uniquely and completely determined by the process state May require “creativity” Whether the class NP is bigger than class P is currently unknown.

© 2005 Pearson Addison-Wesley. All rights reserved Figure A graphic summation of the problem classification

© 2005 Pearson Addison-Wesley. All rights reserved Public key cryptography Key = specially generated set of values used for encryption –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

© 2005 Pearson Addison-Wesley. All rights reserved Encrypting the message Encrypting keys: n = 91 and e = two = 23 ten 23 e = 23 5 = 6,436,343 6,436,343 ÷ 91 has a remainder of 4 4 ten = 100 two Therefore, encrypted version of is 100.

© 2005 Pearson Addison-Wesley. All rights reserved Decrypting the message 100 Decrypting keys: d = 29, n = two = 4 ten 4 d = 4 29 = 288,230,376,151,711, ,230,376,151,711,744 ÷ 91 has a remainder of ten = two Therefore, decrypted version of 100 is

© 2005 Pearson Addison-Wesley. All rights reserved Figure Public key cryptography

© 2005 Pearson Addison-Wesley. All rights reserved Figure Establishing a RSA public key encryption system