notes08 Nonregular languages and Pumping Lemma

notes08 Nonregular languages and Pumping Lemma - CS 373:...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS 373: Theory of Computation Gul Agha Mahesh Viswanathan Fall 2010 1 1 Expressiveness 1.1 Finite Languages Finite Languages Definition 1. A language is finite if it has finitely many strings. Example 2 . { , 1 , 00 , 10 } is a finite language, however, (00 11) * is not. Finiteness and Regularity Proposition 3. If L is finite then L is regular. Proof. Let L = { w 1 ,w 2 ,...w n } . Then R = w 1 w 2 w n is a regular expression defining L . 1.2 Non-Regular Languages Are all languages regular? Proposition 4. The language L eq = { w { , 1 } * | w has an equal number of 0s and 1s } is not regular. Proof? No DFA has enough states to keep track of the number of 0s and 1s it might see. Above is a weak argument because E = { w { , 1 } * | w has an equal number of 01 and 10 substrings } is regular! Proving Non-Regularity Proposition 5. The language L eq = { w { , 1 } * | w has an equal number of 0s and 1s } is not regular. Proof. Suppose (for contradiction) L eq is recognized by DFA M = ( Q, { , 1 } ,,q ,F ), where | Q | = n . There must be j < k n such that ( q , j ) = ( q , k ) (= q say). Let x = 0 j , y = 0 k- j , and z = 0 n- k 1 n ; so xyz = 0 n 1 n . Proving Non-Regularity 2 Proof (contd). q q x = 0 j y = 0 k- j q q q x = 0 j y = 0 k- j z = 0 n- k 1 n We have ( q , j ) = ( q , k ) = q Since 0 n 1 n L eq , ( q , n 1 n ) F . ( q , n 1 n ) = ( ( q , k ) , n- k 1 n ) (since ( q,uv ) = ( ( q,u ) ,v )) = ( ( q , j ) , n- k 1 n ) ( ( q , j ) = ( q , k )) = ( q , n- k + j 1 n ) (since ( q,uv ) = ( ( q,u ) ,v )) So M accepts 0 n- k + j 1 n as well. But, 0 n- k + j 1 n 6 L eq ! 2 Pumping Lemma 2.1 Statement and Proof Pumping Lemma: Overview Pumping Lemma The lemma generalizes this argument. Gives the template of an argument that can be used to easily prove that many languages are non-regular....
View Full Document

This note was uploaded on 10/04/2011 for the course CS 373 taught by Professor Viswanathan,m during the Fall '08 term at University of Illinois, Urbana Champaign.

Page1 / 8

notes08 Nonregular languages and Pumping Lemma - CS 373:...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online