Theory of Computation and Formal Languages

Slides:



Advertisements
Similar presentations
Turing Machines January 2003 Part 2:. 2 TM Recap We have seen how an abstract TM can be built to implement any computable algorithm TM has components:
Advertisements

CS 345: Chapter 9 Algorithmic Universality and Its Robustness
8/25/2009 Sofya Raskhodnikova Intro to Theory of Computation L ECTURE 1 Theory of Computation Course information Overview of the area Finite Automata Sofya.
CS 461 – Nov. 9 Chomsky hierarchy of language classes –Review –Let’s find a language outside the TM world! –Hints: languages and TM are countable, but.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
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.
NP-Completeness Lecture for CS 302. Traveling Salesperson Problem You have to visit n cities You want to make the shortest trip How could you do this?
Recap CS605: The Mathematics and Theory of Computer Science.
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
January 5, 2015CS21 Lecture 11 CS21 Decidability and Tractability Lecture 1 January 5, 2015.
CS21 Decidability and Tractability
Computability and Complexity 5-1 Classifying Problems Computability and Complexity Andrei Bulatov.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
Introduction to Computability Theory
1 Introduction to Computability Theory Lecture13: Mapping Reductions Prof. Amos Israeli.
CS 302: Discrete Math II A Review. An alphabet Σ is a finite set (e.g., Σ = {0,1}) A string over Σ is a finite-length sequence of elements of Σ For x.
The Theory of NP-Completeness
C SC 473 Automata, Grammars & Languages Automata, Grammars and Languages Discourse 01 Introduction.
Chapter 11: Limitations of Algorithmic Power
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Turing Machines CS 105: Introduction to Computer Science.
CS21 Decidability and Tractability
Grammars, Languages and Finite-state automata Languages are described by grammars We need an algorithm that takes as input grammar sentence And gives a.
Final Exam Review Cummulative Chapters 0, 1, 2, 3, 4, 5 and 7.
Chapter 11 Limitations of Algorithm Power. Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples:
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.
CMPS 3223 Theory of Computation Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided.
Theory of Computing Lecture 15 MAS 714 Hartmut Klauck.
Review Byron Gao. Overview Theory of computation: central areas: Automata, Computability, Complexity Computability: Is the problem solvable? –solvable.
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
Pushdown Automata (PDAs)
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
Computability Construct TMs. Decidability. Preview: next class: diagonalization and Halting theorem.
Theory of Computation, NTUEE Theory of Computation Lecture 04 Undecidability Part of the materials are from Courtesy of Prof. Peter J. Downey Department.
Umans Complexity Theory Lectures Lecture 1a: Problems and Languages.
Theory of Computation In theoretical computer science and mathematics, the theory of computation is the branch that deals with how efficiently problems.
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)
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Complexity & Computability. Limitations of computer science  Major reasons useful calculations cannot be done:  execution time of program is too long.
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.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Computer Science: An Overview Eleventh Edition by J. Glenn Brookshear Chapter.
Computability Review homework. Video. Variations. Definitions. Enumerators. Hilbert's Problem. Algorithms. Summary Homework: Give formal definition of.
NP-Completeness  For convenience, the theory of NP - Completeness is designed for decision problems (i.e. whose solution is either yes or no).  Abstractly,
CSCI 2670 Introduction to Theory of Computing October 13, 2005.
CS623: Introduction to Computing with Neural Nets (lecture-7) Pushpak Bhattacharyya Computer Science and Engineering Department IIT Bombay.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
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.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong Decidable.
CS 154 Formal Languages and Computability May 12 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
Computability. Turing Machines Read input letter & tape letter, write tape letter, move left or right.
Theory of Computation. Introduction to The Course Lectures: Room ( Sun. & Tue.: 8 am – 9:30 am) Instructor: Dr. Ayman Srour (Ph.D. in Computer Science).
 2005 SDU Lecture14 Mapping Reducibility, Complexity.
Chapter 12: Theory of Computation
Busch Complexity Lectures: Reductions
Automata, Grammars and Languages
Introduction to Automata Theory
Summary.
Jaya Krishna, M.Tech, Assistant Professor
CS21 Decidability and Tractability
Decidability and Tractability
CS151 Complexity Theory Lecture 1 April 2, 2019.
Sub: Theoretical Foundations of Computer Sciences
Theoretical Foundations of Computer Sciences
Presentation transcript:

Theory of Computation and Formal Languages CSC 573 Theory of Computation 4/17/2017 Theory of Computation and Formal Languages Part of the materials are from Courtesy of Prof. Peter J. Downey Department of Computer Science, University of Arizona Theory of Computation, NTUEE

Theory of Computation Lecture 01 Introduction Theory of Computation, NTUEE

Theory of Computation: areas CSC 573 Theory of Computation Theory of Computation: areas 4/17/2017 Formal Language Theory language = set of sentences (strings) grammar = rules for generating strings production/deduction systems capabilities & limitations application: programming language specification Automata Theory (Abstract Machines) models for the computing process with various resources characterize ``computable” application: parsing algorithms Complexity Theory inherent difficulty of problems (upper and lower bounds) time/space resources intractable or unsolvable problems application: algorithm design Theory of Computation, NTUEE

Major Themes Study models for Classify problems machines languages Classify machines by their use of memory grammars and languages by type languages by class hierarchies problems by their use of resources (time, space, …) Develop relationships between models reduce solution of one problem to solution of another simulate one machine by another characterize grammar type by machine recognizer Theory of Computation, NTUEE

Describing Problems Problems described by functions functions assign ouputs to inputs described by tables, formulae, circuits, math logic, algorithms Example: TRAVELLING SALESPERSON Problem Input: n(n-1)/2 distances between n cities Output: order to visit cities that gives shortest tour (or length of tour) Problems described by languages ``yes/no’’ problems or decision problems a language represents a problem or question input strings in the language: answer is ``yes’’; else ``no” Example: HALTING Problem Input: a string w and a Turing Machine M Output: ``yes” if ;``no” otherwise equivalent to asking if string where Theory of Computation, NTUEE

Types of Machines Logic circuit memoryless; values combined using gates c s Circuit size = 5    Circuit depth = 3   x y z Theory of Computation, NTUEE

Types of Machines (cont.) Finite-state automaton (FSA) bounded number of memory states step: input, current state determines next state & output a 1 2 Mod 3 counter state/ouput (Moore) machine a a models programs with a finite number of bounded registers reducible to 0 registers b Theory of Computation, NTUEE

Types of Machines (cont.) Pushdown Automaton (PDA) finite control and a single unbounded stack a, A/AA b, A/ a, $/A$ b, A/ #, $/ models finite program + one unbounded stack of bounded registers top $ b Theory of Computation, NTUEE

Types of Machines (cont.) Pushdown Automaton (PDA) finite control and a single unbounded stack a, A/AA b, A/ a, $/A$ b, A/ #, $/ models finite program + one unbounded stack of bounded registers a a a b b b # A A A A A A A A A $ $ $ $ $ $ $ accepting Theory of Computation, NTUEE

Types of Machines (cont.) Pushdown Automaton (PDA) finite control and a single unbounded stack a, A/AA b, A/ a, $/A$ b, A/ #, $/ models finite program + one unbounded stack of bounded registers a a a b b b b # A A A A ? rejecting A A A A A $ $ $ $ $ $ $ Theory of Computation, NTUEE

Types of Machines (cont.) Pushdown Automaton (PDA) finite control and a single unbounded stack a, A/AA b, A/ a, $/A$ b, A/ #, $/ models finite program + one unbounded stack of bounded registers a a a b b # A A A A rejecting ? A A A A A $ $ $ $ $ $ Theory of Computation, NTUEE

Types of Machines (cont.) Random access machine (RAM) finite program and an unbounded, addressable random access memory of ``registers” models general programs unbounded # of bounded registers Example:   4 3 2 1 b Theory of Computation, NTUEE

Types of Machines (cont.) Turing Machine (TM) finite control & tape of bounded cells unbounded in # to R current state, cell scanned determine next state & overprint symbol control writes over symbol in cell and moves head 1 cell L or R models simple ``sequential’’ memory; no addressability fixed amount of information (b) per cell   b Finite- state control Theory of Computation, NTUEE

How Machines are Used To specify functions or sets Transducer - maps string to string Acceptor - ``recognizes” or ``accepts’’ a set of strings Generator - ``generates” a set of strings M w f(w) M yes w no M accepts strings which cause it to enter a final state M f(w) M generates all values generated during computation Theory of Computation, NTUEE

How Machines are Used The equivalence between acceptor and generator Using an acceptor to implement a generator for wi=w0,w1,w2,w3,…,do wi Acceptor print wi yes no #include “acceptor.h” generator() { for wi=w0,w1,w2,w3,…,do if accept(wi) print(wi); } Theory of Computation, NTUEE

How Machines are Used The equivalence between acceptor and generator Using a generator to implement an acceptor w>wi Generator one wi at at time w=wi return “yes” w<wi return “no” #include “generator.h” acceptor(w) { while (wi=generator)  null, do if w=wi, return “yes”; else if w<wi, return “no”; } Theory of Computation, NTUEE

Types of Language A language is a set of strings over an alphabet Grammars are rules for generating a set of strings Machines can accept languages (sets) Theory of Computation, NTUEE

Types of Language (cont.) Languages can represent complex ``problems” Example: Traveling Salesperson Language (TSL) strings describe instances of TSP having tours of length  k here is one string in TSL when n=4 : 4 2 2 3 2 4 3 1 Why? cities visited in order 1,4,2,3,1  tour distance = 10 3 3 Theory of Computation, NTUEE

Types of Language (cont.) CSC 573 Theory of Computation Types of Language (cont.) 4/17/2017 The equivalence of language recogintion and problem solving An algorithm is known that will accept length n strings in TSL in time exponential in n -- BUT none known for polynomial time TSL is an NP-complete language: NP is an acronym for recognizable in nondeterministic polynomial time NP-complete languages are ``maximally hard” among all in NP the best known recognition algorithms need time exponential in n all NP-complete languages either require exponenital time OR can be done efficiently in poly-time, but we do not (yet) know which! we will use reduction to show that a language is NP-complete; major subject later on Theory of Computation, NTUEE

Languages: Characterize Grammar by Machine Language Grammar Automaton Computably Enumerable type 0 TM (c.e.) or Recursively (unrestricted) (det. or non-det.) Enumerable (r.e.)        Context-Free (CFL) type 2 non-det. PDA A CFG Regular (Reg) type 3 FSA AaB A a (det. or non-det.) right-linear  = strict inclusion “Chomsky Hierarchy” = 2-way conversion algorithm Theory of Computation, NTUEE

Classifying Problems by Resources What is the smallest size circuit (fewest gates) to add two binary numbers? What is the smallest depth circuit for binary addition? (low depth  fast) can a FSA be used to recognize all binary strings with = numbers of 1s & 0s? Must a stronger model be used? How quickly can we determine if strings of length n are in TSL? How much space is needed to decide if boolean formulae of length n are satisfiable? Theory of Computation, NTUEE

Relationships between problems Reduction the most powerful technique available to compare the complexity of two problems reducing the solution of problem A to the solution of problem B  A is no harder than B (written A  B ) The translation procedure should be no harder than the complexity of A. Example: squaring  multiplication: suppose we have an algorithm mult(x,y) that will multiply two integers. Then square(x) = mult(x,x) [trivial reduction] Theory of Computation, NTUEE

Relationships between problems Reduction the most powerful technique available to compare the complexity of two problems reducing the solution of problem A to the solution of problem B  A is no harder than B (written A  B ) The translation procedure should be no harder than the complexity of A. Example: 2-PARTITION  MAKESPAN SCHEDULING 2-PARTITION: Given a set H of natural numbers, is there a subset H’ of H such that a(H-H’) a = aH’a’ ? MAKESPAN SCHEDULING: Given n processor and m tasks with execution time c1, c2, …, cm, find a shortest schedule of executing these m tasks on this n processors. Both problems are NP-complete! Theory of Computation, NTUEE

Relationships between problems Reduction the most powerful technique available to compare the complexity of two problems reducing the solution of problem A to the solution of problem B  A is no harder than B (written A  B ) The translation procedure should be no harder than the complexity of A. Example: matrix-mult  matrix-inversion = invert matrix A,B A*B embed pick Theory of Computation, NTUEE

Obtaining Results Use definitions, theorems and lemmas, with proofs Proofs use construction, induction, reduction, contradiction Construction: design an algorithm for a problem, or to build a machine from a grammar, etc. Induction: a base case and an induction step imply a conclusion about the general case. Main tool for showing algorithms or constructions are correct. Reduction: solve a new problem by using the solution to an old problem + some additional operations or transformations Contradiction: make an assumption, show that an absurd conclusion follows; conclude the negation of the assumption holds (“reductio ad absurdum”) Theory of Computation, NTUEE

CSC 573 Theory of Computation Class of all languages 4/17/2017 Reg   CF CS  L Decidable  Computably Enumerable  Non-Computably Enumerable  Theory of Computation, NTUEE

Summary: Theory of Computation Models of the computing process circuits finite state automata pushdown automata Turing machines capabilities and limitations Notion of ``effectively computable procedure’’ universality of the notion Church’s Thesis what is algorithmically computable Limitations of the algorithmic process unsolvability (undecidability) & reducibility Inherent complexity of computational problems upper and lower bounds: classification by resource use NP-completeness & reducibility Theory of Computation, NTUEE