GATE 2006
March 12, 2025GATE 2006
March 12, 2025GATE 2006
|
Question 84
|
Which one of the following grammars generates the language L = {aibj|i≠j}?
|
S→AC|CB
C→aCb|a|b A→aA|ϵ B→Bb|ϵ |
|
|
S→aS|Sb|a|b
|
|
|
S→AC|CB
C→aCb|ϵ A→aA|ϵ B→Bb|ϵ |
|
|
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.
