hmwk3 - Johny Nguyen October 26th, 2010 CS 473 Homework 3...

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

View Full Document Right Arrow Icon
Johny Nguyen October 26 th , 2010 CS 473 Homework 3 Downey
Background image of page 1

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

View Full DocumentRight Arrow Icon
Problem 1 Use the Pumping Lemma for Regular languages to show that is not regular. Assume L is regular. Let p be the pumping length given by the pumping lemma. Let s be the string a p ba p ba 2p . The pumpling lemma guarantees that s can be split into three pieces s = xyz. Let x and z be the empty strings. That would mean y would have to consist of either of the following: 1. s contains only a’s or only b’s 2. s contains both but not enough of each Both would imply that the pieces are not in L. Which means s cannot be pumped. Therefore, L is not regular.
Background image of page 2
Problem 2 2.4 Give context-free grammars that generate the following languages 1. {w | w starts and ends with the same symbol} R 1 0R 2 | 1R 3 | ε R 2 0R 4 | 1R 2 R 3 1R 4 | 0R 3 R 4 0R 3 | 1R 2 | ε R 1 is our starting state. If it takes in a 0, it will go to R 2 . If it takes in another 0, it will go to the accepting state R 4 that accepts more characters if needed,
Background image of page 3

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

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

Page1 / 8

hmwk3 - Johny Nguyen October 26th, 2010 CS 473 Homework 3...

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