Wednesday 3 June 2020

UGC NET Computer Science December 2019 | Question 94

Question 94
Consider the language L = {an bn-3 | n > 2} on Σ = {a, b}. Which one of the following grammars generates the language L?
  1. (1) S→aA|a, A→aAb|b
  2. (2) S→aaA|λ, A→aAb|λ
  3. (3) S→aaaA|a, A→aAb| λ
  4. (4) S→aaaA, A→aAb|λ
Answer : (4) S→aaaA, A→aAb|λ

Explanation
Option 1 is incorrect because it can generate “a” where n = 1. so given condition (n > 2) is violated.

Option 2 is incorrect because it can generate “null string”. so given condition (n > 2) is violated.

Option 3 is incorrect because it can generate “a” where n=1. so given condition (n > 2) is violated.

Option 4 is correct because it can generate strings ab, aaa, aaaab, ... where n > 2.

So, option 4 is correct answer

PreviousNext
UGC NET CS December 2019 - Question 93UGC NET CS December 2019 - Question 95

No comments:

Post a Comment

UGC NET Computer Science December 2019 | Question 16

Question 16 In a certain coding language. 'AEIOU' is written as 'TNHDZ'. Using the same coding language. 'BFJPV' wil...

Popular Posts