Consider the language \(L = \left\{ {{a^n}{b^{n - 3}}\ | n > 2} \right\}\) on ∑ = {a, b}. Which one of the following grammars generates the language L?

This question was previously asked in
UGC NET Computer Science (Paper 2) Dec 2019 Paper
View all UGC NET Papers >
  1. S → aA|a, A → aAb|b
  2. S → aaA|λ, A → aAb|λ 
  3. S → aaaA|a, A → aAb|λ 
  4. S → aaaA, A → aAb|λ 

Answer (Detailed Solution Below)

Option 4 : S → aaaA, A → aAb|λ 
Free
UGC NET Paper 1: Held on 21st August 2024 Shift 1
13 K Users
50 Questions 100 Marks 60 Mins

Detailed Solution

Download Solution PDF

Given language:

\(L = \left\{ {{a^n}{b^{n - 3}} |n > 2} \right\}\)

It is generating strings of type = {aaa, a4b, a5b2, a6b3, ………………….}

Now, consider all the options one by one :

Option 1: S → aA|a, A → aAb|b

This grammar is generating strings of type = {a, ab, aabb…………}. But in given language, we are not getting {a}. So, it is not generating given language.

Option 2: S → aaA|λ, A → aAb|λ 

Smallest string that is generated by this grammar is λ. But for given language it is not true, because strings are starting with aaa.

Option 3: S → aaaA|a, A → aAb|λ

In this grammar also, smallest string possible is {a} which is not required here. So, it is not generating given language.

Option 4: S → aaaA, A → aAb|λ

This grammar generates string of type = {aaa, a4b, a5b2,…….} which is same as in the given language. It generates the given language.

Latest UGC NET Updates

Last updated on Jun 12, 2025

-> The UGC NET June 2025 exam will be conducted from 25th to 29th June 2025.

-> The UGC-NET exam takes place for 85 subjects, to determine the eligibility for 'Junior Research Fellowship’ and ‘Assistant Professor’ posts, as well as for PhD. admissions.

-> The exam is conducted bi-annually - in June and December cycles.

-> The exam comprises two papers - Paper I and Paper II. Paper I consists of 50 questions and Paper II consists of 100 questions. 

-> The candidates who are preparing for the exam can check the UGC NET Previous Year Papers and UGC NET Test Series to boost their preparations.

More Context Free Grammars Questions

More Context Free Languages and Pushdown Automata Questions

Get Free Access Now
Hot Links: happy teen patti teen patti download apk teen patti joy teen patti list teen patti gold downloadable content