Consider the grammar given below S → x B | y A A → x | x S | y A A B → y | y S…

GATE · 2007 · IT

Consider the grammar given below


S → x B | y A

A → x | x S | y A A

B → y | y S | x B B


Consider the following strings.


(i) xxyyx

(ii) xxyyxy

(iii) xyxy

(iv) yxxy

(v) yxx

(vi) xyx

Which of the above strings are generated by the grammar ?

  1. A.

    (i), (ii), and (iii)

  2. B.

    (ii), (v), and (vi)

  3. C.

    (ii), (iii), and (iv)

  4. D.

    (i), (iii), and (iv)

Attempted by 66 students.

Show answer

Correct answer: C

The worked solution is available to enrolled students.

Video solution available to enrolled students.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…