The Big Picture Chapter 3.

Slides:



Advertisements
Similar presentations
NP-Completeness.
Advertisements

Complexity Classes: P and NP
NP-Hard Nattee Niparnan.
CS 345: Chapter 9 Algorithmic Universality and Its Robustness
Lecture 19. Reduction: More Undecidable problems
Lecture 24 MAS 714 Hartmut Klauck
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.
Programming Languages Wrap-up. Your Toolkit Object-oriented Imperative Functional Logic.
January 5, 2015CS21 Lecture 11 CS21 Decidability and Tractability Lecture 1 January 5, 2015.
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.
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
1 Lecture 4: Formal Definition of Solvability Analysis of decision problems –Two types of inputs:yes inputs and no inputs –Language recognition problem.
Fall 2004COMP 3351 The Chomsky Hierarchy. Fall 2004COMP 3352 Non-recursively enumerable Recursively-enumerable Recursive Context-sensitive Context-free.
1 Lecture 2 Topics –Importance of this material Fundamental Limitations –Connecting Problems and Languages Problems –Search, function and decision problems.
Analysis of Algorithms CS 477/677
Linear Bounded Automata LBAs
Chapter 11: Limitations of Algorithmic Power
Turing Machines CS 105: Introduction to Computer Science.
MA/CSSE 474 Theory of Computation
Cs3102: Theory of Computation Class 18: Proving Undecidability Spring 2010 University of Virginia David Evans.
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.
Complexity 2-1 Problems and Languages Complexity Andrei Bulatov.
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.
Lecture 1 Computation and Languages CS311 Fall 2012.
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.
Turing Machines Chapter 17. Languages and Machines SD D Context-Free Languages Regular Languages reg exps FSMs cfgs PDAs unrestricted grammars Turing.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
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.
Computability and Complexity 2-1 Problems and Languages Computability and Complexity Andrei Bulatov.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
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:
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.
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
Undecidability and The Halting Problem
Computability Examples. Reducibility. NP completeness. Homework: Find other examples of NP complete problems.
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.
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 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
Turing Machines Chapter 17.
MA/CSSE 474 Theory of Computation Computation FSM Intro.
Presentation transcript:

The Big Picture Chapter 3

Decision Problems 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

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: {<w, d> : 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: HPALL = {p : p halts on all inputs}

What If We’re Not Working with Strings? Anything can be encoded as a string. <X> is the string encoding of X. <X, Y> 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}.

The Power of Encoding • Problem: Given an undirected graph G, is it connected? • Instance of the problem: 1 2 3 4 5 • 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 = n1/n2/…ni, where each ni 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, p> : f could be a fragment from p}.

Turning Problems Into Decision Problems 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: <integer1>x<integer2>=<integer3>, where: <integern> is any well formed integer, and integer3 = integer1  integer2} 12x9=108  12=12 X 12x8=108 X

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 = {w1 # w2: n1 (w1 is of the form <int1, int2, … intn>, w2 is of the form <int1, int2, … intn>, and w2 contains the same objects as w1 and w2 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

The Traditional Problems and their Language Formulations are Equivalent 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 first machine and other functions that can be built using a machine of equal or lesser power.

An Example Consider the multiplication example: L = {w of the form: <integer1>x<integer2>=<integer3>, where: <integern> is any well formed integer, and integer3 = integer1  integer2} Given a multiplication machine, we can build the language recognition machine: Given the language recognition machine, we can build a multiplication machine:

Languages and Machines Semi-Decidable

Finite State Machines An FSM to accept a*b*: An FSM to accept AnBn = {anbn : n  0} CANNOT BE DONE!

Pushdown Automata A PDA to accept AnBn = {anbn : n  0} Example: aaabb Stack:

Another Example Bal, the language of balanced parentheses

Trying Another PDA A PDA to accept strings of the form: AnBnCn = {anbncn : n  0} CANNOT BE DONE

Turing Machines A Turing Machine to accept AnBnCn: Accepts Decidable Languages

Turing Machines A Turing machine to accept the language: {p: p is a Java program that halts on input 0} Semidecidable: simulation halts or goes into infinite loop.

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

Grammars, Languages, and Machines Accepts Machine

A Tractability Hierarchy P NP PSPACE P  NP  PSPACE