CSE 135: Introduction to Theory of Computation Equivalence of DFA and NFA
|
|
- Brett Green
- 5 years ago
- Views:
Transcription
1 CSE 135: Introduction to Theory of Computation Equivalence of DFA and NFA Sungjin Im University of California, Merced
2 Expressive Power of NFAs and DFAs Is there a language that is recognized by a DFA but not by any NFAs?
3 Expressive Power of NFAs and DFAs Is there a language that is recognized by a DFA but not by any NFAs? No!
4 Expressive Power of NFAs and DFAs Is there a language that is recognized by a DFA but not by any NFAs? No! Is there a language that is recognized by an NFA but not by any DFAs?
5 Expressive Power of NFAs and DFAs Is there a language that is recognized by a DFA but not by any NFAs? No! Is there a language that is recognized by an NFA but not by any DFAs? No!
6 Main Theorem Theorem A language L is regular if and only if there is an NFA N such that L(N) = L.
7 Main Theorem Theorem A language L is regular if and only if there is an NFA N such that L(N) = L. In other words: For any DFA D, there is an NFA N such that L(N) = L(D), and for any NFA N, there is a DFA D such that L(D) = L(N).
8 Converting DFAs to NFAs Proposition For any DFA D, there is an NFA N such that L(N) = L(D).
9 Converting DFAs to NFAs Proposition For any DFA D, there is an NFA N such that L(N) = L(D). Proof. Is a DFA an NFA?.
10 Converting DFAs to NFAs Proposition For any DFA D, there is an NFA N such that L(N) = L(D). Proof. Is a DFA an NFA? Essentially yes! Syntactically, not quite. The formal definition of DFA has δ DFA : Q Σ Q whereas δ NFA : Q (Σ {ɛ}) P(Q)..
11 Converting DFAs to NFAs Proposition For any DFA D, there is an NFA N such that L(N) = L(D). Proof. Is a DFA an NFA? Essentially yes! Syntactically, not quite. The formal definition of DFA has δ DFA : Q Σ Q whereas δ NFA : Q (Σ {ɛ}) P(Q). For DFA D = (Q, Σ, δ D, q 0, F ), define an equivalent NFA N = (Q, Σ, δ N, q 0, F ) that has the exact same set of states, initial state and final states. Only difference is in the transition function. δ N (q, a) = {δ D (q, a)} for a Σ and δ N (q, ɛ) = for all q Q.
12 Simulating an NFA on Your Computer NFA Acceptance Problem Given an NFA N and an input string w, does N accept w?
13 Simulating an NFA on Your Computer NFA Acceptance Problem Given an NFA N and an input string w, does N accept w? How do we write a computer program to solve the NFA Acceptance problem?
14 Two Views of Nondeterminsm Guessing View At each step, the NFA guesses one of the choices available; the NFA will guess an accepting sequence of choices if such a one exists. Parallel View At each step the machine forks threads corresponding to each of the possible next states.
15 Two Views of Nondeterminsm Guessing View At each step, the NFA guesses one of the choices available; the NFA will guess an accepting sequence of choices if such a one exists. Very useful in reasoning about NFAs and in designing NFAs. Parallel View At each step the machine forks threads corresponding to each of the possible next states.
16 Two Views of Nondeterminsm Guessing View At each step, the NFA guesses one of the choices available; the NFA will guess an accepting sequence of choices if such a one exists. Very useful in reasoning about NFAs and in designing NFAs. Parallel View At each step the machine forks threads corresponding to each of the possible next states. Very useful in simulating/running NFA on inputs.
17 Algorithm for Simulating an NFA Algorithm Keep track of the current state of each of the active threads.
18 Algorithm for Simulating an NFA Algorithm Keep track of the current state of each of the active threads. Example 0, 1 0, 1 q 0 1 q 1 Consider the input w = 111. The execution (listing only the states of currently active threads) is Example NFA N
19 Algorithm for Simulating an NFA Algorithm Keep track of the current state of each of the active threads. Example 0, 1 0, 1 q 0 1 q 1 Consider the input w = 111. The execution (listing only the states of currently active threads) is q 0 Example NFA N
20 Algorithm for Simulating an NFA Algorithm Keep track of the current state of each of the active threads. Example 0, 1 0, 1 q 0 1 q 1 Consider the input w = 111. The execution (listing only the states of currently active threads) is q 0 1 q 0, q 1 Example NFA N
21 Algorithm for Simulating an NFA Algorithm Keep track of the current state of each of the active threads. Example 0, 1 0, 1 q 0 1 q 1 Example NFA N Consider the input w = 111. The execution (listing only the states of currently active threads) is 1 1 q 0 q 0, q 1 q 0, q 1, q 1 1 q 0, q 1, q 1, q 1
22 Algorithm With optimizations Observations Exponentially growing memory: more threads for longer inputs. Can we do better?
23 Algorithm With optimizations Observations Exponentially growing memory: more threads for longer inputs. Can we do better? Exact order of threads is not important
24 Algorithm With optimizations Observations Exponentially growing memory: more threads for longer inputs. Can we do better? Exact order of threads is not important It is unimportant whether the 5 th thread or the 1 st thread is in state q.
25 Algorithm With optimizations Observations Exponentially growing memory: more threads for longer inputs. Can we do better? Exact order of threads is not important It is unimportant whether the 5 th thread or the 1 st thread is in state q. If two threads are in the same state, then we can ignore one of the threads
26 Algorithm With optimizations Observations Exponentially growing memory: more threads for longer inputs. Can we do better? Exact order of threads is not important It is unimportant whether the 5 th thread or the 1 st thread is in state q. If two threads are in the same state, then we can ignore one of the threads Threads in the same state will behave identically; either one of the descendent threads of both will reach a final state, or none of the descendent threads of both will reach a final state
27 Parsimonious Algorithm in Action Example 0, 1 0, 1 q 0 1 q 1 Consider the input w = 111. The execution (listing only the states of currently active threads) is Example NFA N
28 Parsimonious Algorithm in Action Example 0, 1 0, 1 q 0 1 q 1 Consider the input w = 111. The execution (listing only the states of currently active threads) is {q 0 } Example NFA N
29 Parsimonious Algorithm in Action Example 0, 1 0, 1 q 0 1 q 1 Consider the input w = 111. The execution (listing only the states of currently active threads) is {q 0 } 1 {q 0, q 1 } Example NFA N
30 Parsimonious Algorithm in Action Example 0, 1 0, 1 q 0 1 q 1 Consider the input w = 111. The execution (listing only the states of currently active threads) is {q 0 } 1 {q 0, q 1 } 1 {q 0, q 1 } Example NFA N
31 Parsimonious Algorithm in Action Example 0, 1 0, 1 q 0 1 q 1 Example NFA N Consider the input w = 111. The execution (listing only the states of currently active threads) is {q 0 } 1 {q 0, q 1 } 1 {q 0, q 1 } 1 {q 0, q 1 }
32 Revisiting NFA Simulation Algorithm Need to keep track of the states of the active threads Unordered: Without worrying about exactly which thread is in what state No Duplicates: Keeping only one copy if there are multiple threads in same state
33 Revisiting NFA Simulation Algorithm Need to keep track of the states of the active threads Unordered: Without worrying about exactly which thread is in what state No Duplicates: Keeping only one copy if there are multiple threads in same state How much memory is needed?
34 Revisiting NFA Simulation Algorithm Need to keep track of the states of the active threads Unordered: Without worrying about exactly which thread is in what state No Duplicates: Keeping only one copy if there are multiple threads in same state How much memory is needed? If Q is the set of states of the NFA N, then we need to keep a subset of Q! Can be done in Q bits of memory (i.e., 2 Q states), which is finite!!
35 Constructing an Equivalent DFA The DFA runs the simulation algorithm
36 Constructing an Equivalent DFA The DFA runs the simulation algorithm DFA remembers the current states of active threads without duplicates, i.e., maintains a subset of states of the NFA
37 Constructing an Equivalent DFA The DFA runs the simulation algorithm DFA remembers the current states of active threads without duplicates, i.e., maintains a subset of states of the NFA When a new symbol is read, it updates the states of the active threads
38 Constructing an Equivalent DFA The DFA runs the simulation algorithm DFA remembers the current states of active threads without duplicates, i.e., maintains a subset of states of the NFA When a new symbol is read, it updates the states of the active threads Accepts whenever one of the threads is in a final state
39 Example of Equivalent DFA (1) 0, 1 0, 1 q 1 0 q 1 Example NFA N
40 Example of Equivalent DFA (1) 0, 1 0, 1 0, 1 0, 1 {q 1 } {} q 1 0 q 1 0 0, 1 Example NFA N 1 {q 0 } {q 0, q 1 } DFA D equivalent to N
41 Example of Equivalent DFA (1) 0, 1 0, 1 0, 1 0, 1 {q 1 } {} q 1 0 q 1 0 0, 1 Example NFA N 1 {q 0 } {q 0, q 1 } DFA D equivalent to N
42 Example of Equivalent DFA (1) 0, 1 0, 1 0, 1 0, 1 {q 1 } {} q 1 0 q 1 0 0, 1 Example NFA N 1 {q 0 } {q 0, q 1 } DFA D equivalent to N
43 Example of Equivalent DFA (1) 0, 1 0, 1 0, 1 0, 1 {q 1 } {} q 1 0 q 1 0 0, 1 Example NFA N 1 {q 0 } {q 0, q 1 } DFA D equivalent to N We can remove states unreachable from the initial state. How to find such states?
44 Example of Equivalent DFA (1) 0, 1 0, 1 0, 1 0, 1 {q 1 } {} q 1 0 q 1 0 0, 1 Example NFA N 1 {q 0 } {q 0, q 1 } DFA D equivalent to N We can remove states unreachable from the initial state. How to find such states? Use DFS or BFS!
45 Example of Equivalent DFA (2) ɛ q 1 0 q 0 q 3 1 q 2 ɛ Example NFA N ɛ
46 Example of Equivalent DFA (2) 0, 1 0, 1 q 1 {q 3 } {} ɛ 0 q 0 q 3 0 0, 1 1 q 2 ɛ 1 {q Example NFA N 0, q 1 } {q 2, q 3 } ɛ DFA D ɛ for N ɛ (only relevant states)
47 Example of Equivalent DFA (3) 0, 1 0, 1 q ɛ 0 q 0 0 q 00 1 q p ɛ Example NFA N
48 Example of Equivalent DFA (3) 0, 1 0, 1 q ɛ 0 q 0 0 q 00 1 q p ɛ Example NFA N {q ɛ } {q ɛ, q 0, q 00 } {q ɛ, q p } 1 {q ɛ, q 0, q 00, q p } DFA D equivalent to N
49 Formal Construction Given NFA N = (Q, Σ, δ, q 0, F ), construct DFA det(n) = (Q, Σ, δ, q 0, F ) as follows. Q = q 0 = F =
50 Formal Construction Given NFA N = (Q, Σ, δ, q 0, F ), construct DFA det(n) = (Q, Σ, δ, q 0, F ) as follows. Q = P(Q) q 0 = F =
51 Formal Construction Given NFA N = (Q, Σ, δ, q 0, F ), construct DFA det(n) = (Q, Σ, δ, q 0, F ) as follows. Q = P(Q) q 0 = ˆ (q 0, ɛ) F =
52 Formal Construction Given NFA N = (Q, Σ, δ, q 0, F ), construct DFA det(n) = (Q, Σ, δ, q 0, F ) as follows. Q = P(Q) q 0 = ˆ (q 0, ɛ) F = {A Q A F }
53 Formal Construction Given NFA N = (Q, Σ, δ, q 0, F ), construct DFA det(n) = (Q, Σ, δ, q 0, F ) as follows. Q = P(Q) q 0 = ˆ (q 0, ɛ) F = {A Q A F } δ ({q 1, q 2,... q k }, a) =
54 Formal Construction Given NFA N = (Q, Σ, δ, q 0, F ), construct DFA det(n) = (Q, Σ, δ, q 0, F ) as follows. Q = P(Q) q 0 = ˆ (q 0, ɛ) F = {A Q A F } δ ({q 1, q 2,... q k }, a) = ˆ (q 1, a) ˆ (q 2, a) ˆ (q k, a)
55 Formal Construction Given NFA N = (Q, Σ, δ, q 0, F ), construct DFA det(n) = (Q, Σ, δ, q 0, F ) as follows. Q = P(Q) q 0 = ˆ (q 0, ɛ) F = {A Q A F } δ ({q 1, q 2,... q k }, a) = ˆ (q 1, a) ˆ (q 2, a) ˆ (q k, a) or more concisely, δ (A, a) = ˆ (q, a) q A
56 Correctness Lemma For any NFA N, the DFA det(n) is equivalent to it, i.e., L(N) = L(det(N)).
57 Correctness Lemma For any NFA N, the DFA det(n) is equivalent to it, i.e., L(N) = L(det(N)). Proof Idea Need to show
58 Correctness Lemma For any NFA N, the DFA det(n) is equivalent to it, i.e., L(N) = L(det(N)). Proof Idea Need to show w Σ. det(n) accepts w iff N accepts w
59 Correctness Lemma For any NFA N, the DFA det(n) is equivalent to it, i.e., L(N) = L(det(N)). Proof Idea Need to show w Σ. det(n) accepts w iff N accepts w w Σ.ˆδ(q 0, w) F iff ˆ (q 0, w) F
60 Correctness Lemma For any NFA N, the DFA det(n) is equivalent to it, i.e., L(N) = L(det(N)). Proof Idea Need to show w Σ. det(n) accepts w iff N accepts w w Σ.ˆδ(q 0, w) F iff ˆ (q 0, w) F w Σ. for A = ˆδ(q 0, w), A F iff ˆ (q 0, w) F
61 Correctness Lemma For any NFA N, the DFA det(n) is equivalent to it, i.e., L(N) = L(det(N)). Proof Idea Need to show w Σ. det(n) accepts w iff N accepts w w Σ.ˆδ(q 0, w) F iff ˆ (q 0, w) F w Σ. for A = ˆδ(q 0, w), A F iff ˆ (q 0, w) F We will instead prove the stronger claim w Σ. ˆδ(q 0, w) = A iff ˆ (q 0, w) = A.
62 Correctness Proof Lemma w Σ. ˆδ(q 0, w) = A iff ˆ (q 0, w) = A.
63 Correctness Proof Lemma w Σ. ˆδ(q 0, w) = A iff ˆ (q 0, w) = A. Proof. By induction on w
64 Correctness Proof Lemma w Σ. ˆδ(q 0, w) = A iff ˆ (q 0, w) = A. Proof. By induction on w Base Case w = 0: Then w = ɛ. Now
65 Correctness Proof Lemma w Σ. ˆδ(q 0, w) = A iff ˆ (q 0, w) = A. Proof. By induction on w Base Case w = 0: Then w = ɛ. Now ˆδ(q 0, ɛ) = q 0 defn. of ˆδ
66 Correctness Proof Lemma w Σ. ˆδ(q 0, w) = A iff ˆ (q 0, w) = A. Proof. By induction on w Base Case w = 0: Then w = ɛ. Now ˆδ(q 0, ɛ) = q 0 defn. of ˆδ = ˆ (q 0, ɛ) defn. of q 0
67 Correctness Proof Lemma w Σ. ˆδ(q 0, w) = A iff ˆ (q 0, w) = A. Proof. By induction on w Base Case w = 0: Then w = ɛ. Now ˆδ(q 0, ɛ) = q 0 defn. of ˆδ = ˆ (q 0, ɛ) defn. of q 0 Induction Hypothesis: Assume inductively that the statement holds w. w = n
68 Correctness Proof Induction Step Proof (contd). Induction Step: If w = n + 1 then w = ua with u = n and a Σ. ˆδ(q 0, ua) = δ(ˆδ(q 0, u), a) defn. of ˆδ
69 Correctness Proof Induction Step Proof (contd). Induction Step: If w = n + 1 then w = ua with u = n and a Σ. ˆδ(q 0, ua) = δ(ˆδ(q 0, u), a) defn. of ˆδ = δ( ˆ (q 0, u), a) ind. hyp.
70 Correctness Proof Induction Step Proof (contd). Induction Step: If w = n + 1 then w = ua with u = n and a Σ. ˆδ(q 0, ua) = δ(ˆδ(q 0, u), a) defn. of ˆδ = δ( ˆ (q 0, u), a) ind. hyp. = ˆ (q, a) defn. of δ q ˆ (q 0,u)
71 Correctness Proof Induction Step Proof (contd). Induction Step: If w = n + 1 then w = ua with u = n and a Σ. ˆδ(q 0, ua) = δ(ˆδ(q 0, u), a) defn. of ˆδ = δ( ˆ (q 0, u), a) ind. hyp. = ˆ (q, a) defn. of δ q ˆ (q 0,u) = ˆ (q 0, ua) prop. about ˆ
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 informationCSE 135: Introduction to Theory of Computation Nondeterministic Finite Automata (cont )
CSE 135: Introduction to Theory of Computation Nondeterministic Finite Automata (cont ) Sungjin Im University of California, Merced 2-3-214 Example II A ɛ B ɛ D F C E Example II A ɛ B ɛ D F C E NFA accepting
More informationNondeterministic Finite Automata
Nondeterministic Finite Automata Mahesh Viswanathan Introducing Nondeterminism Consider the machine shown in Figure. Like a DFA it has finitely many states and transitions labeled by symbols from an input
More informationCSE 135: Introduction to Theory of Computation Nondeterministic Finite Automata
CSE 135: Introduction to Theory of Computation Nondeterministic Finite Automata Sungjin Im University of California, Merced 1-27-215 Nondeterminism Michael Rabin and Dana Scott (1959) Michael Rabin Dana
More informationFinite Automata. Theorems - Unit I SUSAN ELIAS. Professor Department of Computer Science & Engineering Sri Venkateswara College of Engineering
Finite Automata Theorems - Unit I SUSAN ELIAS Professor Department of Computer Science & Engineering Sri Venkateswara College of Engineering September 17, 2012 Unit I - Guidelines Formal Definitions Definition
More informationCSE 135: Introduction to Theory of Computation Optimal DFA
CSE 35: Introduction to Theory of Computation Optimal DFA Sungjin Im University of California, Merced 2-9-25 Optimal Algorithms for Regular Languages Myhill-Nerode Theorem There is a unique optimal algorithm
More informationLecture 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 informationSeptember 7, Formal Definition of a Nondeterministic Finite Automaton
Formal Definition of a Nondeterministic Finite Automaton September 7, 2014 A comment first The formal definition of an NFA is similar to that of a DFA. Both have states, an alphabet, transition function,
More informationDeterministic Finite Automata. Non deterministic finite automata. Non-Deterministic Finite Automata (NFA) Non-Deterministic Finite Automata (NFA)
Deterministic Finite Automata Non deterministic finite automata Automata we ve been dealing with have been deterministic For every state and every alphabet symbol there is exactly one move that the machine
More informationCSE 311: Foundations of Computing. Lecture 23: Finite State Machine Minimization & NFAs
CSE : Foundations of Computing Lecture : Finite State Machine Minimization & NFAs State Minimization Many different FSMs (DFAs) for the same problem Take a given FSM and try to reduce its state set by
More informationFormal 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 informationAutomata and Formal Languages - CM0081 Non-Deterministic Finite Automata
Automata and Formal Languages - CM81 Non-Deterministic Finite Automata Andrés Sicard-Ramírez Universidad EAFIT Semester 217-2 Non-Deterministic Finite Automata (NFA) Introduction q i a a q j a q k The
More informationFinite 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 informationChapter 6: NFA Applications
Chapter 6: NFA Applications Implementing NFAs The problem with implementing NFAs is that, being nondeterministic, they define a more complex computational procedure for testing language membership. To
More informationCSE 105 Theory of Computation Professor Jeanne Ferrante
CSE 105 Theory of Computation http://www.jflap.org/jflaptmp/ Professor Jeanne Ferrante 1 Today s agenda NFA Review and Design NFA s Equivalence to DFA s Another Closure Property proof for Regular Languages
More informationIncorrect reasoning about RL. Equivalence of NFA, DFA. Epsilon Closure. Proving equivalence. One direction is easy:
Incorrect reasoning about RL Since L 1 = {w w=a n, n N}, L 2 = {w w = b n, n N} are regular, therefore L 1 L 2 = {w w=a n b n, n N} is regular If L 1 is a regular language, then L 2 = {w R w L 1 } is regular,
More informationSubset construction. We have defined for a DFA L(A) = {x Σ ˆδ(q 0, x) F } and for A NFA. For any NFA A we can build a DFA A D such that L(A) = L(A D )
Search algorithm Clever algorithm even for a single word Example: find abac in abaababac See Knuth-Morris-Pratt and String searching algorithm on wikipedia 2 Subset construction We have defined for a DFA
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/ Today's learning goals Sipser Ch 4.1 Explain what it means for a problem to be decidable. Justify the use of encoding.
More information2017/08/29 Chapter 1.2 in Sipser Ø Announcement:
Nondeterministic Human-aware Finite Robo.cs Automata 2017/08/29 Chapter 1.2 in Sipser Ø Announcement: q Piazza registration: http://piazza.com/asu/fall2017/cse355 q First poll will be posted on Piazza
More informationNondeterminism. September 7, Nondeterminism
September 7, 204 Introduction is a useful concept that has a great impact on the theory of computation Introduction is a useful concept that has a great impact on the theory of computation So far in our
More informationCS 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 informationCS 154, Lecture 3: DFA NFA, Regular Expressions
CS 154, Lecture 3: DFA NFA, Regular Expressions Homework 1 is coming out Deterministic Finite Automata Computation with finite memory Non-Deterministic Finite Automata Computation with finite memory and
More informationE.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 informationMore on Finite Automata and Regular Languages. (NTU EE) Regular Languages Fall / 41
More on Finite Automata and Regular Languages (NTU EE) Regular Languages Fall 2016 1 / 41 Pumping Lemma is not a Sufficient Condition Example 1 We know L = {b m c m m > 0} is not regular. Let us consider
More informationT (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 informationCOMP4141 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 informationFinite 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 informationFormal Language and Automata Theory (CS21004)
Theory (CS21004) Announcements The slide is just a short summary Follow the discussion and the boardwork Solve problems (apart from those we dish out in class) Table of Contents 1 2 3 Languages that are
More informationFinite 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 informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2018 http://cseweb.ucsd.edu/classes/sp18/cse105-ab/ Today's learning goals Sipser Ch 4.1 Explain what it means for a problem to be decidable. Justify the use of encoding.
More informationChap. 1.2 NonDeterministic Finite Automata (NFA)
Chap. 1.2 NonDeterministic Finite Automata (NFA) DFAs: exactly 1 new state for any state & next char NFA: machine may not work same each time More than 1 transition rule for same state & input Any one
More informationCMPSCI 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 informationInf2A: The Pumping Lemma
Inf2A: Stuart Anderson School of Informatics University of Edinburgh October 8, 2009 Outline 1 Deterministic Finite State Machines and Regular Languages 2 3 4 The language of a DFA ( M = Q, Σ, q 0, F,
More informationFinite 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 informationConstructions on Finite Automata
Constructions on Finite Automata Informatics 2A: Lecture 4 Mary Cryan School of Informatics University of Edinburgh mcryan@inf.ed.ac.uk 24 September 2018 1 / 33 Determinization The subset construction
More informationSeptember 11, Second Part of Regular Expressions Equivalence with Finite Aut
Second Part of Regular Expressions Equivalence with Finite Automata September 11, 2013 Lemma 1.60 If a language is regular then it is specified by a regular expression Proof idea: For a given regular language
More informationComputational Models Lecture 2 1
Computational Models Lecture 2 1 Handout Mode Iftach Haitner. Tel Aviv University. October 30, 2017 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice Herlihy, Brown University.
More informationTakeaway Notes: Finite State Automata
Takeaway Notes: Finite State Automata Contents 1 Introduction 1 2 Basics and Ground Rules 2 2.1 Building Blocks.............................. 2 2.2 The Name of the Game.......................... 2 3 Deterministic
More informationCSE 311 Lecture 25: Relating NFAs, DFAs, and Regular Expressions. Emina Torlak and Kevin Zatloukal
CSE 3 Lecture 25: Relating NFAs, DFAs, and Regular Expressions Emina Torlak and Kevin Zatloukal Topics From regular expressions to NFAs Theorem, algorithm, and examples. From NFAs to DFAs Theorem, algorithm,
More informationComputational Models Lecture 2 1
Computational Models Lecture 2 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. March 16/18, 2015 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice
More information1 Showing Recognizability
CSCC63 Worksheet Recognizability and Decidability 1 1 Showing Recognizability 1.1 An Example - take 1 Let Σ be an alphabet. L = { M M is a T M and L(M) }, i.e., that M accepts some string from Σ. Prove
More informationChapter 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 informationIntroduction 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 informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/ Today's learning goals Sipser Section 1.4 Explain the limits of the class of regular languages Justify why the
More informationClosure 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 Automata that accept (or reject) words of infinite length. Languages of infinite words appear:
ω-automata ω-automata Automata that accept (or reject) words of infinite length. Languages of infinite words appear: in verification, as encodings of non-terminating executions of a program. in arithmetic,
More informationLanguages. 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 informationDeterministic Finite Automata (DFAs)
Algorithms & Models of Computation CS/ECE 374, Fall 27 Deterministic Finite Automata (DFAs) Lecture 3 Tuesday, September 5, 27 Sariel Har-Peled (UIUC) CS374 Fall 27 / 36 Part I DFA Introduction Sariel
More informationDeterministic Finite Automata (DFAs)
CS/ECE 374: Algorithms & Models of Computation, Fall 28 Deterministic Finite Automata (DFAs) Lecture 3 September 4, 28 Chandra Chekuri (UIUC) CS/ECE 374 Fall 28 / 33 Part I DFA Introduction Chandra Chekuri
More informationNon-deterministic Finite Automata (NFAs)
Algorithms & Models of Computation CS/ECE 374, Fall 27 Non-deterministic Finite Automata (NFAs) Part I NFA Introduction Lecture 4 Thursday, September 7, 27 Sariel Har-Peled (UIUC) CS374 Fall 27 / 39 Sariel
More informationRegular Language Equivalence and DFA Minimization. Equivalence of Two Regular Languages DFA Minimization
Regular Language Equivalence and DFA Minimization Equivalence of Two Regular Languages DFA Minimization Decision Property: Equivalence Given regular languages L and M, is L = M? Algorithm involves constructing
More informationComputational Theory
Computational Theory Finite Automata and Regular Languages Curtis Larsen Dixie State University Computing and Design Fall 2018 Adapted from notes by Russ Ross Adapted from notes by Harry Lewis Curtis Larsen
More informationCS243, Logic and Computation Nondeterministic finite automata
CS243, Prof. Alvarez NONDETERMINISTIC FINITE AUTOMATA (NFA) Prof. Sergio A. Alvarez http://www.cs.bc.edu/ alvarez/ Maloney Hall, room 569 alvarez@cs.bc.edu Computer Science Department voice: (67) 552-4333
More informationFinite Automata. BİL405 - Automata Theory and Formal Languages 1
Finite Automata BİL405 - Automata Theory and Formal Languages 1 Deterministic Finite Automata (DFA) A Deterministic Finite Automata (DFA) is a quintuple A = (Q,,, q 0, F) 1. Q is a finite set of states
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2017 http://cseweb.ucsd.edu/classes/sp17/cse105-ab/ Today's learning goals Sipser Ch 1.4 Explain the limits of the class of regular languages Justify why the Pumping
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/ Today's learning goals Sipser Section 1.1 Design an automaton that recognizes a given language. Specify each of
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 4.1, 5.1 Define reductions from one problem to another. Use reductions to prove
More informationDFA to Regular Expressions
DFA to Regular Expressions Proposition: If L is regular then there is a regular expression r such that L = L(r). Proof Idea: Let M = (Q,Σ, δ, q 1, F) be a DFA recognizing L, with Q = {q 1,q 2,...q n },
More informationChapter 5. Finite Automata
Chapter 5 Finite Automata 5.1 Finite State Automata Capable of recognizing numerous symbol patterns, the class of regular languages Suitable for pattern-recognition type applications, such as the lexical
More informationTheory 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 informationCS 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 informationTheory 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 informationIntro to Theory of Computation
Intro to Theory of Computation 1/19/2016 LECTURE 3 Last time: DFAs and NFAs Operations on languages Today: Nondeterminism Equivalence of NFAs and DFAs Closure properties of regular languages Sofya Raskhodnikova
More informationFORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY THE PUMPING LEMMA FOR REGULAR LANGUAGES and REGULAR EXPRESSIONS TUESDAY Jan 21 WHICH OF THESE ARE REGULAR? B = {0 n 1 n n 0} C = { w w has equal number
More informationCSE 105 Homework 3 Due: Monday October 23, Instructions. should be on each page of the submission.
CSE 5 Homework 3 Due: Monday October 23, 27 Instructions Upload a single file to Gradescope for each group. should be on each page of the submission. All group members names and PIDs Your assignments in
More informationFORMAL 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 informationGreat 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 informationCS 154. Finite Automata vs Regular Expressions, Non-Regular Languages
CS 154 Finite Automata vs Regular Expressions, Non-Regular Languages Deterministic Finite Automata Computation with finite memory Non-Deterministic Finite Automata Computation with finite memory and guessing
More informationFinite 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 informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/ Today's learning goals Sipser Section 1.1 Determine if a language is regular Apply closure properties to conclude
More informationClosure 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 informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 1.4 Give an example of a non-regular language Outline two strategies for proving
More informationAutomata 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 informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 3.3, 4.1 State and use the Church-Turing thesis. Give examples of decidable problems.
More informationFinite Automata (contd)
Finite Automata (contd) CS 2800: Discrete Structures, Fall 2014 Sid Chaudhuri Recap: Deterministic Finite Automaton A DFA is a 5-tuple M = (Q, Σ, δ, q 0, F) Q is a fnite set of states Σ is a fnite input
More informationNFAs continued, Closure Properties of Regular Languages
Algorithms & Models of Computtion CS/ECE 374, Fll 2017 NFAs continued, Closure Properties of Regulr Lnguges Lecture 5 Tuesdy, Septemer 12, 2017 Sriel Hr-Peled (UIUC) CS374 1 Fll 2017 1 / 31 Regulr Lnguges,
More informationPropositional Logic: Models and Proofs
Propositional Logic: Models and Proofs C. R. Ramakrishnan CSE 505 1 Syntax 2 Model Theory 3 Proof Theory and Resolution Compiled at 11:51 on 2016/11/02 Computing with Logic Propositional Logic CSE 505
More informationCSCE 551 Final Exam, April 28, 2016 Answer Key
CSCE 551 Final Exam, April 28, 2016 Answer Key 1. (15 points) Fix any alphabet Σ containing the symbol a. For any language L Σ, define the language a\l := {w Σ wa L}. Show that if L is regular, then a\l
More informationCS 322 D: Formal languages and automata theory
CS 322 D: Formal languages and automata theory Tutorial NFA DFA Regular Expression T. Najla Arfawi 2 nd Term - 26 Finite Automata Finite Automata. Q - States 2. S - Alphabets 3. d - Transitions 4. q -
More informationCS 154. Finite Automata, Nondeterminism, Regular Expressions
CS 54 Finite Automata, Nondeterminism, Regular Expressions Read string left to right The DFA accepts a string if the process ends in a double circle A DFA is a 5-tuple M = (Q, Σ, δ, q, F) Q is the set
More informationComputer Sciences Department
1 Reference Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER 3 objectives Finite automaton Infinite automaton Formal definition State diagram Regular and Non-regular
More information2. Elements of the Theory of Computation, Lewis and Papadimitrou,
Introduction Finite Automata DFA, regular languages Nondeterminism, NFA, subset construction Regular Epressions Synta, Semantics Relationship to regular languages Properties of regular languages Pumping
More information11-711: Algorithms for NLP Homework Assignment #1: Formal Language Theory Solutions
-: Algorithms for NLP Homework Assignment #: Formal Language Theory Solutions Out: September 4, 204 Due: September 8, 204 Problem [5 points] Prove that, for any deterministic FSA A = (Q, Σ, δ, q 0, F,
More informationSuppose h maps number and variables to ɛ, and opening parenthesis to 0 and closing parenthesis
1 Introduction Parenthesis Matching Problem Describe the set of arithmetic expressions with correctly matched parenthesis. Arithmetic expressions with correctly matched parenthesis cannot be described
More informationFinite Universes. L is a fixed-length language if it has length n for some
Finite Universes Finite Universes When the universe is finite (e.g., the interval 0, 2 1 ), all objects can be encoded by words of the same length. A language L has length n 0 if L =, or every word of
More informationNondeterministic finite automata
Lecture 3 Nondeterministic finite automata This lecture is focused on the nondeterministic finite automata (NFA) model and its relationship to the DFA model. Nondeterminism is an important concept in the
More informationfront pad rear pad door
front pad rear pad door REAR BOTH NEITHER closed FRONT open FRONT REAR BOTH NEITHER Think of this as a simple program that outputs one of two values (states) when provided with the current state and an
More informationCSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS
CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS 1. [6 POINTS] For language L 1 = {0 n 1 m n, m 1, m n}, which string is in L 1? ANSWER: 0001111 is in L 1 (with n =
More informationNondeterministic 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 informationCSE 105 THEORY OF COMPUTATION. Spring 2018 review class
CSE 105 THEORY OF COMPUTATION Spring 2018 review class Today's learning goals Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with confidence. Identify areas to focus
More informationComputability Theory
CS:4330 Theory of Computation Spring 2018 Computability Theory Decidable Languages Haniel Barbosa Readings for this lecture Chapter 4 of [Sipser 1996], 3rd edition. Section 4.1. Decidable Languages We
More informationLecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2
BIJU PATNAIK UNIVERSITY OF TECHNOLOGY, ODISHA Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2 Prepared by, Dr. Subhendu Kumar Rath, BPUT, Odisha. UNIT 2 Structure NON-DETERMINISTIC FINITE AUTOMATA
More informationNon-Deterministic Finite Automata
Slides modified Yishay Mansour on modification by Benny Chor, based on original slides by Maurice Herlihy, Brown University. p. 8 Non-Deterministic Finite Automata 0,1 0,1 0 0,ε q q 1 q 2 3 1 q 4 an NFA
More informationConstructions on Finite Automata
Constructions on Finite Automata Informatics 2A: Lecture 4 Alex Simpson School of Informatics University of Edinburgh als@inf.ed.ac.uk 23rd September, 2014 1 / 29 1 Closure properties of regular languages
More informationDeterministic Finite Automata (DFAs)
Algorithms & Models of Computation CS/ECE 374, Spring 29 Deterministic Finite Automata (DFAs) Lecture 3 Tuesday, January 22, 29 L A TEXed: December 27, 28 8:25 Chan, Har-Peled, Hassanieh (UIUC) CS374 Spring
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2017 http://cseweb.ucsd.edu/classes/sp17/cse105-ab/ Today's learning goals Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with
More informationExamples of Regular Expressions. Finite Automata vs. Regular Expressions. Example of Using flex. Application
Examples of Regular Expressions 1. 0 10, L(0 10 ) = {w w contains exactly a single 1} 2. Σ 1Σ, L(Σ 1Σ ) = {w w contains at least one 1} 3. Σ 001Σ, L(Σ 001Σ ) = {w w contains the string 001 as a substring}
More informationFORMAL 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 informationFinite 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 informationLecture 4: More on Regexps, Non-Regular Languages
6.045 Lecture 4: More on Regexps, Non-Regular Languages 6.045 Announcements: - Pset 1 is on piazza (as of last night) - If you don t have piazza access but are registered for 6.045, send email to TAs with
More information