0
$\begingroup$

I have this language:

$L = \{a^nb^nc^kd^k∣n > k\}$

I get why $L$ isn't context free, but why $\bar{L}$ context free?

$\endgroup$

1 Answer 1

0
$\begingroup$

A pushdown automaton trying to decide $\overline{L}$ can just non-deterministically guess the ``reason'' while the input word doesn't belong to $L$. The potential reasons will be:

  1. The word isnt of the form $a^nb^mc^jd^i$.
  2. The word has an unequal number of $a$'s and $b$'s.
  3. The word has no more $b$'s than $c$'s.
  4. The word has an unequal number of $c$'s and $d$'s.

Each individual condition can be checked by a pushdown automaton, so we're good.

$\endgroup$
2
  • $\begingroup$ What about, for instance, The word has no more a's than c's, or the word has no more a's than d's etc. $\endgroup$ Commented Feb 14 at 8:36
  • $\begingroup$ @YahliGitzi Those are covered by the cases I listed. Eg "no more a's than c's" means at least one of 2 and 3 have to trigger. $\endgroup$ Commented Feb 14 at 10:59

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.