-
Identify the language generated by the following grammar, where S is the start variable.
S → XY
X → aX | a
Y → aYb | ∈
-
- { am bn | m ≥ n , n > 0 }
- { am bn | m ≥ n , n ≥ 0 }
- { am bn | m > n , n ≥ 0 }
- { am bn | m > n , n > 0 }
- { am bn | m ≥ n , n > 0 }
Correct Option: C
The given grammar with S as start symbol is
S → XY
X → ax | a ⇒ X → ( am | m ≥ 1 )
Y → ayb | E ⇒ Y → ( an bn | n ≥ 0 )
S → XY
S → { am bn | m > n , n ≥ 0 }
because, from Non terminal X we can generate any number of a's including a single 'a' and from Y equal number of a's and b's.
Hence L = { am bn | m > n , n ≥ 0 }
m > n , because at least one will be attached on left of am bn . So, option (c) is correct.