3
L = { w | w in {0,1}* and w has equal number of 0s and 1s }

Let n be the number of the pumping lemma.

I pick s = 0n 1n and y = 0t where 1 <= t <= n.

Which gives xyz = 0(n-t) 0t 1n= 0n 1n which is in L.

But xz = 0(n-t) 1n is not in L. Contradiction.

Did I apply it correct?

hexacyanide
  • 88,222
  • 31
  • 159
  • 162
Ivan Prodanov
  • 34,634
  • 78
  • 176
  • 248

1 Answers1

2

Hmmm ... You were almost ! there. Just in the last statement you are not pumping the string w = xyz at y.

Now we start by assuming that L is regular where L = { w | w in {0,1}* and w has equal number of 0s and 1s } and then we will go on to prove that for any i >= 0 the pumped string i.e w = xyiz does not contain the equal number of 0s and 1s ( a contradiction per se) therefore, the language is not regular :

L is given by :

L = {0n1n | n >= 0}

Iff y = 0t => w = 0n-t0t1n

Now after pumping y for i >= 0 we get

xyiz = 0n-t0it1n

-> xyiz = 0n+(i-1)t1n

Now since n+(i-1)t is not equal to n this contradicts our assumption that L = { w | w in {0,1}* and w has equal number of 0s and 1s } therefore xyiz does not belong to L

NOTE- You also need to consider other cases like y = 0t11 , y = 1t etc and later on prove that these do imply a contradiction.

0decimal0
  • 3,884
  • 2
  • 24
  • 39
  • 1
    I think that he **has to** consider, not just **can**. – lejlot Sep 01 '13 at 06:35
  • @lejlot Yes , absolutely .. in order to find all the cases to check whether the contradiction holds or not ... mm was just being bit polite ( it was unnecessary nevertheless)... updating answer thanks :) – 0decimal0 Sep 01 '13 at 06:37