UGC-NET | UGC-NET CS 2017 Dec 2 | Question 34

Which of the following statements is/are TRUE ?
(i) The grammar S → SS | a is ambiguous (where S is the start symbol).
(ii) The grammar S → 0S1 | 01S | e is ambiguous (the special symbol e represents the empty string and S is the start symbol).
(iii) The grammar (where S is the start symbol).

S → T/U
T → x S y ? xy ? e
U → yT

generates a language consisting of the string yxxyy.
(A) Only (i) and (ii) are TRUE
(B) Only (i) and (iii) are TRUE
(C) Only (ii) and (iii) are TRUE
(D) All of (i), (ii) and (iii) are TRUE


Answer: (D)

Explanation: We can generate more than 1 parse tree for a single string from the grammars. For statement (iii)

    S → U
    U → yT
   yT → yxSy
 yxSy → yxTy
 yxTy → yxxyy

All statement are correct.

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.