1

Anyone can describe why $L_{1}$ is not the complement of $L_{2}$, and why $L_{2}$ is not context free?

$$L_{1}= \{w_{1}cw_{2} : w_{1},w_{2} \in \{a,b\}^{\ast}, w_{1} \neq w_{2}\}$$ $$L_{2}= \{w_{1}cw_{2} : w_{1},w_{2} \in \{a,b\}^{\ast}, w_{1} = w_{2}\}$$

Raphael
  • 73,212
  • 30
  • 182
  • 400
M. holi
  • 139
  • 7

2 Answers2

3

If two languages $A$, $B$ are complements of each other, then their disjoint union $A \uplus B$ must be the set of all strings $\Sigma^{\ast}$ over the given alphabet $\Sigma$. That is, every string in $\Sigma^{\ast}$ has to be in $A$ or $B$ but not both. So if we want to show that $L_{1} \neq \overline{L_{2}}$, all we have to do is find a string that is either in both or neither.

In this case it's fairly trivial. All strings in $L_{1}$ and $L_{2}$ have a $c$ in them, so pick any string that doesn't have a $c$ it in. For example $\varepsilon$, it's in neither $L_{1}$ nor $L_{2}$.

A construction for a PDA for $L_{1}$ is given here.

As for proving $L_{2}$ is not context free, everything you need is here.

Luke Mathieson
  • 18,373
  • 4
  • 60
  • 87
0

The intuitive idea is in the quantifiers, but that is not a formal proof.

Nonequality $w_1 \neq w_2$ if there is some position in which both words differ. We can chack this position by guessing it in the first word $w_1$, storing the number on the pushdown, and checking it for $w_2$. According to this "intuition" we have to use nondeterminism, and we cannot use the position on the pushdown more than once.

For equality $w_1=w_2$ we must verify that all positions are equal. There is no good way to do that. A formal proof of this must take into account all possible strategies (not just this intuition).

Hendrik Jan
  • 31,459
  • 1
  • 54
  • 109