MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Consider the regular expression 0 * (10 *) which is similar to the same set as
A
0 + (0 + 10) *
B
(0 +1) * 10 (0 + 1) *
C
(1 * 0) * 1*
D
None of the above
Explanation: 

Detailed explanation-1: -The regular expression 0*(10*)* denotes the same set asa)(1*0)*1*b)0 + (0 + 10)*c)(0 + 1)* 10(0 + 1)*d)none of theseCorrect answer is option ‘A’.

Detailed explanation-2: -Regular Expression: (0+10)*(+1) – L((0+10)*(+1)) = all strings of 0’s and 1’s without two consecutive 1’s. Regular Expression: (0+1)(0+1) – L((0+1)(0+1) ) = 00, 01, 10, 11 = all strings of 0’s and 1’s of length 2. For every regular expression there is a finite automaton.

Detailed explanation-3: -To answer your question, no. They are not the same.

Detailed explanation-4: -Two regular expressions are equivalent if they describe the same language. eg. – (0+1)* = (1+0)* (why?)

Detailed explanation-5: -Which one of the following regular expressions is NOT equivalent to the regular expression (a + b + c)*? a)(a* + b* + c*)*b)(a*b*c*)*c)((ab)* + c*)*d)(a*b* + c*)*Correct answer is option ‘C’.

There is 1 question to complete.