0

$L = \{0^i1^j0^i1^j|i,j \geq 0\}$

I've tried letting $s = 0^p1^p0^p1^p$. But not sure where to go from here. Help would be appreciated.

user678392
  • 431
  • 2
  • 5
  • 12
  • There's no case analysis. By the pumping lemma for regular languages, you should be able to pump some non-zero-length substring in the first $p$ symbols and get another string also in $L$. For the string you've chosen, this means that you should be able to get another string in $L$ simply by adding or removing some instances of the symbol $0$. However, it's clear that by doing that, you get a string no longer in $L$ since the number of instances of the $0$ symbol no longer match in the first and third parts of the string. QED. – Patrick87 Sep 23 '13 at 17:19
  • Did you read this? – J.-E. Pin Sep 23 '13 at 17:19
  • @Patrick87 sorry, meant to say not context free; not "non-regular" – user678392 Sep 23 '13 at 17:24
  • @J.-E.Pin Yes, I have. – user678392 Sep 23 '13 at 17:25
  • When you say "nasty" case analysis, what do you mean? There are seven cases here, four of which are practically identical to each other, and three others which are practically identical to each other. Two unique cases isn't what I'd consider "nasty", but I suppose that people who try to imagine aesthetics into mathematics are free to enjoy their hobby. – Patrick87 Sep 23 '13 at 18:07
  • by nasty I mean having to do something like 7 cases. – user678392 Sep 23 '13 at 20:40
  • @user678392 Sure, but do you understand when I explain that only two cases require work? For the other five cases, you can simply state that they're equivalent to the others. If this doesn't immediately make sense, work through the proof by cases, and you'll see that most of the cases are basically the same. – Patrick87 Sep 23 '13 at 22:47
  • how do you generate the cases? – user678392 Sep 24 '13 at 13:59
  • See my answer for a proof by cases. It's straightforward and correct, which is more important than being elegant. – Patrick87 Sep 24 '13 at 17:52

2 Answers2

1

Hints

  1. What is the language $K = L \cap 0^*10^*1$ ?
  2. Apply the pumping lemma to $K$ (or to $L$ directly).
J.-E. Pin
  • 6,129
  • 18
  • 36
1

Take a look at the following proof; if this is "nasty", you might just be too picky. :)

Consider the string $0^p1^p0^p1^p \in L$. The string consists of four distinct parts with three boundaries separating the parts: $0^p1^p0^p1^p = (0^p)(1^p)(0^p)(1^p)$. By the pumping lemma for context-free languages, this string can be written as $uvxyz$ such that $vxy \leq p$ and $uv^kxy^kz \in L$. We must now determine what values the substring $vxy$ may assume. There are seven interesting cases:

  • The substring $vxy$ consists entirely of one of the four parts of the string (four cases); or
  • The substring $vxy$ consists of symbols from two adjacent parts and encompasses exactly one of the three boundaries (three cases).

Consider a representative of the first set of four cases; e.g., assume $vxy$ consists entirely of $0$s from the first part of the string. Pumping $vxy$ will change the number of $0$s in the first part of the string without affecting the number of $0$s in the third part, so we will not get a string in $L$. Similar reasoning applies to the other three cases.

Consider a representative of the second set of three cases; e.g., assume $vxy$ consists entirely of $0$s and $1$s from the first and second parts of the string. Pumping $vxy$ will change the number of $0$s from the first part of the string, and the number of $1$s from the second part, without affecting the number of symbols in the third and fourth parts of the string. Therefore, any pumped string cannot possibly be in $L$. Similarly reasoning applies to the other two cases.

Since, in each of the seven cases, pumping the substring fails to produce a string in $L$, we have a contradiction, namely, we assumed that the language is context free, but have found that the pumping lemma for context-free languages does not hold. We conclude that our assumption was incorrect, i.e., that $L$ must not be context-free.

Patrick87
  • 12,824
  • 1
  • 44
  • 76