{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

notes08 Nonregular languages and Pumping Lemma

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

This preview shows pages 1–5. Sign up to view the full content.

CS 373: Theory of Computation Gul Agha Mahesh Viswanathan Fall 2010 1

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

View Full Document
1 Expressiveness 1.1 Finite Languages Finite Languages Definition 1. A language is finite if it has finitely many strings. Example 2 . { 0 , 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 ∈ { 0 , 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 ∈ { 0 , 1 } * | w has an equal number of 01 and 10 substrings } is regular! Proving Non-Regularity Proposition 5. The language L eq = { w ∈ { 0 , 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, { 0 , 1 } , δ, q 0 , F ), where | Q | = n . There must be j < k n such that ˆ δ ( q 0 , 0 j ) = ˆ δ ( q 0 , 0 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 0 q x = 0 j y = 0 k - j q 0 q q 0 x = 0 j y = 0 k - j z = 0 n - k 1 n We have ˆ δ ( q 0 , 0 j ) = ˆ δ ( q 0 , 0 k ) = q Since 0 n 1 n L eq , ˆ δ ( q 0 , 0 n 1 n ) F . ˆ δ ( q 0 , 0 n 1 n ) = ˆ δ ( ˆ δ ( q 0 , 0 k ) , 0 n - k 1 n ) (since ˆ δ ( q, uv ) = ˆ δ ( ˆ δ ( q, u ) , v )) = ˆ δ ( ˆ δ ( q 0 , 0 j ) , 0 n - k 1 n ) ( ˆ δ ( q 0 , 0 j ) = ˆ δ ( q 0 , 0 k )) = ˆ δ ( q 0 , 0 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. Pumping Lemma The Statement Lemma 6. If L is regular then there is a number p (the pumping length) such that w L with | w | ≥ p , x, y, z Σ * such that w = xyz and 1. | y | > 0 2. | xy | ≤ p 3. i 0 . xy i z L 3

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

View Full Document
Proving the Pumping Lemma Proof. Let M = ( Q, Σ , δ, q 0 , F ) be a DFA such that L ( M ) = L and let p
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 8

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

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

View Full Document
Ask a homework question - tutors are online