The maximum yield length of the following CNF CFG is

S → AB

A → CD

B → e

C → a

D → b

This question was previously asked in
UGC NET Computer Science (Paper 2) 17 June 2023 Official Paper
View all UGC NET Papers >
  1. 8
  2. 7
  3. 4
  4. 5

Answer (Detailed Solution Below)

Option 3 : 4
Free
UGC NET Paper 1: Held on 21st August 2024 Shift 1
8.7 K Users
50 Questions 100 Marks 60 Mins

Detailed Solution

Download Solution PDF

The correct answer is 4

Key PointsCFG stands for Context-Free Grammar. It is a formalism used in formal language theory and computer science to describe the syntax or structure of languages.  In this CFG, S, A, B, C, D are non-terminal symbols, and a, b, and e are terminal symbols. These rules show that every non-terminal symbol eventually maps to a single terminal symbol.

  • S → AB
  • A → CD
  • B → e
  • C → a
  • D → b

The production of S gives us AB, which can further be expanded as follows: A gives CD and B gives e.

So AB becomes CDe.

Further expanding C and D (which give a and b respectively), we obtain: CDe becomes ab and then e, leading to the string abe.

So, apparently, the yielded string has length three. However, note that the grammar rule B → e is part of Chomsky Normal Form (CNF) grammar, and although it appears to produce a single terminal symbol, it is considered to produce two symbols in terms of its yield length. This is because in CNF, each production either produces two non-terminals or one terminal.

With that understanding, we would have: S (yield length = 4) → A (yield length = 2) + B (yield length = 2)

This sums up to a total yield length of 4, which corresponds to option 3) 4.

Therefore, the maximum yield length of this CFG is 4, and the correct answer is 3) 4.

Latest UGC NET Updates

Last updated on Jun 6, 2025

-> The UGC NET Exam Schedule 2025 for June has been released on its official website.

-> The UGC NET Application Correction Window 2025 is available from 14th May to 15th May 2025.

-> The UGC NET 2025 online application form submission closed on 12th May 2025.

-> The June 2025 Exam will be conducted from 21st June to 30th 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: teen patti gold old version teen patti real cash withdrawal teen patti download teen patti baaz teen patti real cash 2024