• edited by
34,343 views
79 79 votes

The regular expression $0^*(10^*)^*$ denotes the same set as

  1. $(1^*0)^*1^*$
  2. $0+(0+10)^*$
  3. $(0+1)^*10(0+1)^*$
  4. None of the above

13 Answers

Best answer
66 66 votes
  1. Is the answer. Both (A) and the given expression generates all strings over $\Sigma$.
  2. doesn't generate $11$
  3. doesn't generate $11$
• edited by
22 22 votes

Start with the minimum length strings , like - strings of length 0 , strings of length 1... and check with the options and eliminate those that dont match.

Given string accepts empty string , but the options B) and C) do not accept empty string. They are eliminated.

Now the given regular expression and A) accept all strings over 0 and 1.
Testing all strings of length 0 , 1 , 2 and 3.. proves it to be true.

Can there be a formal way to show that these regular expressions are exactly the same?
 
 
7 7 votes
In 0*(10*)*, (10*)* generates all strings on {0,1} except those starting with 0. So if we prefix 0* also then it will include those also. And thus this regex implies (0+1)*.

And now we can see option a in similar way. In (1*0)*1*, (1*0)* generates all strings except those ending with 1, so we prefixed 1* in end. Hence this also follows (1+0)*. Hence option A is the right answer
1 1 vote

This Question is very simple, Only thing we do approaches to the problem in wrong way.

L = 0*(10*)* : To do this type of problem always expand * As precedence of operator is [(*) >( .) > (+)]. Now you will never do this wrong.

hence the L =  0*(10*)* can be expanded like this ->

= 0*{ e + (10*) + (10*)(10*) + (10*)(10*)(10*) +..........}

Now after this just take Alphabet(A) = { 0, 1} and find the what are the strings present in A* or {0,1} * can also be obtain by L = 0*(10*)*.

You will find that L = {0, 1} * = A *.( Which is also a STANDARD RESULT, if you want, you can remember this)

 Ex -  We can generate 100 from L by doing like this -> 0*(10*) = e.(100) = 100.

SIMILARLY by doing the same way,

M = (1*0)*1* 

= {e + (1*0) + (1*0)(1*0) + (1*0)(1*0)(1*0) + ..........} 1*  

By doing the same way you can easily find that it is also equal to {0,1}* or A*. 

Ex - We can also generate 100 from M also in this way -> just take (1*0)(1*0) = (10)(1*0) = (10)(0) = 100.

Hence Both M and L are equal . 

 

 

Answer:
Position:
Show:

Related questions

61 61 votes
5 answers 5 answers
14.6k
14.6k views
Kathleen asked Sep 17, 2014
14,620 views
A program consists of two modules executed sequentially. Let $f_1(t)$ and $f_2(t)$ respectively denote the probability density functions of time taken to execute the two ...
65 65 votes
7 answers 7 answers
24.5k
24.5k views
Kathleen asked Sep 17, 2014
24,496 views
Consider the set of relations shown below and the SQL query that follows.Students: (Roll_number, Name, Date_of_birth)Courses: (Course_number, Course_name, Instructor)Grad...
58 58 votes
5 answers 5 answers
22.8k
22.8k views
Kathleen asked Sep 17, 2014
22,804 views
Which of the following is NOT an advantage of using shared, dynamically linked libraries as opposed to using statistically linked libraries?Smaller sizes of executable fi...
94 94 votes
4 answers 4 answers
31.4k
31.4k views
Kathleen asked Sep 17, 2014
31,388 views
A data structure is required for storing a set of integers such that each of the following operations can be done in $O(\log n)$ time, where $n$ is the number of elements...