Nonregular Languages Section 2.4 Wed, Oct 5, 2005.

Slides:



Advertisements
Similar presentations
Lecture 9,10 Theory of AUTOMATA
Advertisements

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.
CSCI 2670 Introduction to Theory of Computing September 13, 2005.
CS21 Decidability and Tractability
Courtesy Costas Busch - RPI1 More Applications of the Pumping Lemma.
CS 310 – Fall 2006 Pacific University CS310 Pumping Lemma Sections:1.4 page 77 September 27, 2006.
1 More Properties of Regular Languages. 2 We have proven Regular languages are closed under: Union Concatenation Star operation Reverse.
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)
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Limitations.
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.
Lecture 7UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 7.
Prof. Busch - LSU1 Non-regular languages (Pumping Lemma)
Prof. Busch - LSU1 More Applications of the Pumping Lemma.
1 Non-regular languages. 2 Regular languages Non-regular languages.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
The Halting Problem – Undecidable Languages Lecture 31 Section 4.2 Wed, Oct 31, 2007.
Class Discussion Can you draw a DFA that accepts the language {a k b k | k = 0,1,2,…} over the alphabet  ={a,b}?
Properties of Regular Languages
Chapter 6 Properties of Regular Languages. 2 Regular Sets and Languages  Claim(1). The family of languages accepted by FSAs consists of precisely the.
CS355 - Theory of Computation Regular Expressions.
Conversions & Pumping Lemma CPSC 388 Fall 2001 Ellen Walker Hiram College.
CSCI 2670 Introduction to Theory of Computing September 13.
CS 203: Introduction to Formal Languages and Automata
1 Find as many examples as you can of w, x, y, z so that w is accepted by this DFA, w = x y z, y ≠ ε, | x y | ≤ 7, and x y n z is in L for all n ≥ 0.
Nonregular Languages How do you prove a language to be regular? How do you prove a language to be nonregular? A Pumping Lemma.
Equivalence with FA * Any Regex can be converted to FA and vice versa, because: * Regex and FA are equivalent in their descriptive power ** Regular language.
1 Advanced Theory of Computation Finite Automata with output Pumping Lemma Theorem.
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
CSE 105 theory of computation
A Universal Turing Machine
Non-regular languages - The pumping lemma
Complexity and Computability Theory I
Pumping Lemma.
Foundations of Computing Science
Non-regular languages
Standard Representations of Regular Languages
CSE322 PUMPING LEMMA FOR REGULAR SETS AND ITS APPLICATIONS
PROPERTIES OF REGULAR LANGUAGES
CSE 3813 Introduction to Formal Languages and Automata
PDAs Accept Context-Free Languages
Pumping Lemma for Regular Languages some languages are not regular!
Properties of Regular Languages
COSC 3340: Introduction to Theory of Computation
Infiniteness Test The Pumping Lemma Nonregular Languages
Regular Expression We shall build expressions from the symbols using simple operations include concatenation, union and kleen closure. Several intuitive.
Decidable Languages Costas Busch - LSU.
Introduction to Finite Automata
Deterministic PDAs - DPDAs
Properties of Regular Languages
Elementary Questions about Regular Languages
Non-regular languages
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
Pumping Lemma September 29, 2006
Pumping Lemma.
Chapter 4 Properties of Regular Languages
Nonregular languages & the pumping lemma
Proposed in Turing’s 1936 paper
More Applications of the Pumping Lemma
COSC 3340: Introduction to Theory of Computation
Recap lecture 25 Intersection of two regular languages is regular, examples, non regular languages, example.
CHAPTER 1 Regular Languages
CSCI 2670 Introduction to Theory of Computing
Presentation transcript:

Nonregular Languages Section 2.4 Wed, Oct 5, 2005

Countability of the Set of DFAs Theorem: The set of all DFAs (over an alphabet ) is countable. Proof: For a given n > 0, let Sn be the set of all DFAs with exactly n states. How many DFAs are in Sn? There are n choices for the initial state. For each state, there are n|| choices for the transitions coming out of that state. Therefore, there are (n||)n = n||n choices for .

Countability of the Set of DFAs There are 2n choices for the final states. Therefore, the number of DFAs with exactly n states is n  n||n  2n. The set of all DFAs is S1  S2  S3  … This is a countable set since it is the union of a countable number of finite sets. Thus, we can enumerate the DFAs as M0, M1, M2, M3, …

The Existence of a Non-Regular Language There exists a language that is not accepted by any DFA (provided   ). Proof: Let Ln = L(Mn). Let x be any symbol in . Let sn = xn, for all n  0. Define a new language L by the rule that sn  L if and only if sn  Ln. Then L is not equal to any Ln. So L is not accepted by any DFA.

The Existence of a Non-Regular Language This is another example of a diagonalization argument. It is a non-constructive proof. It does not provide us with an example (unless we actually figure out what each Mn is!).

The Existence of a Non-Regular Language Another non-constructive proof is based on a cardinality argument. The set of all languages is 2*, which is uncountable since its cardinality is equal to the cardinality of 2N, which we know to be uncountably infinite. The set of DFAs is countable. Therefore, the function f(M) = L(M) cannot be onto 2*. So, what is an example of a nonregular language?

The Pumping Lemma The Pumping Lemma: Let L be an infinite regular language. There exists an integer n  1 such that any string w  L, with |w|  n, can be represented as the concatenation xyz such that y is non-empty, |xy|  n, and xyiz  L for every i  0.

Proof of the Pumping Lemma Let n be the number of states. Let w be any string in L with at least n symbols. After processing n symbols, we must have returned to a previously visited state (the Pigeonhole Principle). Let q be the first revisited state. Let x be the string processed from s to q. Let y be the string processed around the loop from q back to q. Let z be the string from q to the end, a final state f.

Proof, continued Then clearly |y| > 0 and |xy|  n. It is also clear that xyiz  L for all i  0, since we may travel the loop as many times as we like, including 0 times.

The Pumping Lemma The Pumping Lemma says that if L is regular, then certain properties hold. The contrapositive of the Pumping Lemma says that if certain properties do not hold, then L is not regular. Therefore, you cannot use the Pumping Lemma to conclude that a language is regular, but only that it is not regular. That’s good, because that is exactly what we want to do.

The Standard Example of a Nonregular Language Let L = {aibi | i  0}. Suppose that L is regular. “Let n be the n of the Pumping Lemma” and consider the string w = anbn. Then w can be decomposed as xyz where |y| > 0 and |xy|  n. Therefore, xy consists only of a’s. It follows that y = ak, for some k > 0.

Standard Example of a Nonregular Language According to the Pumping Lemma, xy2z is in L. However, xy2z =an + kbn, which is not in L. since n + k  n. This is a contradiction. Therefore, L is not regular.

A Second Example of a Nonregular Language Let L = {w  * | w contains an equal number of a’s and b’s}. Suppose L is regular. Let L1 = L(a*b*). Then L  L1 = {aibi | i  0} would also be regular, which is a contradiction. Therefore, L is not regular.

More Examples {w  * | w contains an unequal number of a’s and b’s}. {w  * | w contains more a’s than b’s}. {w  * | w = zz for some z  *}. Consider w = anbanb and use the Pumping Lemma. {w  * | w  zz for some z  *}. Notice that we use the Pumping Lemma only when necessary; other arguments are often simpler.