0

I have to prove that $\left \{ a, b \right \}^{\ast} - \left \{ a^ib^i | i\geq 0 \right \}$ is a context-free language and it's not regular.

So far I've got that this language is not regular because regular languages are closed under complementation and $\left \{ a^ib^i | i\geq 0 \right \}$ is a well know context free language (by the way do you have a link with a formal proof that $\left \{ a^ib^i | i\geq 0 \right \}$ is context free?)

For the context-free I'm a little confused I've thought about building a PDA that recognize $\left \{ a^ib^i | i\geq 0 \right \}$ (pushing a's on the stack and popping a's when a b is read works?) I think is deterministic CF so i can use the same reasoning (complement of a DCF is a DCF language?)

Crysis85
  • 255
  • 3
  • 6

1 Answers1

1

To prove that the language is Context Free, it suffices to give the Push Down Automaton, and that language is recognized by one of the simplest PDA.

To prove that the language is NOT regular, you don't only have to show that you can't find an appropriate Automaton (be it a FDA or FNA, they have equivalent expressive power), but that no one can.

That proof can't be shown with an example, because you want to prove that not a single FDA can recognize the language correctly. The proof shows a contradiction between having such FDA and that the FDA correctly rejects some words outside the language.

The idea is similar to the pumping lemma. Suppose that you have an FDA that recognizes the language, you are going to break it. That FDA is, as it name says, finite, let it's size (node count) be $N$. To recognize the words in $\left \{ a^ib^i | i\geq N \right \}$ it certainly has to do some loops.

By exploiting a loop of length $l$ (looping in it one time more than the expected), you can see that $a^{(i+l)}b^i$ should also be accepted by that FDA, so it fails to recognize the language, as it would accept words that are not in it.

Dietr1ch
  • 146
  • 3