The Big Picture Chapter 3. A decision problem is simply a problem for which the answer is yes or no (True or False). A decision procedure answers a decision.

Slides:



Advertisements
Similar presentations
NP-Completeness.
Advertisements

Complexity Classes: P and NP
NP-Hard Nattee Niparnan.
Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
The Big Picture Chapter 3. We want to examine a given computational problem and see how difficult it is. Then we need to compare problems Problems appear.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
Recap CS605: The Mathematics and Theory of Computer Science.
Complexity 11-1 Complexity Andrei Bulatov Space Complexity.
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
1 Lecture 4 Topics –Problem solving Subroutine Theme –REC language class The class of solvable problems Closure properties.
1 Lecture 4: Formal Definition of Solvability Analysis of decision problems –Two types of inputs:yes inputs and no inputs –Language recognition problem.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Definition of complexity class NP –Nondeterministic computation –Problems.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
The Theory of NP-Completeness
1 Lecture 2 Topics –Importance of this material Fundamental Limitations –Connecting Problems and Languages Problems –Search, function and decision problems.
NP-complete and NP-hard problems
Analysis of Algorithms CS 477/677
Chapter 11: Limitations of Algorithmic Power
MA/CSSE 474 Theory of Computation
Final Exam Review Cummulative Chapters 0, 1, 2, 3, 4, 5 and 7.
Introduction Chapter 0. Three Central Areas 1.Automata 2.Computability 3.Complexity.
CMPS 3223 Theory of Computation Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Review Byron Gao. Overview Theory of computation: central areas: Automata, Computability, Complexity Computability: Is the problem solvable? –solvable.
1 CSSE 350 Automata, Formal Languages, and Computability.
The Complexity of Optimization Problems. Summary -Complexity of algorithms and problems -Complexity classes: P and NP -Reducibility -Karp reducibility.
CMPF144 FUNDAMENTALS OF COMPUTING THEORY Module 5: Classical Logic.
CSC 413/513: Intro to Algorithms NP Completeness.
MA/CSSE 474 Theory of Computation Functions on Languages, Decision Problems (if time) Logic: Some harder parts.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
MA/CSSE 474 Theory of Computation Enumerability Reduction.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
MA/CSSE 474 Theory of Computation Decision Problems DFSMs.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
Computability Heap exercise. The class P. The class NP. Verifiers. Homework: Review RELPRIME proof. Find examples of problems in NP.
Complexity & Computability. Limitations of computer science  Major reasons useful calculations cannot be done:  execution time of program is too long.
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
Languages and Strings Chapter 2.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
The Big Picture Chapter 3.
CS 461 – Oct. 28 TM applications –Recognize a language √ –Arithmetic √ –Enumerate a set –Encode a data structure or problem to solve Two kinds of TMs –Decider:
Algorithms and Decision Procedures for Regular Languages Chapter 9.
Turing Machines Sections 17.6 – The Universal Turing Machine Problem: All our machines so far are hardwired. ENIAC
Computability Examples. Reducibility. NP completeness. Homework: Find other examples of NP complete problems.
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.
Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
1 Chapter Pushdown Automata. 2 Section 12.2 Pushdown Automata A pushdown automaton (PDA) is a finite automaton with a stack that has stack operations.
MA/CSSE 474 Theory of Computation Languages, prefixes, sets, cardinality, functions.
Costas Busch - RPI1 Decidability. Costas Busch - RPI2 Consider problems with answer YES or NO Examples: Does Machine have three states ? Is string a binary.
The Church-Turing Thesis Chapter Are We Done? FSM  PDA  Turing machine Is this the end of the line? There are still problems we cannot solve:
Turing Machines- Cont. Theory of Computation Lecture 11 Tasneem Ghnaimat.
MA/CSSE 474 Theory of Computation Universal Turing Machine Church-Turing Thesis (Winter 2016, these slides were also used for Day 33)
Universal Turing Machine
Week 14 - Friday.  What did we talk about last time?  Simplifying FSAs  Quotient automata.
MA/CSSE 474 Theory of Computation Decision Problems, Continued DFSMs.
Computability. Turing Machines Read input letter & tape letter, write tape letter, move left or right.
MA/CSSE 474 Theory of Computation Universal Turing Machine Church-Turing Thesis Delayed due dates for HWs See updated schedule page. No class meeting.
Modeling Arithmetic, Computation, and Languages Mathematical Structures for Computer Science Chapter 8 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesTuring.
MA/CSSE 474 Theory of Computation Functions on Languages, Decision Problems (if time) Logic: Some harder parts.
Chapter 10 NP-Complete Problems.
MA/CSSE 474 Decision Problems Languages, Machines, Computation
Turing Machines Chapter 17.
The Definition of Algorithm
Quiz questions referenced here are on the Day 3 quiz
RAJALAKSHMI ENGINEERING COLLEGE
NP-Complete Problems.
MA/CSSE 474 Theory of Computation Computation FSM Intro.
Presentation transcript:

The Big Picture Chapter 3

A decision problem is simply a problem for which the answer is yes or no (True or False). A decision procedure answers a decision problem. Examples: Given an integer n, does n have a pair of consecutive integers as factors? The language recognition problem: Given a language L and a string w, is w in L? Our focus Decision Problems

The Power of Encoding Everything is a string. Problems that don’t look like decision problems can be recast into new problems that do look like that.

The Power of Encoding Pattern matching on the web: Problem: Given a search string w and a web document d, do they match? In other words, should a search engine, on input w, consider returning d? The language to be decided: { : d is a candidate match for the query w}

The Power of Encoding Does a program always halt? Problem: Given a program p, written in some some standard programming language, is p guaranteed to halt on all inputs? The language to be decided: HP ALL = {p : p halts on all inputs}

What If We’re Not Working with Strings? Anything can be encoded as a string. is the string encoding of X. is the string encoding of the pair X, Y.

Primality Testing Problem: Given a nonnegative integer n, is it prime? An instance of the problem: Is 9 prime? To encode the problem we need a way to encode each instance: We encode each nonnegative integer as a binary string. The language to be decided: PRIMES = {w : w is the binary encoding of a prime number}.

Problem: Given an undirected graph G, is it connected? Instance of the problem: Encoding of the problem: Let V be a set of binary numbers, one for each vertex in G. Then we construct  G  as follows: Write |V| as a binary number, Write a list of edges, Separate all such binary numbers by “/”. 101/1/10/10/11/1/100/10/101 The language to be decided: CONNECTED = {w  {0, 1, /}* : w = n 1 /n 2 /…n i, where each n i is a binary string and w encodes a connected graph, as described above}. The Power of Encoding

Protein sequence alignment: Problem: Given a protein fragment f and a complete protein molecule p, could f be a fragment from p? Encoding of the problem: Represent each protein molecule or fragment as a sequence of amino acid residues. Assign a letter to each of the 20 possible amino acids. So a protein fragment might be represented as AGHTYWDNR. The language to be decided: { : f could be a fragment from p}. The Power of Encoding

Casting multiplication as decision: Problem: Given two nonnegative integers, compute their product. Encoding of the problem: Transform computing into verification. The language to be decided: L = {w of the form: x =, where: is any well formed integer, and integer 3 = integer 1  integer 2 } 12x9=108 12=12 12x8=108 Turning Problems Into Decision Problems

Casting sorting as decision: Problem: Given a list of integers, sort it. Encoding of the problem: Transform the sorting problem into one of examining a pair of lists. The language to be decided: L ={w 1 # w 2 :  n  1 (w 1 is of the form, w 2 is of the form, and w 2 contains the same objects as w 1 and w 2 is sorted)} Examples: 1,5,3,9,6#1,3,5,6,9  L 1,5,3,9,6#1,2,3,4,5,6,7  L Turning Problems Into Decision Problems

Casting database querying as decision: Problem: Given a database and a query, execute the query. Encoding of the problem: Transform the query execution problem into evaluating a reply for correctness. The language to be decided: L = {d # q # a: d is an encoding of a database, q is a string representing a query, and a is the correct result of applying q to d} Example: (name, age, phone), (John, 23, ) (Mary, 24, )#(select name age=23)# (John)  L Turning Problems Into Decision Problems

By equivalent we mean that either problem can be reduced to the other. If we have a machine to solve one, we can use it to build a machine to do the other using just the starting machine and other functions that can be built using a machine of equal or lesser power. The Traditional Problems and their Language Formulations are Equivalent

Consider the multiplication example: L ={w of the form: x =, where: is any well formed integer, and integer 3 = integer 1  integer 2 } Given a multiplication machine, we can build the language recognition machine: Given the language recognition machine, we can build a multiplication machine: An Example

Consider the multiplication example: L ={w of the form: x =, where: is any well formed integer, and integer 3 = integer 1  integer 2 } Given a multiplication machine P, we can build the language recognition machine T: An Example Y/N P T product x =

Consider the multiplication example: L ={w of the form: x =, where: is any well formed integer, and integer 3 = integer 1  integer 2 } Given the language recognition machine T, we can build a multiplication machine P: An Example integer 3 T P Y/N integer 1 integer 2

Languages and Machines

Finite State Machines An FSM to accept a * b *: An FSM to accept A n B n = { a n b n : n  0}

Pushdown Automata A PDA to accept A n B n = { a n b n : n  0} Example: aaabb Stack:

Another Example Bal, the language of balanced parentheses

Trying Another PDA A PDA to accept strings of the form: A n B n C n = { a n b n c n : n  0}

Turing Machines A Turing Machine to accept A n B n C n :

Turing Machines A Turing machine to accept the language: {p: p is a Java program that halts on input 0}

Rule of Least Power: “Use the least powerful language suitable for expressing information, constraints or programs on the World Wide Web.” Languages and Machines

Grammars, Languages, and Machines Language Grammar Machine L Accepts

A Tractability Hierarchy P NP PSPACE P  NP  PSPACE