- Using the pumping lemma, show that the language
$\{ w | w \text{ is not a palindrome} \}$ is not regular. Hint: we know that the regular languages are closed under complement. - Give a CFG for the language
$\{ w | w \text{ is not a palindrome} \}$ (let$Σ$ be {0,1}) - Convert the CFG from the previous part into a PDA that decides the same language
The languages
- Write CFGs for each of them
- By taking the intersection of these two languages, show that the context-free languages are not closed under intersection. Use the context-free pumping lemma
- Use the result of the previous part and DeMorgan’s Laws to show that the context-free languages are also not closed under complement.
Write a context-free grammar for { w | w is a palindrome } that is in Chomsky Normal Form. Hint: it might be easiest to make the simplest possible grammar and then transform it into CNF.
Prove that if a
Write PDAs for the following languages
- { 0^n 1^m | m > n}
- { s | s has an even number of 0s and fewer 1s than pairs of 0s }