Lecture 7UofH - COSC 3340 - Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 7.

Slides:



Advertisements
Similar presentations
Properties of Regular Sets
Advertisements

1 Let’s Recapitulate. 2 Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Fall 2006Costas Busch - RPI1 Non-regular languages (Pumping Lemma)
CSCI 2670 Introduction to Theory of Computing September 13, 2005.
CSCI 2670 Introduction to Theory of Computing September 15, 2004.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
Lecture 15UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 15.
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)
Introduction to the Theory of Computation John Paxton Montana State University Summer 2003.
1 Introduction to Computability Theory Lecture4: Non Regular Languages Prof. Amos Israeli.
Costas Busch - RPI1 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Courtesy Costas Busch - RPI1 Non-regular languages.
Transparency No. 7-1 Formal Language and Automata Theory Chapter 7 Limitations of Finite Automata (lecture 11 and 12)
Fall 2004COMP 3351 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Lecture 8 Sept 29, 2011 Regular expressions – examples Converting DFA to regular expression. (same works for NFA to r.e. conversion.) Converting R.E. to.
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 27UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 27.
Lecture 5UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 5.
Lecture 4UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 4.
Prof. Busch - LSU1 Non-regular languages (Pumping Lemma)
1 Non-regular languages. 2 Regular languages Non-regular languages.
Chapter 7 Functions Dr. Curry Guinn. Outline of Today Section 7.1: Functions Defined on General Sets Section 7.2: One-to-One and Onto Section 7.3: The.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
Lecture 2UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 2.
Lecture 10UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 10.
Chapter 6 Properties of Regular Languages. 2 Regular Sets and Languages  Claim(1). The family of languages accepted by FSAs consists of precisely the.
CSCI 2670 Introduction to Theory of Computing September 13.
CS 203: Introduction to Formal Languages and Automata
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
Lecture 11UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 11.
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.
Lecture 8UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 8.
MA/CSSE 474 Theory of Computation How many regular/non-regular languages are there? Closure properties of Regular Languages (if there is time) Pumping.
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
CSE 105 theory of computation
Formal Language & Automata Theory
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
COSC 3340: Introduction to Theory of Computation
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
Lecture5 Non-regular languages
Infiniteness Test The Pumping Lemma Nonregular Languages
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
Elementary Questions about Regular Languages
Non-regular languages
Pumping Lemma September 29, 2006
Formal Languages, Automata and Models of Computation
COSC 3340: Introduction to Theory of Computation
More Applications of the Pumping Lemma
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
CSCI 2670 Introduction to Theory of Computing
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
Presentation transcript:

Lecture 7UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 7

UofH - COSC Dr. Verma 2 Are all languages regular? Ans: No. How do we know this? – Ans: Cardinality arguments. Let C(DFA) = {M | M is a DFA}. – C(DFA) is a countable set. Why? Let AL = { L | L is a subset of  *}. – AL is uncountable.

Lecture 7UofH - COSC Dr. Verma 3 Cardinality Def: A set is countable if it is (i) finite or (ii) countably infinite. Def: A set S is countable infinite if there is a bijection from N to S. – Note: Instead of N to S we can also say S to N. N = {0, 1, 2, 3,...} -- the set of natural numbers. Def: A set that is not countable is uncountable. – Or, any infinite set with no bijection from N to itself.

Lecture 7UofH - COSC Dr. Verma 4 Examples 1. The set of chairs in this classroom is finite. 2. The set of even numbers is countably infinite. 3. The set of all subsets of N is uncountable. – Notation: 2 N

Lecture 7UofH - COSC Dr. Verma 5 Exercises What is the cardinality of? 1. Z - the set of integers. 2. N X N = {(a,b) | a, b in N}. 3. R - the set of real numbers.

Lecture 7UofH - COSC Dr. Verma 6 Pumping Lemma First technique to show that specific given languages are not regular. Cardinality arguments show existence of languages that are not regular. There is a big difference between the two!

Lecture 7UofH - COSC Dr. Verma 7 Statement of Pumping Lemma If A is a regular language, then there is a number p (the pumping length) where, if s is any string in A of length at least p, then s may be divided into three pieces, s = xyz, satisfying the following conditions: 1. for each i  0, xy i z  A, 2. |y| > 0, and 3. |xy|  p.

Lecture 7UofH - COSC Dr. Verma 8 Proof of pumping lemma Idea: If a string w of length m is accepted by a DFA with n states, and n < m, then there is a cycle (repeated state) on the directed path from s to a final state labeled w. – Recall: directed path is denoted by  *(s,w). – Uses: Pigeon-hole principle

Lecture 7UofH - COSC Dr. Verma 9 Pigeon-hole principle 4 pigeons 3 pigeonholes

Lecture 7UofH - COSC Dr. Verma 10 Pigeon-hole principle (contd.) A pigeonhole must have two pigeons

Lecture 7UofH - COSC Dr. Verma 11 Pigeon-hole principle (contd.) pigeonholes

Lecture 7UofH - COSC Dr. Verma 12 Details of Proof of Pumping Lemma. Consider L - any infinite regular language. 1. L regular  there is a DFA M with L(M) = L. 2. Let DFA have p states (say). 3. Let w in L be of length more than p. Why does w exist? Ans: because L is infinite. 4.  *(s,w) = f (some final state) must be  *(s, w = xyz) =  *(q,yz) =  *(q,z) = f 5. So xy n z in L for n = 0, 1, 2, 3,.... since  *(s, xy n z) =  *(q, y n z) =  *(q, y {n-1} z) =... =  *(q,z) = f.

Lecture 7UofH - COSC Dr. Verma 13 Describing the pumping lemma Take an infinite regular language DFA that accepts states

Lecture 7UofH - COSC Dr. Verma 14 Describing the pumping lemma (contd.) Take string with There is a walk with label:

Lecture 7UofH - COSC Dr. Verma 15 Describing the pumping lemma (contd.) If string has length number of states Then, from the pigeonhole principle: A state is repeated in the walk......

Lecture 7UofH - COSC Dr. Verma 16 Describing the pumping lemma (contd.) Write......

Lecture 7UofH - COSC Dr. Verma 17 Describing the pumping lemma (contd.) Observations :lengthnumber of states length......

Lecture 7UofH - COSC Dr. Verma 18 Describing the pumping lemma (contd.) The string is acceptedObservation:......

Lecture 7UofH - COSC Dr. Verma 19 Describing the pumping lemma (contd.) The string is accepted Observation:

Lecture 7UofH - COSC Dr. Verma 20 Describing the pumping lemma (contd.) The string is accepted Observation:

Lecture 7UofH - COSC Dr. Verma 21 Describing the pumping lemma (contd.) The string is accepted In General:

Lecture 7UofH - COSC Dr. Verma 22 Some Applications of Pumping Lemma The following languages are not regular. 1. {a n b n | n  0 }. 2. {w = w R | w in {a,b}* } (language of palindromes). 3. {ww R | w in {a,b}*}. 4. {a {n 2 } | n  0}.

Lecture 7UofH - COSC Dr. Verma 23 Tips of the trade -- Do not forget! Closure properties can be used effectively for: (1) shortening cumbersome Pumping lemma arguments. Example: {w in {a, b}* | w has equal a's and b's}. (2) for showing that certain languages are regular. Example: {w in {a, b}* | w begins with a and w contains a b}.

Lecture 7UofH - COSC Dr. Verma 24 References Pigeonhole Principle & Pumping Lema Description – Author: Costas Busch, Rensselaer Polytechnic Institute, NY