Which of the following definitions below generates the same language as L,…

1995

Which of the following definitions below generates the same language as L, where
L = { xⁿ yⁿ such that n ≥ 1 }

I. E → xEy | xy

II. xy | (x⁺ s y y⁺)

III. x⁺ y⁺

  1. A.

    I only

  2. B.

    I and II

  3. C.

    II and III

  4. D.

    II only

Attempted by 9 students.

Show answer & explanation

Correct answer: A

The target language L consists of strings with equal numbers of x's followed by y's where n is at least 1. Grammar I (E → xEy | xy) generates exactly this pattern through recursive expansion. Grammar III allows unequal counts, and Grammar II contains undefined symbols.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir