Announcements Midterm is Wednesday June 23 in class.

Slides:



Advertisements
Similar presentations
CSCI 3130: Formal languages and automata theory Tutorial 5
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.
Let L= { a n b m c p : n ≠ p, and n, m, p ≥ 0} 1.Design a context-free grammar that generates L. 2. Design a PDA that accepts L.
1 Introduction to Computability Theory Discussion3: Uses of the Pumping Lemma Prof. Amos Israeli.
Courtesy Costas Busch - RPI1 More Applications of the Pumping Lemma.
1 More Properties of Regular Languages. 2 We have proven Regular languages are closed under: Union Concatenation Star operation Reverse.
1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
Costas Busch - RPI1 NPDAs Accept Context-Free Languages.
Costas Busch - RPI1 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Courtesy Costas Busch - RPI1 NPDAs Accept Context-Free Languages.
Fall 2004COMP 3351 Single Final State for NFA. Fall 2004COMP 3352 Any NFA can be converted to an equivalent NFA with a single final state.
Fall 2004COMP 3351 NPDA’s Accept Context-Free 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.
Homework 4 Solutions.
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.
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 A Single Final State for Finite Accepters. 2 Observation Any Finite Accepter (NFA or DFA) can be converted to an equivalent NFA with a single final.
Fall 2004COMP 3351 Regular Expressions. Fall 2004COMP 3352 Regular Expressions Regular expressions describe regular languages Example: describes the language.
Final Exam Review Cummulative Chapters 0, 1, 2, 3, 4, 5 and 7.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
Problem of the DAY Create a regular context-free grammar that generates L= {w  {a,b}* : the number of a’s in w is not divisible by 3} Hint: start by designing.
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.
1 State SymbolRead- Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
1 Problem of the Day: Factor (ab) k as xyz in all ways such that y ≠ ε.
CSCI 2670 Introduction to Theory of Computing September 22, 2005.
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.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 11 Midterm Exam 2 -Context-Free Languages Mälardalen University 2005.
Chapter 4 Pumping Lemma Properties of Regular Languages Decidable questions on Regular Languages.
Class Discussion Can you draw a DFA that accepts the language {a k b k | k = 0,1,2,…} over the alphabet  ={a,b}?
1 A well-parenthesized string is a string with the same number of (‘s as )’s which has the property that every prefix of the string has at least as many.
CSCI 3130: Formal languages and automata theory Tutorial 3 Chin.
Critique this PDA for L= { u u R v v R : u ∈ {0,1}* and v ∈ {0,1}+ } u0εu0 u1εu1 uεεvε v00vε v11vε vεεfε sεεtε t0εt0 t1εt1 t00tε t11tε tεεuε After you.
CSCI 2670 Introduction to Theory of Computing September 23, 2004.
1 Applications of pumping lemma(Dr. Torng) Applications of Pumping Lemma –General proof template What is the same in every proof What changes in every.
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.
Cs466(Prasad)L11PLEG1 Examples Applying Pumping Lemma.
1 A well-parenthesized string is a string with the same number of (‘s as )’s which has the property that every prefix of the string has at least as many.
P Symbol Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
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.
Lecture #5 Advanced Computation Theory Finite Automata.
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
Non-regular languages
Standard Representations of Regular Languages
CSE322 PUMPING LEMMA FOR REGULAR SETS AND ITS APPLICATIONS
NPDAs Accept Context-Free Languages
PDAs Accept Context-Free Languages
NPDAs Accept Context-Free Languages
Single Final State for NFA
Infiniteness Test The Pumping Lemma Nonregular Languages
DPDA Deterministic PDA
COSC 3340: Introduction to Theory of Computation
Deterministic PDAs - DPDAs
Elementary Questions about Regular Languages
Non-regular languages
Chapter 4 Properties of Regular Languages
The Pumping Lemma for CFL’s
Recap lecture 26 Example of nonregular language, pumping lemma version I, proof, examples,
More Applications of the Pumping Lemma
COSC 3340: Introduction to Theory of Computation
DPDA Deterministic PDA
CSCI 2670 Introduction to Theory of Computing
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Presentation transcript:

Announcements Midterm is Wednesday June 23 in class. There will be no tutorial next week (Tuesday June 29). A midterm study aid lists the material you are responsible for on the midterm. Many old midterms are posted. Look at old finals for questions on CFG’s and PDA’s (these are also posted).

The next slides are examples of incorrect solutions to the assignment questions. Why are these not correct solutions? Critique these responses.

DFA from Question 1(c) :

Question 1(c) The number of strings accepted by the DFA of length n=2k+1 is f(0)= 2, f(k)= 2*f(k-1) and hence f(k) = 2k+1. Proof: [Basis] The base case is k=0 and 20+1 =2 as required. Assume that f(k)= 2k+1. We need to show that f(k+1)= 2k+2. But f(k+1)= 2 * f(k). By induction, f(k)= 2k+1. Therefore, f(k+1)= 2 * 2k+1= 2k+2 as required.

Question 2:L = {ar bsct : s ³ r, t ³ 2s}. One case: Recall w= arbrc2r. x= a bi, y= bj, z= br-i-j c2r Pump twice to get ar br+j c2r which is not in L since it is not of the form arbrc2r. Find some number n > 0 so that you can pump n times to fix this case (n=0 also works),

x= ar-i, y= ai bj , z= br-j c2r Another case: x= ar-i, y= ai bj , z= br-j c2r Pump twice to get ar+i br+j c2r which is not in L.

Question 6 (c): L1 = {uuRv : u, v Î {a, b}+}, For the strings of length 6 we have: two choices for u of length one then for each of these 24 choices for v. four choices for u of length two then for each of these 22 choices for v. So the number of length 6 is 2* 16 + 4 * 4 = 48.

Question 6 (c): L1 = {uuRv : u, v Î {a, b}+}, If |u|  2, then choose x= e, y= uuR , z=v. Pumping n times gives: (uuR)n v which is in L. Give a string w that provides a counterexample to this argument.

L= { ap : p is a prime number} is not regular. Theorem: L= { ap : p is a prime number} is not regular. Assume L is regular and is accepted by a DFA M with k states. Choose w= ap for some prime number p ≥ k. Factor ap in all ways as x y z: w = ar as at where p= r + s + t, and s ≥ 1. Pumping n+1 times yields: ap+ ns .

Case 1: If r+t = 0 then pump 2 times to get a2p  L since 2p is not prime. Case 2: If r + t = 1 then pump p+1 times: a1+ (p-1)(p+1) = ap*p  L since p2 is not prime. Case 3: If r+t ≥ 2 then pump r + t times to get ar+t + (r+t)s  L since (s+1)(r+t) is not prime (both factors are at least two).

What would be a more judicious choice for w for this proof and which cases would remain?

Theorem: L= { an2 : n ≥ 0} is not regular. Note: if L is a language defined over a one symbol alphabet and you can prove L is not regular using the pumping lemma, then it also means that L is not context-free.

Factor ap in all ways as u v x y z: w = ai aj ar as at where p= i + j + r + s + t, j + s ≥ 1, v=aj and y= as. Pumping n times yields: ai (aj )n ar (as)n at = ai ar at (aj )n (as)n = ap-j-s + (j+s)n Let x= j+s. Pumping n+1 times yields: ap+xn

w = ai aj ar as at, let x= j + s. Case 1: If p-x=0 then pump 2 times to get a2p  L since 2p is not prime. Case 2: If p-x= 1 then pump p+1 times: a1+ (p-1)(p+1) = ap*p  L since p2 is not prime. Case 3: If p-x ≥ 2 then pump p-x times to get ap-x+x(p-x)  L since (x+1)(p-x) is not prime (x ≥ 1 since x= |v| + |y|).