Theory Of Computation MCQ

1:

The set {anbn | n = 1, 2, 3 ...} can be generated by the CFG

A. S —>ab | aSb
B. S —>aaSbb + abS
C. S—> ab | aSb | E
D. S —>aaSbb | ab | aabb
 

Answer : D

Explanation :
Option (b) is wrong because it can't generate aabb
(in fact any even power).
Option (c) is wrong since it generates E also.
Both options (a) and (d) are correct.

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.