GATE 2006
March 12, 2025
GATE 2006
March 12, 2025
GATE 2006
March 12, 2025
GATE 2006
March 12, 2025

GATE 2006

Question 84

Which one of the following grammars generates the language L = {aibj|i≠j}?

A
S→AC|CB
C→aCb|a|b
A→aA|ϵ
B→Bb|ϵ
B
S→aS|Sb|a|b
C
S→AC|CB
C→aCb|ϵ
A→aA|ϵ
B→Bb|ϵ
D
S→AC|CB
C→aCb|ϵ
A→aA|a
B→Bb|b
Question 84 Explanation: 
The language have all the strings in which a’s comes before b’s and number of a’s never equal to b’s. The grammars in Option A, B and C generates string “ab” in which number of a’s are equal to b’s, hence they are wrong. But option D generates all the string which is in L.
Correct Answer: D
Question 84 Explanation: 
The language have all the strings in which a’s comes before b’s and number of a’s never equal to b’s. The grammars in Option A, B and C generates string “ab” in which number of a’s are equal to b’s, hence they are wrong. But option D generates all the string which is in L.

Leave a Reply

Your email address will not be published. Required fields are marked *