CS 461 – Sept. 12 Simplifying FA’s. –Let’s explore the meaning of “state”. After all if we need to simplify, this means we have too many states. –Myhill-Nerode.

Slides:



Advertisements
Similar presentations
Regular operations Sipser 1.1 (pages 44 – 47). CS 311 Fall Building languages If L is a language, then its complement is L’ = {w | w ∉ L} Let A.
Advertisements

Lecture 9,10 Theory of AUTOMATA
CS 461 – Nov. 9 Chomsky hierarchy of language classes –Review –Let’s find a language outside the TM world! –Hints: languages and TM are countable, but.
Fall 2006Costas Busch - RPI1 Non-regular languages (Pumping Lemma)
3.2 Pumping Lemma for Regular Languages Given a language L, how do we know whether it is regular or not? If we can construct an FA to accept the language.
January 7, 2015CS21 Lecture 21 CS21 Decidability and Tractability Lecture 2 January 7, 2015.
CS21 Decidability and Tractability
Introduction to Computability Theory
Regular operations Sipser 1.1 (pages 44 – 47). CS 311 Mount Holyoke College 2 Building languages If L is a language, then its complement is L’ = {w |
1 Introduction to Computability Theory Lecture2: Non Deterministic Finite Automata Prof. Amos Israeli.
1 Lecture 22 Myhill-Nerode Theorem –distinguishability –equivalence classes of strings –designing FSA’s –proving a language L is not regular.
Courtesy Costas Busch - RPI1 More Applications of the Pumping Lemma.
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
1 Introduction to Computability Theory Lecture2: Non Deterministic Finite Automata (cont.) Prof. Amos Israeli.
Transparency No Formal Language and Automata Theory Chapter 10 The Myhill-Nerode Theorem (lecture 15,16 and B)
1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
Decidability. Why study un-solvability? When a problem is algorithmically unsolvable, we realize that the problem must be simplified or altered before.
Costas Busch - RPI1 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
CS5371 Theory of Computation Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression)
1 Finite Automata. 2 Finite Automaton Input “Accept” or “Reject” String Finite Automaton Output.
Regular Expression (EXTRA)
CHAPTER 4 Decidability Contents Decidable Languages
1 Single Final State for NFAs and DFAs. 2 Observation Any Finite Automaton (NFA or DFA) can be converted to an equivalent NFA with a single final state.
1 More Applications of the Pumping Lemma. 2 The Pumping Lemma: Given a infinite regular language there exists an integer for any string with length we.
Courtesy Costas Busch - RPI1 Non-regular languages.
Fall 2004COMP 3351 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Fall 2006Costas Busch - RPI1 More Applications of the Pumping Lemma.
FSA Lecture 1 Finite State Machines. Creating a Automaton  Given a language L over an alphabet , design a deterministic finite automaton (DFA) M such.
Prof. Busch - LSU1 Non-regular languages (Pumping Lemma)
Prof. Busch - LSU1 More Applications of the Pumping Lemma.
Reflexive -- First sentence of proof is: (1) Let x  Z (2) Let (x,x)  R. (3) Let (x,x)  I (4) Let x  R.
1 Non-regular languages. 2 Regular languages Non-regular languages.
1 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY For next time: Read 2.1 & 2.2.
1 Module 24 Myhill-Nerode Theorem –distinguishability –equivalence classes of strings –designing FSA’s –proving a language L is not regular.
Fall 2004COMP 3351 Regular Expressions. Fall 2004COMP 3352 Regular Expressions Regular expressions describe regular languages Example: describes the language.
Extra on Regular Languages and Non-Regular Languages
Chapter 4 Context-Free Languages Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
Lower Bounds on the Time-complexity of Non-regular Languages on One-tape Turing Machine Miaohua Xu For Theory of Computation II Professor: Geoffrey S.
MYHILL NERODE THEOREM By Anusha Tilkam. Myhill Nerode Theorem: The following three statements are equivalent 1.The set L є ∑* is accepted by a FSA 2.L.
Introduction to CS Theory
Kleene’s Theorem Group No. 3 Presented To Mam Amina Presented By Roll No Roll No Roll No Roll No Group No. 3 Presented To Mam.
Complexity and Computability Theory I Lecture #2 Rina Zviel-Girshin Leah Epstein Winter
Recognizing safety and liveness Presented by Qian Huang.
1 Recap lecture 27 Pumping lemma version II, proof, examples, Myhill Nerode theorem, examples.
Formal Definition of Computation Let M = (Q, ∑, δ, q 0, F) be a finite automaton and let w = w 1 w w n be a string where each wi is a member of the.
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
D E C I D A B I L I T Y 1. 2 Objectives To investigate the power of algorithms to solve problems. To explore the limits of algorithmic solvability. To.
CS 203: Introduction to Formal Languages and Automata
Chapter 3 Regular Expressions, Nondeterminism, and Kleene’s Theorem Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction.
Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
MA/CSSE 474 Theory of Computation Minimizing DFSMs.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
1 Recap lecture 28 Examples of Myhill Nerode theorem, Quotient of a language, examples, Pseudo theorem: Quotient of a language is regular, prefixes of.
 2005 SDU Lecture11 Decidability.  2005 SDU 2 Topics Discuss the power of algorithms to solve problems. Demonstrate that some problems can be solved.
1 Closure E.g., we understand number systems partly by understanding closure properties: Naturals are closed under +, , but not -, . Integers are closed.
Lecture #4 Thinking of designing an abstract machine acts as finite automata. Advanced Computation Theory.
1 Advanced Theory of Computation Finite Automata with output Pumping Lemma Theorem.
The Acceptance Problem for TMs
Standard Representations of Regular Languages
CSE322 PUMPING LEMMA FOR REGULAR SETS AND ITS APPLICATIONS
PROPERTIES OF REGULAR LANGUAGES
Busch Complexity Lectures: Reductions
Reductions Costas Busch - LSU.
Chapter 2 FINITE AUTOMATA.
Decidable Languages Costas Busch - LSU.
CSE322 Minimization of finite Automaton & REGULAR LANGUAGES
Recap lecture 26 Example of nonregular language, pumping lemma version I, proof, examples,
Recap lecture 18 NFA corresponding to union of FAs,example, NFA corresponding to concatenation of FAs,examples, NFA corresponding to closure of an FA,examples.
Recap lecture 19 NFA corresponding to Closure of FA, Examples, Memory required to recognize a language, Example, Distinguishing one string from another,
CHAPTER 1 Regular Languages
Presentation transcript:

CS 461 – Sept. 12 Simplifying FA’s. –Let’s explore the meaning of “state”. After all if we need to simplify, this means we have too many states. –Myhill-Nerode theorem –Handout on simplifying

What is a state? No matter what next input symbol is, all words in same state act alike. x, y same state   z, xz same state as yz A state is a collection of words that react to input in the same way. need 1  , 1 Example: 0*10* state = 0*state = 0*10*state = 0*10*1 (0 + 1)*

Equivalent states Whether we’ve seen even or odd number of 0’s shouldn’t matter. Only concern is ultimate outcome: will string be accepted or not? Words x and y should be in same state if  z, xz and yz have the same outcome. even  11 00, 1 odd 00 1

In other words The 2 machines are equivalent. From stateInput 0Input 1  Need 1 Good Good Bad From stateInput 0Input 1  EvenOddGood OddEvenGood Good Bad

Myhill-Nerode theorem Basis for simplification algorithm. Also gives condition for a set to be regular. –i.e. infinite # states not allowed. 3 parts to theorem: 1.For any language L, we have equivalence relation R: xRy if  z, xz and yz same outcome. 2.If L is regular, # of equivalences classes is finite. 3.If # equivalences classes finite, language is regular.

Proof (1) For any language L, we have equivalence relation R:xRy if  z, xz and yz same outcome. To show a relation is an equivalence relation, must show it is reflexive, symmetric and transitive. Reflexive: xz and xz have same outcome. (i.e. both are accepted, or both are rejected.) Symmetric. If xz has same outcome as yz, then yz has same outcome as xz. Transitive. If xz has same outcome as yz, and yz has same outcome as tz, then xz has same outcome as tz. All 3 are obviously correct.

Proof (2) If L is regular, # of equivalences classes is finite. Regular means L is recognized by some FA. Thus, # of states is finite. It turns out that (# equiv classes) <= (# states) Why? Because 2 states may be “equivalent.” More importantly: # classes can’t exceed # states. Proof: Assume # classes > # states. Then we have a state representing 2 classes. In other words, x and y in the same state but x not related to y. Meaning that  z where xz, yz don’t have same fate but travel thru the same states! This makes no sense, so we have a contradiction. Since (# equiv classes) <= (# states) and # states is finite, we have that # equiv classes is finite.

Proof (3) If # equivalences classes finite, language is regular. We prove regularity by describing how to construct an FA. Class containing ε would be our start state. For each class: consider 2 words x and y. –x0 and y0 have to be in the same class. –x1 and y1 have to be in the same class. –From this observation, we can draw appropriate transitions. –Since states are being derived from classes, the number of states is also finite. Accept states are classes containing words in L.

Example L = { all bit strings with exactly two 1’s } has 4 equivalence classes [ ε ], [ 1 ], [ 11 ], [ 111 ] Let’s consider the class [ 11 ]. This includes words such as 11 and –If we append a 0, we get 110 and These words also belong in [ 11 ]. –If we append a 1, we get 111 and These words belong in the class [ 111 ]. This is the same thought process we use when creating FA’s transitions anyway.

Learning from theorem There exist non-regular languages! It happens if # of equivalence classes is infinite. –Soon we’ll discuss another method for determining non-regularity that’s a little easier. Part 3 of proof tells us that there is an FA with the minimum number of states (states = equivalence classes). –See simplification algorithm handout.

Example Should x=0 and y=00 be in the same class? No! Consider z = 1. Then xz = 01 and yz = 001. Different outcome! ∞ # classes  Can’t draw FA. Equivalence classes are usually hard to conceive of, so we’ll rely more on a different way to show languages not regular. no 0’sone 0two 0’s Etc. c 1 = { ε }c 2 = { 0 }c 3 = { 00 }c 4 = { 000 } Is { 0 n 1 n } regular? This is the language ε, 01, 0011, , etc. 000