GATE | Gate IT 2008 | Question 5

Which of the following regular expressions describes the language over {0, 1} consisting of strings that contain exactly two 1’s?
(A) (0 + 1) * 11(0 + 1) *
(B) 0 * 110 *
(C) 0 * 10 * 10 *
(D) (0 + 1) * 1(0 + 1) * 1 (0 + 1) *


Answer: (C)

Explanation: By looking at option A and D clearly not feasible solution.
Between B and C both contains exactly two 1’s but in option B, both 1 will always come together where as in C it is general string.

Quiz of this Question

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.