Machines with Memory Chapter 3 (Part B). Turing Machines  Introduced by Alan Turing in 1936 in his famous paper “On Computable Numbers with an Application.

Slides:



Advertisements
Similar presentations
Complexity Classes: P and NP
Advertisements

JAYASRI JETTI CHINMAYA KRISHNA SURYADEVARA
Cook’s Theorem The Foundation of NP-Completeness.
 2004 SDU Lecture17-P,NP, NPC.  2004 SDU 2 1.Decision problem and language decision problem decision problem and language 2.P and NP Definitions of.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
The Theory of NP-Completeness
Recap CS605: The Mathematics and Theory of Computer Science.
Complexity 25-1 Complexity Andrei Bulatov #P-Completeness.
Complexity 12-1 Complexity Andrei Bulatov Non-Deterministic Space.
Computability and Complexity 14-1 Computability and Complexity Andrei Bulatov Cook’s Theorem.
Advanced Topics in Algorithms and Data Structures
P, NP, PS, and NPS By Muhannad Harrim. Class P P is the complexity class containing decision problems which can be solved by a Deterministic Turing machine.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Definition of complexity class NP –Nondeterministic computation –Problems.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Read sections 7.1 – 7.3 of the book for next time.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
NP-Complete Problems Problems in Computer Science are classified into
Computability and Complexity 20-1 Computability and Complexity Andrei Bulatov Class NL.
NP-complete and NP-hard problems
Analysis of Algorithms CS 477/677
NP-Completeness NP-Completeness Graphs 4/17/2017 4:10 AM x x x x x x x
Computability and Complexity 3-1 Turing Machine Computability and Complexity Andrei Bulatov.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Chapter 11: Limitations of Algorithmic Power
Toward NP-Completeness: Introduction Almost all the algorithms we studies so far were bounded by some polynomial in the size of the input, so we call them.
CSCE350 Algorithms and Data Structure
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Problem Spaces P/NP.
Machines with Memory Chapter 3. Overview  Though every finite computational task can be realized by a circuit, it is not practical – we cannot afford.
Complexity theory and combinatorial optimization Class #2 – 17 th of March …. where we deal with decision problems, finite automata, Turing machines pink.
Review Byron Gao. Overview Theory of computation: central areas: Automata, Computability, Complexity Computability: Is the problem solvable? –solvable.
Lecture 30. P, NP and NP Complete Problems 1. Recap Data compression is a technique to compress the data represented either in text, audio or image form.
The Complexity of Optimization Problems. Summary -Complexity of algorithms and problems -Complexity classes: P and NP -Reducibility -Karp reducibility.
Computational Complexity Theory Lecture 2: Reductions, NP-completeness, Cook-Levin theorem Indian Institute of Science.
Theory of Computing Lecture 17 MAS 714 Hartmut Klauck.
Machines with Memory Chapter 3 (Part A). Overview  Though every finite computational task can be realized by a circuit, it is not practical – we cannot.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
Complexity 25-1 Complexity Andrei Bulatov Counting Problems.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
1. 2 Lecture outline Basic definitions: Basic definitions: P, NP complexity classes P, NP complexity classes the notion of a certificate. the notion of.
Computability Chapter 5. Overview  Turing Machine (TM) considered to be the most general computational model that can be devised (Church-Turing thesis)
NP-Complete Problems Algorithm : Design & Analysis [23]
NP-Completeness (Nondeterministic Polynomial Completeness) Sushanth Sivaram Vallath & Z. Joseph.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
NP-completeness Class of hard problems. Jaruloj ChongstitvatanaNP-complete Problems2 Outline  Introduction  Problems and Languages Turing machines and.
CSE 589 Part V One of the symptoms of an approaching nervous breakdown is the belief that one’s work is terribly important. Bertrand Russell.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Computability NP complete problems. Space complexity. Homework: [Post proposal]. Find PSPACE- Complete problems. Work on presentations.
1 Chapter 10 Intractable Problems Switzerland Lion Monument in Lucerne.
NP-Completeness  For convenience, the theory of NP - Completeness is designed for decision problems (i.e. whose solution is either yes or no).  Abstractly,
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
Chapter 15 P, NP, and Cook’s Theorem. 2 Computability Theory n Establishes whether decision problems are (only) theoretically decidable, i.e., decides.
NP-Completeness Note. Some illustrations are taken from (KT) Kleinberg and Tardos. Algorithm Design (DPV)Dasgupta, Papadimitriou, and Vazirani. Algorithms.
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
NP-complete Languages
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
CS623: Introduction to Computing with Neural Nets (lecture-7) Pushpak Bhattacharyya Computer Science and Engineering Department IIT Bombay.
TU/e Algorithms (2IL15) – Lecture 9 1 NP-Completeness NOT AND OR AND NOT AND.
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
1 8.4 Extensions to the Basic TM Extended TM’s to be studied: Multitape Turing machine Nondeterministic Turing machine The above extensions make no increase.
1 Design and Analysis of Algorithms Yoram Moses Lecture 13 June 17, 2010
Conceptual Foundations © 2008 Pearson Education Australia Lecture slides for this course are based on teaching materials provided/referred by: (1) Statistics.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Intro to Theory of Computation
ICS 353: Design and Analysis of Algorithms
NP-Complete Problems.
Presentation transcript:

Machines with Memory Chapter 3 (Part B)

Turing Machines  Introduced by Alan Turing in 1936 in his famous paper “On Computable Numbers with an Application to the Entscheidungsproblem”  For its simplicity, no other computational model has been invented/devised that surpasses the computational capability of the Turing Machine  Used as the canonical model of computation by most theoreticians in studying computability problems  Used to categorize languages and problems based on the time and space requirements of TMs needed to recognize or solve them

Turing Machines (cont.)

 There are many other “flavors” of Turing Machines (TMs) Multi-tape TMs, multi-head TMs Deterministic and non-deterministic TMs Infinitely long tape in both directions, in only one direction (i.e., leftmost tape cell exists)  Can be shown that most are equivalent in capability  Can show that TMs can simulate RAMs and vice-versa  Universality results TM can simulate any RAM computation RAM programs can simulate TMs RAMs are also universal (in the TM sense)

Turing Machines (cont.)  Important class of languages that TMs recognize: P polynomial- time languages  Equally significant class of languages that NTMs recognize: NP non-deterministic polynomial-time languages

Turing Machines (cont.)  Languages in NP can be verified in a polynomial number of steps: a candidate string can be validated as member of the language in polynomial time  Some problems that are in NP: Traveling Salesperson Problem (TSP) Graph 3-Colorability (3COL) Multiprocessor Scheduling (MSKED) Bin Packing (BNPAK) Crossword Puzzle Construction (CRSCON)  It is not known whether P and NP include exactly the same set of problems, or one (NP) is larger than the other (P)

Universality of the Turing Machine  Show existence of a universal Turing machine in two senses: TM exists that can simulate any RAM computation TM that simulates RAM can simulate any other TM  Proof sketch Describe RAM that simulates a TM Describe TM that simulates a RAM

Universality of the Turing Machine (cont.)  RAM that simulates a TM: TM’s Control Unit is a FSM  there is a RAM program that can simulate this (cf. Theorem 3.4.1) in linear time Need to show that TM’s Tape Unit can be simulated by a FSM  there is RAM program that can simulate this (cf. Theorem 3.4.1) in linear time (from Boolos et al, p. 28) Start

Universality of the Turing Machine (cont.) TM’s Tape Unit assumed to be a b-bit, m-word device Tape Unit FSM simulation encodes the configuration of the Tape Unit with its states: i i+1 i1i1 …… q i,ji,j i : ith Tape Unit cell j  {  } FSM simulation will thus have no more than m  (|  |+1) states = O(m) states

Universality of the Turing Machine (cont.) FSM simulation takes “input” from the TM’s Control Unit in the form of an element of  {  } or L,R, or N Control Unit FSM simulation of TM Tape Unit This “input” determines which edge transition will be taken in the transition diagram that defines the FSM “logic” q i,ji,j q i’,j’

Universality of the Turing Machine (cont.) If “input” is  {  }, then we take the edge q i,ji,j q i’,j’  where i’ = i and j’ =  If “input” is L, then we take the edge q i,ji,j q i’,j’ L where i’ = i  1 and j’ = current content of the i  1st cell

Universality of the Turing Machine (cont.) If “input” is N, then we take the edge q i,ji,j N This FSM can be simulated by a RAM program in linear time (cf. Theorem 3.4.1) If “input” is L, then we take the edge q i,ji,j q i’,j’ L where i’ = i  1 and j’ = current content of the i  1st cell

Universality of the Turing Machine (cont.)  TM that simulates a RAM: RAM’s memory unit can be simulated by the TM’s Tape Unit Leftmost tape cell holds the address of the RAM CPU program counter TM simulates the RAM by emulating the fetch-and-execute cycle

Universality of the Turing Machine (cont.) Fetch step: move to cell whose address is stored in leftmost tape cell Execute step: w n is “decoded” by the TM Control Unit and the corresponding action undertaken; can be any of five types of RAM instruction nn nwnnwn q q’q’ nn q”q” ~n~n nwnnwn :R:R :R:R :N:N

Universality of the Turing Machine (cont.) Sample instruction: multiply two numbers Though meant for unary-represented numbers, shows it can be done Number of steps is a function of the operands and not any other parameter (from Boolos et al, p. 30)

Turing Machine Circuit Simulation  The following result follows from the fact that TMs can be realized by composing FSMs:  This allows us to extend to Turing Machine computable functions the result on size and depth of equivalent circuits that compute their solutions

Computational Inequalities for Turing Machines  Since TMs can only scan O(T) cells in T steps, the result can be expressed as follows:

Definition of P-Complete and NP-Complete Languages L accepter TM L 0 to L converter program w w'w' accepted  w is a problem instance of L 0 (solvable in log-space by a DTM) which is “transformed” by the converter program in log-space to an instance w' of L which is then solvable in log- space by a DTM  w is solvable in log-space using L as a “subprogram”

Definition of P-Complete and NP-Complete Languages (cont.) L accepter TM L 0 to L converter program w w'w' accepted  w is a problem instance of L 0 (solvable in polynomial-time by a NDTM) which is “transformed” by the converter program in polynomial-time to an instance w' of L which is then solvable in polynomial-time by a NDTM  w is solvable in polynomial-time using L as a “subprogram”

Definition of P-Complete and NP-Complete Languages (cont.)  Key to fundamental open problem in theoretical computer science is this theorem  By 1994, well over 10,000 basic NP-complete decision problems were known.

Reductions to P-Complete Languages  Our first P-complete language: CIRCUIT VALUE Instance: A circuit description with fixed values for its input variables and designated output gate. Answer: “Yes” if the output of the circuit has value 1. CIRCUIT : input values output THEOREM The language CIRCUIT VALUE is P-complete. Proof sketch:  “P-hardness” cf. Theorem  “P-ness”  circuits and straight-line programs are equivalent

Reductions to P-Complete Languages (cont.)  Typical proof technique: L is a language in P; L 0 is a P-complete language; L 1 is a candidate P-complete language

Reductions to NP-Complete Languages  Our first NP-complete language: CIRCUIT SAT Instance: A circuit description with input variables {x 1,x 2,…,x n } and designated output gate. Answer: “Yes” if there is an assignment of values to the variables such that the output of the circuit has value 1. CIRCUIT : input variables output THEOREM The language CIRCUIT SAT is NP-complete. Proof sketch:  “NP-hardness” cf. Theorem  “NP-ness”  use Theorem to verify that input produces a 1 output

Reductions to NP-Complete Languages (cont.)  Typical proof technique: L is a language in NP; L 0 is a NP-complete language; L 1 is a candidate NP-complete language polynomial-time reduction by Thm polynomial-time reduction

Reductions to NP-Complete Languages (cont.)  Our second NP-complete language: SATISFIABILITY (SAT) Instance: A set of literals X={x 1,  x 1,x 2,  x 2,…,x n,  x n } and a sequence of clauses C= {c 1,c 2,…,c m } where each clause c i is a subset of X. Answer: “Yes” if there is a (satisfying) assignment of values to the variables {x 1,x 2,…,x n } over the set B such that each clause has at least one literal whose value is 1. THEOREM SATISFIABILITY is NP-complete. Proof sketch:  “NP-ness”  can verify a “guess” in polynomial-time  “NP-hardness”  reduce CIRCUIT SAT to SAT

Reductions to NP-Complete Languages (cont.)  CIRCUIT SAT reduction to SAT key: Any circuit can be described by a straight-line program It suffices to show that straight-line program “statements” can be transformed to equivalent clauses such that the resulting SAT instance produces a “Yes” answer exactly when the straight-line program produces a “Yes” answer for the CIRCUIT SAT instance