Question 5 (30): Let NONCFL be the language
{anbncn : n &ge 0}. (If you see
"ampersand-g-e" here (&ge), it should be a "greater-than-or-equal sign"
but your browser is too ignorant to implement that.) We show in Lecture
3 that NONCFL is not a context-free language.
- (a,10) Prove that the complement of NONCFL is a context-free
language. (Hint: Show it is the union of several context-free languages.)
Explain why this shows that context-free languages are not closed under
complement.
- (b,10) Find two context-free languages whose intersection is NONCFL, and
show that they are context-free. Explain why this shows that the
context-free languages are not closed under intersection.
- (c,10) Prove that the intersection of a context-free language and a
regular language must be context-free. Let SAMECOUNT be the set of
all strings over alphabet {a,b,c} that have equal numbers of a's, b's,
and c's. Use the closure property you just proved (not the
CFL Pumping Lemma directly) to prove that SAMECOUNT is not context-free.
Last modified 18 February 2003