Nondeterministic Automata vs Deterministic Automata

Similar documents
CS311 Computational Structures Regular Languages and Regular Grammars. Lecture 6

Nondeterminism and Nodeterministic Automata

NON-DETERMINISTIC FSA

CS 573 Automata Theory and Formal Languages

Regular languages refresher

Nondeterministic Finite Automata

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER MACHINES AND THEIR LANGUAGES ANSWERS

Technische Universität München Winter term 2009/10 I7 Prof. J. Esparza / J. Křetínský / M. Luttenberger 11. Februar Solution

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

Finite State Automata and Determinisation

Minimal DFA. minimal DFA for L starting from any other

Regular expressions, Finite Automata, transition graphs are all the same!!

Lexical Analysis Finite Automate

Lecture 08: Feb. 08, 2019

Designing finite automata II

2.4 Theoretical Foundations

Prefix-Free Regular-Expression Matching

FABER Formal Languages, Automata and Models of Computation

Convert the NFA into DFA

1 From NFA to regular expression

Non Deterministic Automata. Linz: Nondeterministic Finite Accepters, page 51

Running an NFA & the subset algorithm (NFA->DFA) CS 350 Fall 2018 gilray.org/classes/fall2018/cs350/

Hybrid Systems Modeling, Analysis and Control

Fundamentals of Computer Science

Formal languages, automata, and theory of computation

First Midterm Examination

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

= state, a = reading and q j

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

First Midterm Examination

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1

Formal Languages and Automata

Lecture 6 Regular Grammars

Non-deterministic Finite Automata

Chapter 2 Finite Automata

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

Deterministic Finite Automata

More on automata. Michael George. March 24 April 7, 2014

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

NFA DFA Example 3 CMSC 330: Organization of Programming Languages. Equivalence of DFAs and NFAs. Equivalence of DFAs and NFAs (cont.

1 Nondeterministic Finite Automata

CS375: Logic and Theory of Computing

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

State Complexity of Union and Intersection of Binary Suffix-Free Languages

Thoery of Automata CS402

CSC 311 Theory of Computation

CMSC 330: Organization of Programming Languages

GNFA GNFA GNFA GNFA GNFA

Table of contents: Lecture N Summary... 3 What does automata mean?... 3 Introduction to languages... 3 Alphabets... 3 Strings...

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

CS:4330 Theory of Computation Spring Regular Languages. Equivalences between Finite automata and REs. Haniel Barbosa

Closure Properties of Regular Languages

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS

Petri Nets. Rebecca Albrecht. Seminar: Automata Theory Chair of Software Engeneering

Converting Regular Expressions to Discrete Finite Automata: A Tutorial

Worked out examples Finite Automata

Non-deterministic Finite Automata

Chapter 4 State-Space Planning

Finite Automata-cont d

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA)

Today s Topics Automata and Languages

Automata and Languages

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem 2/16/15

Non-Deterministic Finite Automata

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-*

Automata Theory 101. Introduction. Outline. Introduction Finite Automata Regular Expressions ω-automata. Ralf Huuck.

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016

Harvard University Computer Science 121 Midterm October 23, 2012

CS375: Logic and Theory of Computing

Non Deterministic Automata. Formal Languages and Automata - Yonsei CS 1

Theory of Computation Regular Languages

Normal Forms for Context-free Grammars

Section: Other Models of Turing Machines. Definition: Two automata are equivalent if they accept the same language.

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

Java II Finite Automata I

Let's start with an example:

Chapter 4 Regular Grammar and Regular Sets. (Solutions / Hints)

CHAPTER 1 Regular Languages. Contents

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

Myhill-Nerode Theorem

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

input tape head moves current state

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages

Formal Language and Automata Theory (CS21004)

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh

Chapter 1, Part 1. Regular Languages. CSC527, Chapter 1, Part 1 c 2012 Mitsunori Ogihara 1

Compiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Project 6: Minigoals Towards Simplifying and Rewriting Expressions

Bisimulation, Games & Hennessy Milner logic

Introduction to ω-autamata

Talen en Automaten Test 1, Mon 7 th Dec, h45 17h30

@#? Text Search ] { "!" Nondeterministic Finite Automata. Transformation NFA to DFA and Simulation of NFA. Text Search Using Automata

Transcription:

Nondeterministi Automt vs Deterministi Automt We lerned tht NFA is onvenient model for showing the reltionships mong regulr grmmrs, FA, nd regulr expressions, nd designing them. However, we know tht n NFA is oneptul model tht nnot diretly e uilt euse of the nondeterministi trnsition. Then wht out ll the NFA tht pper in the exmples nd proofs? Are those nondeterministi utomt remin s theoretil model tht nnot ring down to the rel world? For ontext-free lnguges, there re lnguges tht n only e reognized y NPDA, for exmple {xx R x {, } * }. As fr s PDA re onerned, NPDA re stritly more powerful thn DPDA. For LBA, it is open prolem. (Looks like the spe restrition is too muh for DLBA to do the sme omputtion s n NLBA does.) For TM, ny prolem tht n e solved y n NTM n lso e solved y DTM y tring every possile trnsition of n NTM omputtion using its unlimited spe ville. 98

Fortuntely, for NFA there is strightforwrd wy to trnsform them into DFA. (Atully it is sed on the sme ide tht we used to eliminte ε- trnsitions.) The si ide is to onsider the set of sttes tht n e rehle y trnsition s single stte in deterministi trnsition. The following exmple will e enough to understnd the tehnique. (We ssume tht the utomton hs no ε-trnsitions.) strt 1, 2,, strt {,1,2}, {2} {1,2} () An NFA () Converted DFA Notie tht the stte with lel {, 1, 2} is from the set of sttes given y the nondeterministi trnsition δ(, ) = {, 1, 2}. Also notie tht ny stte whose lel ontins n epting stte is defined s n epting stte in the deterministi mhine. 99

Minimiztion Tehnique for DFA The numer of sttes of n utomton hs diret ffet to the size of the mhine relizing the utomton. Hene, it is very importnt to redue the numer of sttes, if possile. For PDA, LBA nd TM, it is very diffiult prolem to redue the numer of sttes. However, for DFA there is very effiient lgorithm for minimizing the numer of sttes of given DFA. Figure () elow is prt of the stte trnsition grph of DFA M = ( Q, Σ, δ, q, F ), where Σ = {, }. Clerly, for every w Σ *, δ( q 3, w ) is in n epting stte if nd only if δ( q 4, w ) is. Hene, we n merge q 3 nd q 4 into single stte s shown in Figure () without ffeting the lnguge of the mhine. q 1 q 3 q 1 q 34 q 2 q 4 q 2 Figure () Figure () 1

Stte Redution y Prtitioning We sy two sttes p nd q re equivlent (or indistinguishle), if, for every string w Σ *, trnsition δ( p, w ) ends in n epting stte if nd only if δ( q, w) does. In the preeding slide sttes q 3 nd q 4 re equivlent. There re effiient lgorithms ville for omputing the sets of equivlent sttes of given DFA. The following exmple shows proedure using the set prtitioning tehnique. The tehnique is similr to one tht they use for prtitioning people into groups (eh hving ertin preferenes) sed on their responses to questionnire. The following two slides show the detiled steps for omputing equivlent stte sets of the DFA in Figure () nd onstruting the redued DFA shown in Figure (). 1 2 Figure () A DFA 3 4 5, 1,2 3 4,5 Figure () Redued DFA, 11

Stte Redution y Prtitioning(ont ed) Step : Prtition the sttes ording to epting/non-epting. P 1 P 2 { 3, 4, 5 } {, 1, 2 } Figure () Initil prtition For stte q nd symol t, let P i e the response of q on t, if δ(q, t) enters stte in P i. Ste: Get the response of eh stte for eh input symol. Notie tht Sttes 3 nd show different responses from the ones of the other sttes in the sme set. P 1 P 2 p 2 fi fi {3, 4, 5 } {, 1, 2 } fi fl fl fl fi fl fl fl p 2 p 2 Figure () Reord responses for eh input symol 12

Step 2: Prtition the sets ording to the responses, nd go to Ste until no prtition ours. P 11 P 12 P 21 P 22 1 1 2 2 {4, 5} {3} {1, 2} {} 1 1 1 1 Figure () Prtition the set, nd reord responses for eh input symol No further prtition is possile for the sets P 11 nd P 21. So the finl prtition results re s follows. {4, 5} {3} {1, 2} {} (d) Finl prtition 13