Computability and Complexity

Size: px
Start display at page:

Download "Computability and Complexity"

Transcription

1 Computability and Complexity Sequences and Automata CAS 705 Ryszard Janicki Department of Computing and Software McMaster University Hamilton, Ontario, Canada Ryszard Janicki Computability and Complexity 1 / 33

2 Outline Languages and Machines: sets of sequences/languages (nite/innite sequences, closure properties, Nerode equivalence, regular languages, automata, transition systems), dening sets by expressions and equations (regular expressions, x-point theory), machines, computational models and structures (Turing machines, RAM, PRAM, non-standard automata, etc.). Rewriting Systems: Grammars, Post systems, Chomsky hierarchy, Grammars vs automata Ryszard Janicki Computability and Complexity 2 / 33

3 Outline Computability: Functions and sets, Primitive recursive functions and sets, recursive functions and sets, recursively enumerable sets, what does computable and decidable mean (Halting problem), limitation of formal systems (Gödel's theorem), Church thesis. Complexity: denition, independence from a computing platform, time/space hierarchy, P vs NP, NP-completeness, reduction problem. Ryszard Janicki Computability and Complexity 3 / 33

4 Sequences Alphabet: an arbitrary (usually nite) set of elements, often denoted by the symbol Σ. Sequence: an element x = (a 1, a 2,..., a k ) Σ k, where Σ k is a Cartesian product of Σ's. For convenience we write x = a 1 a 2... a k. a function φ : {1,..., k} Σ, such that φ(1) = a 1,..., φ(k) = a k. The two above denitions are in a sense identical since: Σ }. {{.. Σ } {f f : {1,..., k} Σ}. n Frequently a sequence is considered as a primitive undened concept that is understood and does not need any explanation. Ryszard Janicki Computability and Complexity 4 / 33

5 Sequences and strings If the elements of Σ are symbols, then a nite sequence of symbols is often called a string or a word. The length of a sequence x, denoted x, is the number of elements composing the sequence. The empty sequence, ε, is the sequence consisting of zero symbols, i.e. ε = 0. A prex of a sequence is any number of leading symbols of that sequence, and a sux is any number of trailing symbols (any number means `zero included'). Ryszard Janicki Computability and Complexity 5 / 33

6 Concatenation Concatenation (operation) Let x = a 1... a k, y = b 1... b l. Then x y = a 1... a k b 1... b l. We usually write xy instead of x y. Properties of concatenation: 1 x(yz) = (xy)z 2 εx = xε = x Fact. A triple (Σ,, ε) is a monoid. Power operator: x 0 = ε, x 1 = x and x k = x }.{{.. x}. k Recursive denition of power: x 0 = ε x k+1 = x k x. Ryszard Janicki Computability and Complexity 6 / 33

7 Σ and Formal Language Let Σ be a nite alphabet. Then we dene Σ as: Σ = {a 1... a k a i Σ k 0}, i.e. the set of all sequences, including ε, built from the elements of Σ. A (formal) language over Σ is any subset of Σ, including the empty set and Σ. Ryszard Janicki Computability and Complexity 7 / 33

8 Two Important Models of Sequence Monoid 1 Algebra of Strings elements of Σ are symbols, elements of Σ are words or strings, concatenation is just a juxtaposition. 2 Algebra of Relations Ryszard Janicki Computability and Complexity 8 / 33

9 Algebra of Relations Let X be a set and Σ = {R 1,..., R k }, where each R i X X is a relation. Now concatenation corresponds to composition of relations, i.e. x(r S)y t Σ. xrt tsy, and ε is the identity relation, i.e. ε = {(x, x) x X }. Let A = {r 1,..., r n } be the set of names of relations, i.e. name(r i ) = r i, rel(r i ) = R i, where name : Σ A and rel : A Σ. Let extend rel : A Σ to rel : A Σ, where Σ is the set of all relations on X that could be composed from the elements of Σ, plus identity relation, by rel(r i1... r ik ) = rel(r i1 )... rel(r ik ) = R i1... R ik. All properties of the names algebra hold for the relation algebra. Ryszard Janicki Computability and Complexity 9 / 33

10 Automata or State Machines There is a set of states Q. Q may be nite, then we have nite state machines. There is a set of actions/operations that allow to move from one state to another state. There is a transition function/relation that allow movement form one state to another state. The last two statements are equivalent. There is an initial state. There might be nal states. The concept of a current state may easily be introduced. The set of actions/operations maybe innite, but usually is nite. There is a concept of nondeterministic choice. Ryszard Janicki Computability and Complexity 10 / 33

11 Automata or State Machines: an example Ryszard Janicki Computability and Complexity 11 / 33

12 Automata: Non-determinism Ryszard Janicki Computability and Complexity 12 / 33

13 Deterministic Automata: Classical Denition Denition (Automaton - 1) A deterministic (nite) automaton (state machine) is a 5-tuple: M = (Σ, Q, δ, s 0, F ), where: Σ is the alphabet (nite) (input alphabet), Q is the set of states (nite), δ : Q Σ Q is the transition function, s 0 Q is the initial state, F Q is the set of nal states. Denition (ˆδ function) We extend the function δ to ˆδ : Q Σ Q as follows: q Q. ˆδ(q, ε) = q q Q. x Σ. a Σ. ˆδ(q, xa) = δ(ˆδ(q, x), a). Ryszard Janicki Computability and Complexity 13 / 33

14 Language Accepted/Generated by an Automaton Denition (Language - 1) For every automaton M, the set L(M) = {x ˆδ(s 0, x) F } is called the language accepted/generated by M. We will write δ instead of ˆδ if it will not lead to any misunderstanding. Ryszard Janicki Computability and Complexity 14 / 33

15 Deterministic Automata: `Local' Denition Denition (Automaton - 2) A deterministic (nite) automaton (state machine) is a 4-tuple: M = (Σ, Q, s 0, F ), where: Σ is the set of actions, i.e. each a Σ is a function Q is the set of states (nite), s 0 Q is the initial state, F Q is the set of nal states. a : Q Q, The relationship between Denition 1 and Denition 2: δ(s, a) = q a(s) = q. Ryszard Janicki Computability and Complexity 15 / 33

16 Language with Denition 2 We dene Σ as the set of all functions that can be constructed from the elements of Σ and the function composition. For example the sequence x = a 1... a k Σ denes the function x : Q Q, x(s) = a 1... a k (s) = a k (... a 2 (a 1 (s))...). Denition (Language - 2) For every automaton M, the set L(M) = {x x(s 0 ) F } is called the language accepted/generated by M. RULE: s a p δ(s, a) = p a(s) = p. Ryszard Janicki Computability and Complexity 16 / 33

17 Deterministic Automaton: an Example (two versions) Consider the following deterministic automaton In both models: Σ = {a, b}, Q = {s 0, s 1, s 2, s 3 }, F = {s 2, s 3 } and the below table shows both transition function δ (classical model) and actions a(...), b(...) (`local' model). s a(s) b(s) `local' model δ a b classical model s 0 s 1 s 2 s 1 s 3 s 1 s 2 s 1 s 3 s 3 s 2 s 1 Ryszard Janicki Computability and Complexity 17 / 33

18 Problems! (1) We cannot specify: The meaning is pretty simple: rst execute a and next execute any number of b, including none. However, for the rst denition we have δ(s 0, a) = s 1 and δ(s 1, b) = s 1, but what about δ(s 0, b) =? and δ(s 1, a) =?. For the second denition we have a(s 0 ) = s 1 and b(s 1 ) = s 1 but still b(s 0 ) =? and a(s 1 ) =?. UGLY SOLUTION Ryszard Janicki Computability and Complexity 18 / 33

19 Ugly Solution UGLY SOLUTION This solution is good for illustration, problematics for real systems as we have to introduce entities that may not exist in the real system! Ryszard Janicki Computability and Complexity 19 / 33

20 Solutions A solution with Denition 2: for each a Σ, assume that a : Q Q is a partial function. The solution is elegant only on the surface as dealing with partial functions is tricky and often problematic. When Denition 1 is used we have to introduce the concept of Non-determinism. This concept can also be used for Denition 2. Ryszard Janicki Computability and Complexity 20 / 33

21 Non-determinism: Problem #1 Notation for `power set': 2 Q = P(Q) = {X X Q}, and clearly 2 Q. Problem #1: How to model the below situation? Functional solutions: (1) δ(s, a) = {s 1,..., s k }, which implies δ : Q Σ 2 Q, (2) a(s) = {s 1,..., s k }, which implies a Σ. a : Q 2 Q. Relational solutions: (3) (s, a, s i ) δ for i = 1,..., k, = δ Q Σ Q, (4) (s, s i ) a for i = 1,..., k, = a Σ. a Q Q. Solutions (1) and (4) are the most popular. Ryszard Janicki Computability and Complexity 21 / 33

22 Non-determinism: Problem #2 Consider the following automaton: Which is true? ab L(M) or ab / L(M)? Ryszard Janicki Computability and Complexity 22 / 33

23 Non-determinism: Problem #2 Consider the following automaton: Which is true? ab L(M) or ab / L(M)? Usually it is assumed that ab L(M). It is called angelic semantics. Ryszard Janicki Computability and Complexity 22 / 33

24 Non-determinism: Problem #2 Consider the following automaton: Which is true? ab L(M) or ab / L(M)? Usually it is assumed that ab L(M). It is called angelic semantics. Ryszard Janicki Computability and Complexity 22 / 33

25 Angelic vs Demonic Semantics Angelic: At each state an angel will tell you where to go, so if there is a good choice you will make it. The only bad case is when all choices are bad. Demonic: At each state a demon will tell you where to go, so if there is a bad choice you will make it. The only good case is when all choices are good. How does this distinction aects computability and complexity? How does it aect theory of Turing Machines? The `angelic' approach is the classical one, the `demonic' is about 25 years old. Ryszard Janicki Computability and Complexity 23 / 33

26 Angelic vs Demonic Semantics - An Example Consider the three automata below: Let L A (M 1 ), i = 1, 2, 3 denote a language dened by M i under angelic semantics, and let L D (M 1 ), i = 1, 2, 3 denote a language dened by M i under demonic semantics. Note that L A (M 1 ) = L D (M 1 ) =, L A (M 2 ) = {ab}, L D (M 2 ) = and L A (M 3 ) = L D (M 3 ) = {ab}. Ryszard Janicki Computability and Complexity 24 / 33

27 Denition (Non-deterministic Automaton - 1) A non-deterministic (nite) automaton (state machine) is a 5-tuple: M = (Σ, Q, δ, s 0, F ), where: Σ is the alphabet (nite) (input alphabet), Q is the set of states (nite), δ : Q Σ 2 Q is the transition function, s 0 Q is the initial state, F Q is the set of nal states. Denition (non-deterministic ˆδ function) We extend the function δ to ˆδ : Q Σ 2 Q as follows: q Q. ˆδ(q, ε) = {q} q Q. x Σ. a Σ. ˆδ(q, xa) = s ˆδ(q,x) δ(s, a). Sometimes, by a small abuse of notation, we write ˆδ(q, xa) = δ(ˆδ(q, x), a). Ryszard Janicki Computability and Complexity 25 / 33

28 Language Dened by a Non-deterministic Automaton Denition (Angelic semantics) For every automaton M, the set L(M) = {x ˆδ(s 0, x) F } is called the language accepted/generated by M. Denition (Demonic semantics) For every automaton M, the set L(M) = {x ˆδ(s 0, x) F } is called the language accepted/generated by M. We will again write δ instead of ˆδ if it will not lead to any misunderstanding. Ryszard Janicki Computability and Complexity 26 / 33

29 Non-deterministic Automata: `Local' Denition Denition (Non-deterministic Automaton - 2) A non-deterministic (nite) automaton (state machine) is a 4-tuple: M = (Σ, Q, s 0, F ), where: Σ is the set of actions, i.e. each a Σ is a relation Q is the set of states (nite), s 0 Q is the initial state, F Q is the set of nal states. The relationship is the following: a Q Q, q δ(s, a) (s, q) a. Ryszard Janicki Computability and Complexity 27 / 33

30 Here Σ is the set of all relations that can be built form the elements of Σ, i.e. a 1... a k = a 1 a 2... a k, there is the composition of relations given on page 9 of this lecture notes. Denition (Angelic Semantics) For every automaton M, the set L(M) = {x Σ {s (s 0, s) x} F } is called the language accepted/generated by M. Denition (Demonic Semantics) For every automaton M, the set L(M) = {x Σ {s (s 0, s) x} F } is called the language accepted/generated by M. RULE: s a p p δ(s, a) (s, p) a. Ryszard Janicki Computability and Complexity 28 / 33

31 Non-determinism: Example 1 Consider the following example: Classical model: Σ = {a, b}, Q = {s 0, s}, F = {s 1 }. δ(s 0, a) = {s 1 }, δ(s 0, b) =, δ(s 1, a) =, δ(s 1, b) = {s 1 }. `Local' model: Σ = {a, b}, Q = {s 0, s}, F = {s 1 }. a = {(s 0, s 1 )}, b = {(s 1, s 1 )}. Ryszard Janicki Computability and Complexity 29 / 33

32 Non-determinism: Example 2 Consider the following example: Classical model: Σ = {a, b, c}, Q = {q 0, q 1, q 2, q 3 }, F = {q 3 }. δ(q 0, a) = {q 1, q 2 }, δ(q 0, b) = δ(q 0, c) =, δ(q 1, a) = {q 3 }, δ(q 1, b) =, δ(q 1, c) = {q 1 }, δ(q 2, a) = {q 3 }, δ(q 2, b) = {q 2 }, δ(q 2, c) =, δ(q 3, a) = δ(q 3, b) = δ(q 3, c) = `Local' model: Σ = {a, b, c}, Q = {q 0, q 1, q 2, q 3 }, F = {q 3 }. a = {(q 0, q 1 ), (q 0, q 2 ), (q 1, q 3 ), (q 2, q 3 )}, b = {(q 2, q 2 )}, c = {(q 1, q 1 )}. Ryszard Janicki Computability and Complexity 30 / 33

33 Another Approach to Non-determinism Denition An automaton (state machine) is a 5-tuple: M = (Σ, Q, δ, s 0, F ), where: Σ is the alphabet (nite), Q is the set of states (nite), δ : Q Σ 2 Q is the transition function, s 0 Q is the initial state, F Q is the set of nal states. Denition M is deterministic i q Q. a Σ. δ(q, a) 1 M is strictly deterministic i q Q. a Σ. δ(q, a) = 1 Ryszard Janicki Computability and Complexity 31 / 33

34 Transition Systems Transition (from Collins Dictionary): a passing or change from one place, state, condition, etc., to another. Consider the case: s a 1 s 2 a s 3 Can a be called a transition? Transitions, state and labels: Transitions are unique: t 1 s a 1 s 2 Ryszard Janicki Computability and Complexity 32 / 33

35 Petri Nets Transitions are usually needed for modelling concurrency. Consider the following very simple Petri Net: There is a structural dierence between the label a attached to the transition t 1 and the same label a attached to the transition t 3. Ryszard Janicki Computability and Complexity 33 / 33

Computability and Complexity

Computability and Complexity Computability and Complexity Non-determinism, Regular Expressions CAS 705 Ryszard Janicki Department of Computing and Software McMaster University Hamilton, Ontario, Canada janicki@mcmaster.ca Ryszard

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Decidability, Undecidability and Reducibility; Codes, Algorithms and Languages CAS 705 Ryszard Janicki Department of Computing and Software McMaster University Hamilton, Ontario,

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Push-Down Automata CAS 705 Ryszard Janicki Department of Computing and Software McMaster University Hamilton, Ontario, Canada janicki@mcmaster.ca Ryszard Janicki Computability

More information

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministic Finite Automata Not A DFA Does not have exactly one transition from every state on every symbol: Two transitions from q 0 on a No transition from q 1 (on either a or b) Though not a DFA,

More information

Lecture 1: Finite State Automaton

Lecture 1: Finite State Automaton Lecture 1: Finite State Automaton Instructor: Ketan Mulmuley Scriber: Yuan Li January 6, 2015 1 Deterministic Finite Automaton Informally, a deterministic finite automaton (DFA) has finite number of s-

More information

Introduction to Formal Languages, Automata and Computability p.1/51

Introduction to Formal Languages, Automata and Computability p.1/51 Introduction to Formal Languages, Automata and Computability Finite State Automata K. Krithivasan and R. Rama Introduction to Formal Languages, Automata and Computability p.1/51 Introduction As another

More information

Chapter Five: Nondeterministic Finite Automata

Chapter Five: Nondeterministic Finite Automata Chapter Five: Nondeterministic Finite Automata From DFA to NFA A DFA has exactly one transition from every state on every symbol in the alphabet. By relaxing this requirement we get a related but more

More information

Finite Automata and Languages

Finite Automata and Languages CS62, IIT BOMBAY Finite Automata and Languages Ashutosh Trivedi Department of Computer Science and Engineering, IIT Bombay CS62: New Trends in IT: Modeling and Verification of Cyber-Physical Systems (2

More information

CS 208: Automata Theory and Logic

CS 208: Automata Theory and Logic CS 28: Automata Theory and Logic b a a start A x(la(x) y(x < y) L b (y)) B b Department of Computer Science and Engineering, Indian Institute of Technology Bombay of 32 Nondeterminism Alternation 2 of

More information

Finite Automata and Regular Languages (part III)

Finite Automata and Regular Languages (part III) Finite Automata and Regular Languages (part III) Prof. Dan A. Simovici UMB 1 / 1 Outline 2 / 1 Nondeterministic finite automata can be further generalized by allowing transitions between states without

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Rewriting Systems and Chomsky Grammars CAS 705 Ryszard Janicki Department of Computing and Software McMaster University Hamilton, Ontario, Canada janicki@mcmaster.ca Ryszard

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY REVIEW for MIDTERM 1 THURSDAY Feb 6 Midterm 1 will cover everything we have seen so far The PROBLEMS will be from Sipser, Chapters 1, 2, 3 It will be

More information

Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q0, qaccept, qreject), where Q, Σ, Γ are all finite

Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q0, qaccept, qreject), where Q, Σ, Γ are all finite The Church-Turing Thesis CS60001: Foundations of Computing Science Professor, Dept. of Computer Sc. & Engg., Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q 0, q accept, q reject ), where

More information

DM17. Beregnelighed. Jacob Aae Mikkelsen

DM17. Beregnelighed. Jacob Aae Mikkelsen DM17 Beregnelighed Jacob Aae Mikkelsen January 12, 2007 CONTENTS Contents 1 Introduction 2 1.1 Operations with languages...................... 2 2 Finite Automata 3 2.1 Regular expressions/languages....................

More information

The Pumping Lemma. for all n 0, u 1 v n u 2 L (i.e. u 1 u 2 L, u 1 vu 2 L [but we knew that anyway], u 1 vvu 2 L, u 1 vvvu 2 L, etc.

The Pumping Lemma. for all n 0, u 1 v n u 2 L (i.e. u 1 u 2 L, u 1 vu 2 L [but we knew that anyway], u 1 vvu 2 L, u 1 vvvu 2 L, etc. The Pumping Lemma For every regular language L, there is a number l 1 satisfying the pumping lemma property: All w L with w l can be expressed as a concatenation of three strings, w = u 1 vu 2, where u

More information

CS21 Decidability and Tractability

CS21 Decidability and Tractability CS21 Decidability and Tractability Lecture 2 January 5, 2018 January 5, 2018 CS21 Lecture 2 1 Outline Finite Automata Nondeterministic Finite Automata Closure under regular operations NFA, FA equivalence

More information

Automata and Languages

Automata and Languages Automata and Languages Prof. Mohamed Hamada Software Engineering Lab. The University of Aizu Japan Nondeterministic Finite Automata with empty moves (-NFA) Definition A nondeterministic finite automaton

More information

Lecture 3: Nondeterministic Finite Automata

Lecture 3: Nondeterministic Finite Automata Lecture 3: Nondeterministic Finite Automata September 5, 206 CS 00 Theory of Computation As a recap of last lecture, recall that a deterministic finite automaton (DFA) consists of (Q, Σ, δ, q 0, F ) where

More information

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT. Recap DFA,NFA, DTM Slides by Prof. Debasis Mitra, FIT. 1 Formal Language Finite set of alphabets Σ: e.g., {0, 1}, {a, b, c}, { {, } } Language L is a subset of strings on Σ, e.g., {00, 110, 01} a finite

More information

Theory of Computation (I) Yijia Chen Fudan University

Theory of Computation (I) Yijia Chen Fudan University Theory of Computation (I) Yijia Chen Fudan University Instructor Yijia Chen Homepage: http://basics.sjtu.edu.cn/~chen Email: yijiachen@fudan.edu.cn Textbook Introduction to the Theory of Computation Michael

More information

Introduction to Theoretical Computer Science. Motivation. Automata = abstract computing devices

Introduction to Theoretical Computer Science. Motivation. Automata = abstract computing devices Introduction to Theoretical Computer Science Motivation Automata = abstract computing devices Turing studied Turing Machines (= computers) before there were any real computers We will also look at simpler

More information

Foundations of Informatics: a Bridging Course

Foundations of Informatics: a Bridging Course Foundations of Informatics: a Bridging Course Week 3: Formal Languages and Semantics Thomas Noll Lehrstuhl für Informatik 2 RWTH Aachen University noll@cs.rwth-aachen.de http://www.b-it-center.de/wob/en/view/class211_id948.html

More information

Discrete Mathematics and Logic II. Regular Sets

Discrete Mathematics and Logic II. Regular Sets Discrete Mathematics and Logic II. Regular Sets SFWR ENG 2FA3 Ryszard Janicki Winter 24 Acknowledgments: Material based on Automata and Computability by Dexter C. Kozen (Chapter 4). Ryszard Janicki Discrete

More information

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET Regular Languages and FA A language is a set of strings over a finite alphabet Σ. All languages are finite or countably infinite. The set of all languages

More information

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism, CS 54, Lecture 2: Finite Automata, Closure Properties Nondeterminism, Why so Many Models? Streaming Algorithms 0 42 Deterministic Finite Automata Anatomy of Deterministic Finite Automata transition: for

More information

Theory of Languages and Automata

Theory of Languages and Automata Theory of Languages and Automata Chapter 1- Regular Languages & Finite State Automaton Sharif University of Technology Finite State Automaton We begin with the simplest model of Computation, called finite

More information

COM364 Automata Theory Lecture Note 2 - Nondeterminism

COM364 Automata Theory Lecture Note 2 - Nondeterminism COM364 Automata Theory Lecture Note 2 - Nondeterminism Kurtuluş Küllü March 2018 The FA we saw until now were deterministic FA (DFA) in the sense that for each state and input symbol there was exactly

More information

X-machines - a computational model framework.

X-machines - a computational model framework. Chapter 2. X-machines - a computational model framework. This chapter has three aims: To examine the main existing computational models and assess their computational power. To present the X-machines as

More information

Formal Models in NLP

Formal Models in NLP Formal Models in NLP Finite-State Automata Nina Seemann Universität Stuttgart Institut für Maschinelle Sprachverarbeitung Pfaffenwaldring 5b 70569 Stuttgart May 15, 2012 Nina Seemann (IMS) Formal Models

More information

Introduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova.

Introduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova. Introduction to the Theory of Computation Automata 1VO + 1PS Lecturer: Dr. Ana Sokolova http://cs.uni-salzburg.at/~anas/ Setup and Dates Lectures and Instructions 23.10. 3.11. 17.11. 24.11. 1.12. 11.12.

More information

Computability Theory. CS215, Lecture 6,

Computability Theory. CS215, Lecture 6, Computability Theory CS215, Lecture 6, 2000 1 The Birth of Turing Machines At the end of the 19th century, Gottlob Frege conjectured that mathematics could be built from fundamental logic In 1900 David

More information

Introduction to Turing Machines. Reading: Chapters 8 & 9

Introduction to Turing Machines. Reading: Chapters 8 & 9 Introduction to Turing Machines Reading: Chapters 8 & 9 1 Turing Machines (TM) Generalize the class of CFLs: Recursively Enumerable Languages Recursive Languages Context-Free Languages Regular Languages

More information

Closure under the Regular Operations

Closure under the Regular Operations September 7, 2013 Application of NFA Now we use the NFA to show that collection of regular languages is closed under regular operations union, concatenation, and star Earlier we have shown this closure

More information

Introduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova.

Introduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova. Introduction to the Theory of Computation Automata 1VO + 1PS Lecturer: Dr. Ana Sokolova http://cs.uni-salzburg.at/~anas/ Setup and Dates Lectures Tuesday 10:45 pm - 12:15 pm Instructions Tuesday 12:30

More information

Introduction to Finite-State Automata

Introduction to Finite-State Automata Introduction to Finite-State Automata John McDonough Language Technologies Institute, Machine Learning for Signal Processing Group, Carnegie Mellon University March 26, 2012 Introduction In this lecture,

More information

CS 455/555: Finite automata

CS 455/555: Finite automata CS 455/555: Finite automata Stefan D. Bruda Winter 2019 AUTOMATA (FINITE OR NOT) Generally any automaton Has a finite-state control Scans the input one symbol at a time Takes an action based on the currently

More information

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS Automata Theory Lecture on Discussion Course of CS2 This Lecture is about Mathematical Models of Computation. Why Should I Care? - Ways of thinking. - Theory can drive practice. - Don t be an Instrumentalist.

More information

Outline. Nondetermistic Finite Automata. Transition diagrams. A finite automaton is a 5-tuple (Q, Σ,δ,q 0,F)

Outline. Nondetermistic Finite Automata. Transition diagrams. A finite automaton is a 5-tuple (Q, Σ,δ,q 0,F) Outline Nondeterminism Regular expressions Elementary reductions http://www.cs.caltech.edu/~cs20/a October 8, 2002 1 Determistic Finite Automata A finite automaton is a 5-tuple (Q, Σ,δ,q 0,F) Q is a finite

More information

Limits of Computability

Limits of Computability Limits of Computability Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at Wolfgang Schreiner

More information

CS21 Decidability and Tractability

CS21 Decidability and Tractability CS21 Decidability and Tractability Lecture 8 January 24, 2018 Outline Turing Machines and variants multitape TMs nondeterministic TMs Church-Turing Thesis So far several models of computation finite automata

More information

How to Pop a Deep PDA Matters

How to Pop a Deep PDA Matters How to Pop a Deep PDA Matters Peter Leupold Department of Mathematics, Faculty of Science Kyoto Sangyo University Kyoto 603-8555, Japan email:leupold@cc.kyoto-su.ac.jp Abstract Deep PDA are push-down automata

More information

Theory of Computation (II) Yijia Chen Fudan University

Theory of Computation (II) Yijia Chen Fudan University Theory of Computation (II) Yijia Chen Fudan University Review A language L is a subset of strings over an alphabet Σ. Our goal is to identify those languages that can be recognized by one of the simplest

More information

Inf2A: Converting from NFAs to DFAs and Closure Properties

Inf2A: Converting from NFAs to DFAs and Closure Properties 1/43 Inf2A: Converting from NFAs to DFAs and Stuart Anderson School of Informatics University of Edinburgh October 13, 2009 Starter Questions 2/43 1 Can you devise a way of testing for any FSM M whether

More information

Theory of Computation

Theory of Computation Theory of Computation COMP363/COMP6363 Prerequisites: COMP4 and COMP 6 (Foundations of Computing) Textbook: Introduction to Automata Theory, Languages and Computation John E. Hopcroft, Rajeev Motwani,

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automata Theory and Formal Languages TMV27/DIT32 LP4 28 Lecture 5 Ana Bove March 26th 28 Recap: Inductive sets, (terminating) recursive functions, structural induction To define an inductive set

More information

Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM)

Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM) Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM) 1 Deterministic Turing Machine (DTM).. B B 0 1 1 0 0 B B.. Finite Control Two-way, infinite tape, broken into

More information

CSC173 Workshop: 13 Sept. Notes

CSC173 Workshop: 13 Sept. Notes CSC173 Workshop: 13 Sept. Notes Frank Ferraro Department of Computer Science University of Rochester September 14, 2010 1 Regular Languages and Equivalent Forms A language can be thought of a set L of

More information

Finite Automata and Regular Languages

Finite Automata and Regular Languages Finite Automata and Regular Languages Topics to be covered in Chapters 1-4 include: deterministic vs. nondeterministic FA, regular expressions, one-way vs. two-way FA, minimization, pumping lemma for regular

More information

Fooling Sets and. Lecture 5

Fooling Sets and. Lecture 5 Fooling Sets and Introduction to Nondeterministic Finite Automata Lecture 5 Proving that a language is not regular Given a language, we saw how to prove it is regular (union, intersection, concatenation,

More information

Chapter Two: Finite Automata

Chapter Two: Finite Automata Chapter Two: Finite Automata In theoretical computer science, automata theory is the study of abstract machines (or more appropriately, abstract 'mathematical' machines or systems) and the computational

More information

Turing Machines. Wolfgang Schreiner

Turing Machines. Wolfgang Schreiner Turing Machines Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at Wolfgang Schreiner

More information

UNIT-II. NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: SIGNIFICANCE. Use of ε-transitions. s t a r t. ε r. e g u l a r

UNIT-II. NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: SIGNIFICANCE. Use of ε-transitions. s t a r t. ε r. e g u l a r Syllabus R9 Regulation UNIT-II NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: In the automata theory, a nondeterministic finite automaton (NFA) or nondeterministic finite state machine is a finite

More information

Peter Wood. Department of Computer Science and Information Systems Birkbeck, University of London Automata and Formal Languages

Peter Wood. Department of Computer Science and Information Systems Birkbeck, University of London Automata and Formal Languages and and Department of Computer Science and Information Systems Birkbeck, University of London ptw@dcs.bbk.ac.uk Outline and Doing and analysing problems/languages computability/solvability/decidability

More information

CS:4330 Theory of Computation Spring Regular Languages. Finite Automata and Regular Expressions. Haniel Barbosa

CS:4330 Theory of Computation Spring Regular Languages. Finite Automata and Regular Expressions. Haniel Barbosa CS:4330 Theory of Computation Spring 2018 Regular Languages Finite Automata and Regular Expressions Haniel Barbosa Readings for this lecture Chapter 1 of [Sipser 1996], 3rd edition. Sections 1.1 and 1.3.

More information

Computational Models - Lecture 5 1

Computational Models - Lecture 5 1 Computational Models - Lecture 5 1 Handout Mode Iftach Haitner and Yishay Mansour. Tel Aviv University. April 10/22, 2013 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

More information

Languages. Non deterministic finite automata with ε transitions. First there was the DFA. Finite Automata. Non-Deterministic Finite Automata (NFA)

Languages. Non deterministic finite automata with ε transitions. First there was the DFA. Finite Automata. Non-Deterministic Finite Automata (NFA) Languages Non deterministic finite automata with ε transitions Recall What is a language? What is a class of languages? Finite Automata Consists of A set of states (Q) A start state (q o ) A set of accepting

More information

CSCC63 Worksheet Turing Machines

CSCC63 Worksheet Turing Machines 1 An Example CSCC63 Worksheet Turing Machines Goal. Design a turing machine, M that accepts only strings of the form {w#w w {0, 1} }. Idea. Describe in words how the machine would work. Read first symbol

More information

CMSC 330: Organization of Programming Languages

CMSC 330: Organization of Programming Languages CMSC 330: Organization of Programming Languages Theory of Regular Expressions DFAs and NFAs Reminders Project 1 due Sep. 24 Homework 1 posted Exam 1 on Sep. 25 Exam topics list posted Practice homework

More information

Finite Automata. Dr. Neil T. Dantam. Fall CSCI-561, Colorado School of Mines. Dantam (Mines CSCI-561) Finite Automata Fall / 35

Finite Automata. Dr. Neil T. Dantam. Fall CSCI-561, Colorado School of Mines. Dantam (Mines CSCI-561) Finite Automata Fall / 35 Finite Automata Dr. Neil T. Dantam CSCI-561, Colorado School of Mines Fall 2017 Dantam (Mines CSCI-561) Finite Automata Fall 2017 1 / 35 Outline Dantam (Mines CSCI-561) Finite Automata Fall 2017 2 / 35

More information

CMPSCI 250: Introduction to Computation. Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013

CMPSCI 250: Introduction to Computation. Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013 CMPSCI 250: Introduction to Computation Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013 λ-nfa s to NFA s to DFA s Reviewing the Three Models and Kleene s Theorem The Subset

More information

Great Theoretical Ideas in Computer Science. Lecture 4: Deterministic Finite Automaton (DFA), Part 2

Great Theoretical Ideas in Computer Science. Lecture 4: Deterministic Finite Automaton (DFA), Part 2 5-25 Great Theoretical Ideas in Computer Science Lecture 4: Deterministic Finite Automaton (DFA), Part 2 January 26th, 27 Formal definition: DFA A deterministic finite automaton (DFA) M =(Q,,,q,F) M is

More information

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties of Regular Languages Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties Recall a closure property is a statement

More information

Automata Theory (2A) Young Won Lim 5/31/18

Automata Theory (2A) Young Won Lim 5/31/18 Automata Theory (2A) Copyright (c) 2018 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later

More information

Lecture 4 Nondeterministic Finite Accepters

Lecture 4 Nondeterministic Finite Accepters Lecture 4 Nondeterministic Finite Accepters COT 4420 Theory of Computation Section 2.2, 2.3 Nondeterminism A nondeterministic finite automaton can go to several states at once. Transitions from one state

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 5-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY NON-DETERMINISM and REGULAR OPERATIONS THURSDAY JAN 6 UNION THEOREM The union of two regular languages is also a regular language Regular Languages Are

More information

Weak ω-automata. Shaked Flur

Weak ω-automata. Shaked Flur Weak ω-automata Shaked Flur Weak ω-automata Research Thesis Submitted in partial fulllment of the requirements for the degree of Master of Science in Computer Science Shaked Flur Submitted to the Senate

More information

Theory of Computation Turing Machine and Pushdown Automata

Theory of Computation Turing Machine and Pushdown Automata Theory of Computation Turing Machine and Pushdown Automata 1. What is a Turing Machine? A Turing Machine is an accepting device which accepts the languages (recursively enumerable set) generated by type

More information

Theory of computation: initial remarks (Chapter 11)

Theory of computation: initial remarks (Chapter 11) Theory of computation: initial remarks (Chapter 11) For many purposes, computation is elegantly modeled with simple mathematical objects: Turing machines, finite automata, pushdown automata, and such.

More information

Extended transition function of a DFA

Extended transition function of a DFA Extended transition function of a DFA The next two pages describe the extended transition function of a DFA in a more detailed way than Handout 3.. p./43 Formal approach to accepted strings We define the

More information

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 16 : Turing Machines

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 16 : Turing Machines COMP-330 Theory of Computation Fall 2017 -- Prof. Claude Crépeau Lec. 16 : Turing Machines COMP 330 Fall 2017: Lectures Schedule 1-2. Introduction 1.5. Some basic mathematics 2-3. Deterministic finite

More information

Representing Arithmetic Constraints with Finite Automata: An Overview

Representing Arithmetic Constraints with Finite Automata: An Overview Representing Arithmetic Constraints with Finite Automata: An Overview Bernard Boigelot Pierre Wolper Université de Liège Motivation Linear numerical constraints are a very common and useful formalism (our

More information

Part I: Definitions and Properties

Part I: Definitions and Properties Turing Machines Part I: Definitions and Properties Finite State Automata Deterministic Automata (DFSA) M = {Q, Σ, δ, q 0, F} -- Σ = Symbols -- Q = States -- q 0 = Initial State -- F = Accepting States

More information

Nondeterministic Finite Automata. Nondeterminism Subset Construction

Nondeterministic Finite Automata. Nondeterminism Subset Construction Nondeterministic Finite Automata Nondeterminism Subset Construction 1 Nondeterminism A nondeterministic finite automaton has the ability to be in several states at once. Transitions from a state on an

More information

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK COMS11700 Undecidability Department of Computer Science, University of Bristol Bristol, UK 4 April 2014 COMS11700: Undecidability Slide 1/29 Decidability We are particularly interested in Turing machines

More information

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is,

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is, Recall A deterministic finite automaton is a five-tuple where S is a finite set of states, M = (S, Σ, T, s 0, F ) Σ is an alphabet the input alphabet, T : S Σ S is the transition function, s 0 S is the

More information

E.g. The set RE of regular expressions is given by the following rules:

E.g. The set RE of regular expressions is given by the following rules: 1 Lecture Summary We gave a brief overview of inductively defined sets, inductively defined functions, and proofs by structural induction We showed how to prove that a machine is correct using induction

More information

Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0

Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0 Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0 Turing Machines Now for a machine model of much greater power.

More information

Equivalence of Regular Expressions and FSMs

Equivalence of Regular Expressions and FSMs Equivalence of Regular Expressions and FSMs Greg Plaxton Theory in Programming Practice, Spring 2005 Department of Computer Science University of Texas at Austin Regular Language Recall that a language

More information

Languages, regular languages, finite automata

Languages, regular languages, finite automata Notes on Computer Theory Last updated: January, 2018 Languages, regular languages, finite automata Content largely taken from Richards [1] and Sipser [2] 1 Languages An alphabet is a finite set of characters,

More information

DD2371 Automata Theory

DD2371 Automata Theory KTH CSC VT 2008 DD2371 Automata Theory Dilian Gurov Lecture Outline 1. The lecturer 2. Introduction to automata theory 3. Course syllabus 4. Course objectives 5. Course organization 6. First definitions

More information

COMP4141 Theory of Computation

COMP4141 Theory of Computation COMP4141 Theory of Computation Lecture 4 Regular Languages cont. Ron van der Meyden CSE, UNSW Revision: 2013/03/14 (Credits: David Dill, Thomas Wilke, Kai Engelhardt, Peter Höfner, Rob van Glabbeek) Regular

More information

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) October,

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever.   ETH Zürich (D-ITET) October, Automata & languages A primer on the Theory of Computation Laurent Vanbever www.vanbever.eu ETH Zürich (D-ITET) October, 19 2017 Part 5 out of 5 Last week was all about Context-Free Languages Context-Free

More information

Finite Automata. Mahesh Viswanathan

Finite Automata. Mahesh Viswanathan Finite Automata Mahesh Viswanathan In this lecture, we will consider different models of finite state machines and study their relative power. These notes assume that the reader is familiar with DFAs,

More information

The Turing machine model of computation

The Turing machine model of computation The Turing machine model of computation For most of the remainder of the course we will study the Turing machine model of computation, named after Alan Turing (1912 1954) who proposed the model in 1936.

More information

SYLLABUS. Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 3 : REGULAR EXPRESSIONS AND LANGUAGES

SYLLABUS. Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 3 : REGULAR EXPRESSIONS AND LANGUAGES Contents i SYLLABUS UNIT - I CHAPTER - 1 : AUT UTOMA OMATA Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 2 : FINITE AUT UTOMA OMATA An Informal Picture of Finite Automata,

More information

Final exam study sheet for CS3719 Turing machines and decidability.

Final exam study sheet for CS3719 Turing machines and decidability. Final exam study sheet for CS3719 Turing machines and decidability. A Turing machine is a finite automaton with an infinite memory (tape). Formally, a Turing machine is a 6-tuple M = (Q, Σ, Γ, δ, q 0,

More information

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministic Finite Automata Lecture 6 Section 2.2 Robb T. Koether Hampden-Sydney College Mon, Sep 5, 2016 Robb T. Koether (Hampden-Sydney College) Nondeterministic Finite Automata Mon, Sep 5, 2016

More information

Finite Automata and Regular languages

Finite Automata and Regular languages Finite Automata and Regular languages Huan Long Shanghai Jiao Tong University Acknowledgements Part of the slides comes from a similar course in Fudan University given by Prof. Yijia Chen. http://basics.sjtu.edu.cn/

More information

Functions on languages:

Functions on languages: MA/CSSE 474 Final Exam Notation and Formulas page Name (turn this in with your exam) Unless specified otherwise, r,s,t,u,v,w,x,y,z are strings over alphabet Σ; while a, b, c, d are individual alphabet

More information

CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1)

CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1) CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1) Definition 1 (Alphabet) A alphabet is a finite set of objects called symbols. Definition 2 (String)

More information

Chapter 3: The Church-Turing Thesis

Chapter 3: The Church-Turing Thesis Chapter 3: The Church-Turing Thesis 1 Turing Machine (TM) Control... Bi-direction Read/Write Turing machine is a much more powerful model, proposed by Alan Turing in 1936. 2 Church/Turing Thesis Anything

More information

CS154 Final Examination

CS154 Final Examination CS154 Final Examination June 7, 2010, 7-10PM Directions: CS154 students: answer all 13 questions on this paper. Those taking CS154N should answer only questions 8-13. The total number of points on this

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Lecture 5 Reductions Undecidable problems from language theory Linear bounded automata given by Jiri Srba Lecture 5 Computability and Complexity 1/14 Reduction Informal Definition

More information

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministic Finite Automata COMP2600 Formal Methods for Software Engineering Katya Lebedeva Australian National University Semester 2, 206 Slides by Katya Lebedeva. COMP 2600 Nondeterministic Finite

More information

Harvard CS 121 and CSCI E-121 Lecture 14: Turing Machines and the Church Turing Thesis

Harvard CS 121 and CSCI E-121 Lecture 14: Turing Machines and the Church Turing Thesis Harvard CS 121 and CSCI E-121 Lecture 14: Turing Machines and the Church Turing Thesis Harry Lewis October 22, 2013 Reading: Sipser, 3.2, 3.3. The Basic Turing Machine The Basic Turing Machine a a b a

More information

Theory of Computer Science

Theory of Computer Science Theory of Computer Science D1. Turing-Computability Malte Helmert University of Basel April 18, 2016 Overview: Course contents of this course: logic How can knowledge be represented? How can reasoning

More information

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad-500 014 Subject: FORMAL LANGUAGES AND AUTOMATA THEORY Class : CSE II PART A (SHORT ANSWER QUESTIONS) UNIT- I 1 Explain transition diagram, transition

More information

Uses of finite automata

Uses of finite automata Chapter 2 :Finite Automata 2.1 Finite Automata Automata are computational devices to solve language recognition problems. Language recognition problem is to determine whether a word belongs to a language.

More information

Course 4 Finite Automata/Finite State Machines

Course 4 Finite Automata/Finite State Machines Course 4 Finite Automata/Finite State Machines The structure and the content of the lecture is based on (1) http://www.eecs.wsu.edu/~ananth/cpts317/lectures/index.htm, (2) W. Schreiner Computability and

More information

Finite State Automata

Finite State Automata Trento 2005 p. 1/4 Finite State Automata Automata: Theory and Practice Paritosh K. Pandya (TIFR, Mumbai, India) Unversity of Trento 10-24 May 2005 Trento 2005 p. 2/4 Finite Word Langauges Alphabet Σ is

More information