hmwk3

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

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

Johny Nguyen October 26 th , 2010 CS 473 Homework 3 Downey

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

View Full Document
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.
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,

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online