More on showing L non-regular

Slides:



Advertisements
Similar presentations
Theory Of Automata By Dr. MM Alam
Advertisements

Foundations of (Theoretical) Computer Science Chapter 1 Lecture Notes (more on Section 1.4) David Martin This work is licensed under.
1 Module 36 Non context-free languages –Examples and Intuition Pumping lemma for CFL’s –Pumping condition –No proof of pumping lemma –Applying pumping.
MA/CSSE 474 Theory of Computation More on showing L non-regular (Using Closure)
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
1 Let L= { w= u v : u  {a, b}*, v  {c, d}* and |u|= |v|} 1.Design a context-free grammar that generates L. 2.Use your grammar and the construction from.
MA/CSSE 474 Theory of Computation More Reduction Examples Non-SD Reductions.
Regular and Nonregular Languages Chapter 8. Languages: Regular or Not? a * b * is regular. { a n b n : n  0} is not. {w  { a, b }* : every a is immediately.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Closure.
MA/CSSE 474 Theory of Computation Enumerability Reduction.
Regular and Nonregular Languages Chapter 8. Languages: Regular or Not? a * b * is regular. { a n b n : n  0} is not. {w  { a, b }* : every a is immediately.
MA/CSSE 474 Theory of Computation Regular Expressions Intro.
1 L= { w c w R : w  {a, b}* } is accepted by the PDA below. Use a construction like the one for intersection for regular languages to design a PDA that.
CS 3240 – Chapter 4.  Closure Properties  Algorithms for Elementary Questions:  Is a given word, w, in L?  Is L empty, finite or infinite?  Are L.
Closure Properties Lemma: Let A 1 and A 2 be two CF languages, then the union A 1  A 2 is context free as well. Proof: Assume that the two grammars are.
Properties of Regular Languages
CS355 - Theory of Computation Regular Expressions.
1 Closure Properties of Regular Languages L 1 and L 2 are regular. How about L 1  L 2, L 1  L 2, L 1 L 2, L 1, L 1 * ?
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.
MA/CSSE 474 Theory of Computation Minimizing DFSMs.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Bottom-up parsing Pumping Theorem for CFLs MA/CSSE 474 Theory of Computation.
1 Recap lecture 28 Examples of Myhill Nerode theorem, Quotient of a language, examples, Pseudo theorem: Quotient of a language is regular, prefixes of.
MA/CSSE 474 Theory of Computation How many regular/non-regular languages are there? Closure properties of Regular Languages (if there is time) Pumping.
MA/CSSE 474 Theory of Computation Languages, prefixes, sets, cardinality, functions.
1 Use the pumping theorem for context-free languages to prove that L= { a n b a n b a p : n, p ≥ 0, p ≥ n } is not context-free. Hint: For the pumping.
MA/CSSE 474 Theory of Computation Regular Expressions Intro.
Context-Free and Noncontext-Free Languages Chapter 13.
Decidability and Undecidability Proofs
MA/CSSE 473 Day 07 Extended Euclid's Algorithm Modular Division
Pumping Lemma.
Discrete Structures for Computer Science
CSE 105 theory of computation
PROPERTIES OF REGULAR LANGUAGES
Properties of Regular Languages
Languages, prefixes, sets, cardinality, functions
Poetry The Pumping Lemma
CSE 3813 Introduction to Formal Languages and Automata
MA/CSSE 474 Decision Problems about Regular Languages
Hierarchy of languages
Properties of Regular Languages
Chapter Fourteen: The Context-Free Frontier
Properties of Regular Languages
Pumping Lemma.
Chapter 4 Properties of Regular Languages
Bottom-up parsing Pumping Theorem for CFLs
CS21 Decidability and Tractability
MA/CSSE 474 Theory of Computation Minimizing DFSMs.
MA/CSSE 474 Theory of Computation
Recap lecture 26 Example of nonregular language, pumping lemma version I, proof, examples,
Languages, prefixes, sets, cardinality, functions
MA/CSSE 474 Theory of Computation Computation FSM Intro.
Regular Languages ภาษาปกติ.
Poetry The Pumping Lemma
Instructor: Aaron Roth
Pumping Theorem Examples
MA/CSSE 474 Theory of Computation Nondeterminism NFSMs.
More on showing L non-regular
MA/CSSE 474 DFSM to RE Theory of Computation
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 25 Intersection of two regular languages is regular, examples, non regular languages, example.
Minimize # states in a DFSM
CSE 105 theory of computation
Pumping Theorem for CFLs
MA/CSSE 474 Theory of Computation
More About Nondeterminism
MA/CSSE 474 Theory of Computation
Presentation transcript:

More on showing L non-regular MA/CSSE 474 Theory of Computation More on showing L non-regular (Using Closure) Slides 8-10 were hidden for 201220. I unhid for 201240, should probably hide again for 201420

This one has so many levels … Your Questions? This one has so many levels … Previous class days' material Reading Assignments HW 7 or 8 problems Exam 2 Anything else

Recap: Use Pumping Theorem Effectively ● To choose w: ● Choose a w that is in the part of L that makes it not regular. ● Choose a w that is only barely in L. ● Choose a w with as homogeneous as possible an initial region of length at least k. ● To choose q: ● Try letting q be either 0 or 2. ● If that doesn’t work, analyze L to see if there is some other specific value that will work.

{abanbn : n  0} Choose w = abakbk k a b a a a a a a a a a a b b b b b b b b b b b x y z What are the choices for (x, y): (, a) (, ab) (, aba+) (a, b) (a, ba+) (ab, a+) (aba*, a+) In Winter, 2013-14, we did this example Day 17 in Section 02 only. In Section 03, a student asked an excellent question at the beginning that took a long time to answer. Suggest that students can how how to pump each one.

A Different Approach to abanbn? Can we argue as follows: We already know that {anbn: n  0} is not regular. So neither is L. Can we defend this argument by appeal to the fact that the regular languages are closed under concatenation: L = ab || {anbn: n  0} ? regular not regular Then answer is NO! Note that we COULD use closure under reverse!, and using the pumping lemma on the reverse of this is easy.

Using the Closure Properties The two most useful properties are closure under: Intersection Complement

Using Closure Properties L = {w  {a, b}*: #a(w) = #b(w)} If L were regular, then: L = L  _______ would also be regular. But it isn’t. Answer: a*b*. The intersection is AnBn which we already showed to not be regular.

L = {aibj: i, j  0 and i  j} Try to use the Pumping Theorem by letting w = akbk+k!. Then y = ap for some nonzero p. Let q = (k!/p) + 1 (i.e., pump in (k!/p) times). Note that (k!/p) must be an integer because p < k. The number of a’s in the new string is k + (k!/p)p = k + k!. So the new string is ak+k!bk+k!, which has equal numbers of a’s and b’s and so is not in L. This slide is animated.

L = {aibj: i, j  0 and i  j} An easier way: If L is regular then so is L. Is L regular? L = AnBn  {out of order} If L is regular, then so is L = L  a*b* = ___________

L = {aibjck: i, j, k ≥ 0 and (if i = 1 then j = k)} Every string in L of length at least 1 is pumpable. But is L regular?

L = {aibjck: i, j, k ≥ 0 and (if i = 1 then j = k)} Every string in L of length at least 1 is pumpable. Rewrite the final condition as: (i  1) or (j = k)

L = {aibjck: i, j, k ≥ 0 and (i  1 or j = k)} Every string in L of length at least 1 is pumpable: If w has i = 0: if j  0, let y be b; otherwise, let y be c. Let q=0 or q>1. In each case i will still be 0 and thus not equal to 1, so the resulting string is in L. If i = 1: let y be a. Let q=0 or q>1. Then i will no longer equal 1, so the resulting string is in L. If i = 2: let y be aa. Let q=0 or q>1. Then i cannot equal 1, so the resulting string is in L. If i > 2: let y = a. Let q=0 or q>1. Then i cannot equal 1, so the resulting string is in L.

L = {aibjck: i, j, k ≥ 0 and (i  1 or j = k)} But the closure theorems help. Suppose we guarantee that i = 1. If L is regular, then so is: L = L  ab*c*. L = {abjck : j, k ≥ 0 and j = k} We can easily use the Pumping Theorem to show that L is not regular:

L = {aibjck: i, j, k ≥ 0 and (i  1 or j = k)} An Alternative If L is regular, then so is LR: LR = {ckbjai : i, j, k ≥ 0 and (i  1 or j = k)} Use Pumping to show that LR is not regular:

Exploiting Problem-Specific Knowledge L = {w  {0, 1, 2, 3, 4 ,5, 6, 7}*: w is the octal representation of a nonnegative integer that is divisible by 7} This is very similar to things we have done before, so we will not discuss it in class. If you don't recall our "multiple of 3" machine, read the brief explanation of this problem on page 178.

Is English Regular? Also not done in class, but worth reading on page 179 of our textbook.

Closure under Functions from one Language to Another Let firstchars(L) = {w : yL (y=cx ∧ cL ∧ xL*∧ w  c*)} Are the regular languages closed under firstchars? L firstchars(L)  a*b* ca*cb* Copy the page form the book and take to class.

Closure under Functions from one Language to Another Let chop(L) = {w : xL ( x = x1cx2, x1  L*, x2  L*, c  L, |x1| = |x2|, and w = x1x2)} Are the regular languages closed under chop? L chop(L)  a*b* a*db*

Closure under Functions from One Language to Another We did not do this in class, but it would be good practice. Then read the textbook to check your work Let maxstring(L) = {w: w  L, z * (z    wz  L)} Are the regular languages closed under maxstring? L maxstring(L)  a*b* ab*a a*b*a

Closure under Functions from One Language to Another Let mix(L) = {w: x, y, z (x  L, x = yz, |y| = |z|, w = yzR)}. Are the regular languages closed under mix? We did not do this in class, but it would be good practice. Then read the textbook to check your work L mix(L)  (a  b)* (ab)* (ab)*a(ab)*