-2

How can i prove with pumping-lemma that this language (L := {ww| w ∈ {0, 1}∗}) can not be constructed using context free grammar?

Thanks in advance.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343

1 Answers1

0

Use the pumping lemma for context-free languages. A good string to use for this language is the string (0^p)(1^p)(0^p)(1^p). The pumping lemma says that if the language is context free then this string can be written as uvxyz where |vxy| <= p, |vy| > 0 and for all natural numbers n, u(v^n)x(y^n)z is in the language too. We have several distinct cases:

  1. vy consists only of leading 0s. Pumping this will mean the two sections of 0s have different numbers of 0s. This won't work

  2. vy consists of 0s and 1s from the first two sections only. This doesn't work because either 0s and 1s get mixed up, or the first half gets more or less 0s and 1s than the second.

  3. vy consists of 1s from the second section. This doesn't work for the same reason as in case 1.

  4. vy consists of 1s from the second section and 0s from the third section. This doesn't work for the same reason as in case 2.

  5. vy consists of 0s from the third section. This doesn't work for the same reason as in cases 1 and 3.

  6. vy consists of 0s and 1s from the third and fourth sections. This doesn't work for the same reason as in cases 2 and 4.

  7. vy consists of 1s from the fourth section. This doesn't work for the same reason as in cases 1, 3 and 5.

These are all the cases and in no case were we able to pump our string (0^p)(1^p)(0^p)(1^p) as the pumping lemma required we must. Therefore, we conclude that the language cannot have been context-free.

Patrick87
  • 27,682
  • 3
  • 38
  • 73