CS 3156 Section C, Fall 1998
Homework 4 -- due Monday, Nov. 2
1.
Give context-free grammars that generate the following languages over
the alphabet
:
- (a)
, i.e., the language of
palindromes over
.
- (b)
. Hint: if n is even, then m must
be odd; if n is odd, then m must be even.
- (c)
- (d)
2.
Prove the following: if L is a context-free language, then
is also context-free.
3.
Problem 2.14, page 121 of the book.
4.
Problem 2.19, page 121 of the book.
5.
- (a)
Give context-free grammars that generate the languages
and
.
- (b)
Show that
.
- (c)
Use the result established in Example 2.20, page 117-118 of the text, to
show that the class of context-free languages is not closed under
intersection.
- (d)
Use (c) and DeMorgan's law (Theorem 0.10, page 20 of the text) to prove
that the class of context-free languages is not closed under
complementation.