UGC-NET | UGC NET CS 2016 July – II | Question 31

The number of strings of length 4 that are generated by the regular expression (0|∈)1+2* (3|∈), where | is an alternation character, {+, *} are quantification characters, and ∈ is the null string, is :
(A) 08
(B) 10
(C) 11
(D) 12


Answer: (D)

Explanation:
Regular expression (0|∈)1+2* (3|∈)
0122, 0123, 1123, 0112, 0113, 1113, 0111, 1222, 1123, 1111, 1223, 1112;
Total 12 strings of lenghth 4 are possible.
So, option (D) is correct.

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.