retagged by
972 views
6 votes
6 votes

Let $L$ be the set of strings over $\{0, 1\}$ containing an unequal number of $0$s and $1$s. Prove that

  1. $L$ is not regular.
  2. $L^2$ is regular.
retagged by

2 Answers

1 votes
1 votes

Lets assume L is regular.

Then there must exist som value p which is the pumping length for L.

lets take a string w  ∊ L and |w|>=p

assume the split of  w=xyz

Now 3 conditions of pumping lemma needs to be satisfied 

  1. |xy|<=p
  2. |y|>0
  3. xy^iz  ∊ L  for i>=0

now take w= 0^p1^p-1  [this string definitely belong to L ]

Now our xy should be limited to first p symbols

lets assume a partition |x|=p-1   and  |y|=1

take i=0   [just remove y]

so,  xy^0z  =  0^p-1  1^p-1   [this str does not belong to L since number of 0 and number of 1 is same ] 

therefore it contradicts our initial assumption of L being regular.

Hence L is not regular.

 

 

edited by
0 votes
0 votes

i) S ->S1S2 | S2S3

  S1 ->0S1 | 0

  S2 -> 0S21 | ∊

  S3 ->1S3 | 1

So, L is not regular

ii) but L2 is regular

and L2 =(0+1)+

So, L2 will be regular

edited by

Related questions

4 votes
4 votes
0 answers
2