1
$\begingroup$

Is there a language $L \subseteq \{a\}^*$ such that both $L$ and its complement are not context free?

$\endgroup$

1 Answer 1

2
$\begingroup$

Yes, there is. Consider the language $L = \{a^p \mid p \text{ is prime}\}$ which is not contextfree, neither is its complement. Both statements are very easy to check via Pumping-Lemma.

$\endgroup$
2
  • $\begingroup$ Could you give me a hint to prove that the complement of L is not context free? $\endgroup$ Commented Jul 2, 2018 at 13:31
  • 2
    $\begingroup$ Since $L$ is unary, it is context-free iff it is regular iff its complement is regular. $\endgroup$ Commented Jul 3, 2018 at 7:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.