in Theory of Computation
1,292 views
2 votes
2 votes

Let r1=(0+1)*, r2=0*1+10*+0*+1*. What is the length of the smallest string that is present in language corresponds to regular expression r1 and not present in language corresponds to regular expression r2.

  1. 2
  1. 3
  1. 1
  1. none of the above
in Theory of Computation
by
1.3k views

1 comment

Answer key has given the answer as a. 2

0
0

2 Answers

5 votes
5 votes
Best answer

Given,

r1 = (0+1)* = set of all strings of 0 or 1 

r2 = 0*1+10*+0*+1*

    = { ɛ, 0, 1, 00, 01, 10, 11, 000, 001, 100, 111, ….}

Since, 010, 011, 101, 110 is present in r1 but not in r2 and length is 3

so ans is b. 

selected by

4 Comments

Thank you for the answer Yaman, even I answered b. 3, but the released answer key mentioned a. 2 as the answer; which is why I posted the question in GO.
1
1
edited by

Try generating 11 with R2.

 
0
0

In r2, there is 1* so it generates 11.

;)

1
1
Indeed i completely miss out on that. Thanks mate.
0
0
0 votes
0 votes
11 is the smallest expression formed by r2

00,01,10 are those present in r1 and not present in r2

length is 2
reshown by

2 Comments

r2 = 0*1 + 10* + 0* + 1*

Can't 00,  01, 10 be derived from 0*, 0*1, 10* respectively?
0
0
I think it's mentioned smallest string in question

So I took r2 without * and got the smallest
0
0

Related questions