hwsol7 - Theory of Algorithms. Spring 2000. Homework 7...

Info iconThis preview shows pages 1–2. 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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Theory of Algorithms. Spring 2000. Homework 7 Solutions. Section 5.1 (4) Let L = { ab ( bbaa ) n bba ( ba ) n : n ≥ } . Then L is not regular. Proof. Assume towards a contradiction that L is regular. Let m > 0 be given by the Pumping Lemma. Then let w = ab ( bbaa ) m bba ( ba ) m . Notice that w ∈ L and | w | ≥ m . So let w = xyz be the decomposition of w given by the Pumping Lemma. Notice that there are many different possibilities for what y looks like and therefore it would seem as if this proof is going to be difficult. But in fact it will be easy. Let i = 2. I claim that w 2 / ∈ L . To see this, I argue as follows. Notice that bba ( ba ) m is a suffix of w and so it is also a sufix of w 2 . But now notice that our string w is the one and only string in L that has bba ( ba ) m as a suffix. Since w 2 6 = w and yet w 2 has bba ( ba ) m as a suffix, w 2 / ∈ L . This contradicts the Pumping Lemma. So L is not regular. (6) (a) S → aSb | aaa | aa | a | λ (b) S → aSb | A | B | λ A → aA | λ B → bB | bb (c) S → S 1 | S 2 S 1 → aaS 1 b | aS 1 | a S 2 → AAs 2 b | Ab A → a | λ (d) S → aSbbB | λ B → b | λ As preparation for part (e) let us review exercise 14(b) from section 1.2 (Homework 1.) In that exercise you were asked for a grammar for the language L = { w ∈ { a, b } * : n a ( w ) > n b ( w ) } . My answer was the following grammar G . S → aS 1 | aS | S 1 S S 1 → S 1 S 1 | λ | aS 1 b | bS 1 a Let me explain why it is true that L ( G ) = L . First notice that by Example 1.12 on page 23, S 1 ⇒ * w , iff n a ( w ) = n b ( w ). It is then clear that L ( G ) ⊆ L , because the only way to eliminate...
View Full Document

This note was uploaded on 07/17/2011 for the course MAD 3512 taught by Professor Staff during the Spring '07 term at University of Florida.

Page1 / 4

hwsol7 - Theory of Algorithms. Spring 2000. Homework 7...

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

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