CMPS 3223 Theory of Computation Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided.

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 24 MAS 714 Hartmut Klauck
Regular Expressions and DFAs COP 3402 (Summer 2014)
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.
January 5, 2015CS21 Lecture 11 CS21 Decidability and Tractability Lecture 1 January 5, 2015.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
61 Nondeterminism and Nodeterministic Automata. 62 The computational machine models that we learned in the class are deterministic in the sense that the.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
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
Final Exam Review Cummulative Chapters 0, 1, 2, 3, 4, 5 and 7.
1 Introduction to Automata Theory Reading: Chapter 1.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Theory of Computing Lecture 15 MAS 714 Hartmut Klauck.
CMPS 3223 Theory of Computation
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.
1 INFO 2950 Prof. Carla Gomes Module Modeling Computation: Language Recognition Rosen, Chapter 12.4.
Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided by author Slides edited for.
Lecture 1 Computation and Languages CS311 Fall 2012.
CSC 413/513: Intro to Algorithms NP Completeness.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
P, NP, and Exponential Problems Should have had all this in CS 252 – Quick review Many problems have an exponential number of possibilities and we can.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
MA/CSSE 474 Theory of Computation Enumerability Reduction.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
Theory of Computing Lecture 21 MAS 714 Hartmut Klauck.
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.
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.
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
CMPS 3223 Theory of Computation Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided.
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.
LIMITATIONS OF ALGORITHM POWER
Languages and Strings Chapter 2.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Computer Science: An Overview Eleventh Edition by J. Glenn Brookshear Chapter.
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.
The Big Picture Chapter 3.
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.
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:
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.
MA/CSSE 474 Theory of Computation Universal Turing Machine Church-Turing Thesis Delayed due dates for HWs See updated schedule page. No class meeting.
Introduction to Automata Theory
Modeling Arithmetic, Computation, and Languages Mathematical Structures for Computer Science Chapter 8 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesTuring.
Topic 3: Automata Theory 1. OutlineOutline Finite state machine, Regular expressions, DFA, NDFA, and their equivalence, Grammars and Chomsky hierarchy.
Linear Bounded Automata LBAs
MA/CSSE 474 Decision Problems Languages, Machines, Computation
Turing Machines Chapter 17.
Quiz questions referenced here are on the Day 3 quiz
RAJALAKSHMI ENGINEERING COLLEGE
CSCE 411 Design and Analysis of Algorithms
Turing Machines Chapter 17.
How Hard Can It Be?.
CLASSES P AND NP.
NP-Complete Problems.
Presentation transcript:

CMPS 3223 Theory of Computation Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided by author Slides edited for use by MSU Department of Computer Science – R. Halverson 1

The Big Picture: A Language Hierarchy Chapter 3 2

Generator vs. Recognizer Reminder… Given a problem, we can develop a machine (automaton) that Generates solutions, or Recognizes a solution 3

Generator vs. Recognizer Example Given 2 integers A & B, determine the sum. Generator: Write a program to accept A & B as input then compute the sum A+B Recognizer: Write a program to accept A & B & C as input then determine if A+B = C We usually write Generators! But when would an Recognizer be an appropriate solution? 4

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. Example 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 5

Encoding Not the same as “coding”, i.e. writing a computer program!! “Everything is a string” Do you believe that statement? What about computer memory? “Most problems in computing can be converted to a string” How? By a correct encoding. Thus, we can develop a decision solution. Problems that don’t look like decision problems can be recast into new problems that are decision. E.G. A+B=C 6

Notation for Encoding into Strings Almost anything can be encoded as a string. Let X & Y be some type of “object”. What is an “object”? is the string encoding of X. is the string encoding of pair X, Y. If we can define a problem as a language (of strings), we can develop a recognizer. It becomes a decision problem. 7

Example 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} Recognizer vs. Generator? 8

Example of Encoding Does a program always halt? Problem: Given a program p, written in some programming language, is p guaranteed to halt on all inputs? The language to be decided: HP ALL = {p : p halts on all inputs} Classic problem: The Halting Problem. More later! 9

Example of Encoding Testing for prime numbers Problem: Given a nonnegative integer n, is it prime? The language PRIMES = {w : w is the binary encoding of a prime number}. 10

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, each represented by pair of num. corresponding to vertices it connects (first # tells num. of vertices) 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}. Example of Encoding 11

Casting multiplication as decision: Problem: Given two nonnegative integers, compute the product. Encoding : Transform computing into verification. The language: 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 12

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 13 Could we define sorting as a different recognition problem??

Equivalent means either problem can be reduced to (converted to) the other. Given a machine to solve one, a machine to solve the other can be built using the first machine & other functions that can be built using a machine of equal or lesser power. The Traditional Problems & Their Language Formulations are Equivalent 14

Consider the multiplication example: L = {w : x =, where: is a well-formed integer & 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. This is not saying each machine is efficient! An Example 15

One Hierarchy of Languages 16 D=decidable SD = Semidecidable

Chomsky Hierarchy of Languages Languages from “simplest” to “complex” Each is a subset of the ones below Regular Context Free Context Sensitive Recursively Enumerable Can be defined by the type of Machine that will recognize it. 17 Noam Chomsky

Regular Languages A Regular Language is one that can be recognized by a Finite State Machine. An FSM to accept a * b *: 18

Context Free Language A Context Free Language is one that can be recognized by a Push Down Automata. A PDA to accept A n B n = { a n b n : n  0} 19

Decidable & Semidecidable Languages A Decidable Language is one that is recognized by a Turing Machine which halts on all input strings. A Semidecidable Language is one that is recognized by a Turing Machine which halts on all input strings which are in the language, but may loop infinitely on some strings which are not in the language 20

Turing Machines 21 R/W head

Why do we care? Rule of Least Power: Use the least powerful machine for expressing a language. Efficiency – time & space Decidability – other comparisons Clarity – descriptive tools 22

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

Tractability A problem is said to be intractable if the time to solve the problem is exponential P: polynomial NP: non-deterministic polynomial P  NP Open Question: Is P = NP? 24

Chapter 3 Homework Page 34 – Problems 2 & 3 25