retagged by
1,714 views
1 votes
1 votes

So , 1 is mandatory in Regular expression ; and both of above grammar allows strings without 1 to be genearated.

So ,  I expected None of above to be answer. What Am I missing here ?

Consider for (A)

Production = A0 -> A1

A1-> 0

retagged by

2 Answers

0 votes
0 votes
Create NFA for the given expression and from that grammer is as follows:
replace A0 with S and A1 with A
S->0S | 1A
A -> 0A | 1A | epsilon
 the above grammer doesn't match with option A and B

In the options A and B they have production rule A0 -> A1 (As mentioned by @vishal8492) which will produce string "0" which is not accepted by the regular expression.

So the answer would D.
edited by

Related questions

2 votes
2 votes
1 answer
2
0 votes
0 votes
1 answer
3