Multiple choice

Which of the following definitions does not generate the same language as L? L = {XnYn, n $\ge$ 1} I. E $\rightarrow$ XEY | XY II. XY | X + XYY+ III. X + Y +

  1. I only

  2. I and II

  3. II and III

  4. II only

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Grammar I: E→XEY|XY generates strings X^nY^n with n≥1 correctly. Grammar II uses garbled notation but doesn't enforce equal counts. Grammar III (X+Y+) generates one-or-more X's followed by one-or-more Y's without requiring equality.