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?
Hmmm ... You were almost ! there. Just in the last statement you are not pumping the string
w = xyz
aty
.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 anyi >= 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 LNOTE- You also need to consider other cases like y = 0t11 , y = 1t etc and later on prove that these do imply a contradiction.