Skip to content
Related Articles

Related Articles

Improve Article

GATE | GATE CS 1996 | Question 8

  • Last Updated : 21 May, 2020

Which two of the following four regular expressions are equivalent? (ε is the empty string).
(i). (00)*(ε+0)
(ii). (00)*
(iii). 0*
(iv). 0(00)*
(A) (i) and (ii)
(B) (ii) and (iii)
(C) (i) and (iii)
(D) (iii) and (iv)


Answer: (C)

Explanation: Here,

(00)*(ε+0)
= (00)*.ε+ (00)*.0 
= (00)* + (00)*0 
= 0* 

It is equal to (iii) [ using regular expression properties ].

Here,
we see that (00)* generates strings of even length and (00)*0 generated the strings of odd length.

Option (C) is correct.

Quiz of this Question

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :