Assignment 8: Simplification, Normal Forms, and Properties of CFLs

This assignment evaluates and deepens your understanding of Context-Free Grammar (CFG) simplification, normal forms (Chomsky and Greibach), the CYK parsing algorithm, the CFL Pumping Lemma, and closure/decision properties, synthesizing Michael Sipser (Chapter 2.1 & 2.3) and Peter Linz (Chapters 6 & 8).


Section A: True or False Questions

For each question, select True or False and provide a rigorous mathematical justification.

Question 1

If a Context-Free Grammar \(G = (V, T, S, P)\) is in Chomsky Normal Form (CNF), then for any non-empty string \(w \in L(G)\) of length \(n = |w| \ge 1\), every derivation of \(w\) in \(G\) takes exactly \(2n - 1\) steps.

🔒 Solution Locked
This solution will automatically unlock on Oct 27, 2026 at 23:59 +0530
(24 hours after the assignment due date).

Question 2

The family of Context-Free Languages (CFLs) is closed under intersection, meaning that if \(L_1\) and \(L_2\) are context-free, then \(L_1 \cap L_2\) is guaranteed to be context-free.

🔒 Solution Locked
This solution will automatically unlock on Oct 27, 2026 at 23:59 +0530
(24 hours after the assignment due date).

Question 3

If \(L\) is a Context-Free Language over \(\Sigma\) and \(R\) is a Regular Language over \(\Sigma\), then the intersection \(L \cap R\) is guaranteed to be a Context-Free Language.

🔒 Solution Locked
This solution will automatically unlock on Oct 27, 2026 at 23:59 +0530
(24 hours after the assignment due date).

Question 4

In the CFL Pumping Lemma (\(w = uvxyz\)), the bounded condition \(|vxy| \le m\) implies that the pumpable substring \(vxy\) must always reside within the first \(m\) characters at the beginning of the string \(w\).

🔒 Solution Locked
This solution will automatically unlock on Oct 27, 2026 at 23:59 +0530
(24 hours after the assignment due date).

Section B: Multiple Choice Questions (MCQs)

Select all options that apply. You must justify your choices mathematically.

Question 5

Which of the following operations preserve context-freeness (i.e., Context-Free Languages are closed under these operations)? (Select all that apply)

🔒 Solution Locked
This solution will automatically unlock on Oct 27, 2026 at 23:59 +0530
(24 hours after the assignment due date).

Question 6

Consider the grammar simplification pipeline and normal form transformations. Which of the following statements are correct? (Select all that apply)

🔒 Solution Locked
This solution will automatically unlock on Oct 27, 2026 at 23:59 +0530
(24 hours after the assignment due date).

Section C: Analytical, Numerical, & Proof Questions

Provide complete, step-by-step mathematical derivations, dynamic programming tables, and formal proofs.

Question 7 (Grammar Simplification & CNF Conversion)

Simplify the following context-free grammar \(G\) by eliminating useless variables, \(\lambda\)-productions, and unit productions, and then convert the resulting grammar into Chomsky Normal Form (CNF):

\[S \to aA \mid B \mid \lambda\] \[A \to aA \mid \lambda\] \[B \to bB \mid C\] \[C \to c\]

🔒 Solution Locked
This solution will automatically unlock on Oct 27, 2026 at 23:59 +0530
(24 hours after the assignment due date).

Question 8 (Execution of the CYK Parsing Algorithm)

Let \(G\) be the following grammar in Chomsky Normal Form: \[S \to AB \mid BC\] \[A \to BA \mid a\] \[B \to CC \mid b\] \[C \to AB \mid a\]

Use the Cocke-Younger-Kasami (CYK) dynamic programming algorithm to construct the triangular table \(P\) for the input string \(w = abba\) (length \(n = 4\)). Determine whether \(w \in L(G)\).

🔒 Solution Locked
This solution will automatically unlock on Oct 27, 2026 at 23:59 +0530
(24 hours after the assignment due date).

Question 9 (CFL Pumping Lemma Formal Proofs)

Rigorously prove using the CFL Pumping Lemma that the following languages are not Context-Free:

  1. \(L_1 = {a^n b^n c^n \mid n \ge 0}\)
  2. \(L_2 = {w w \mid w \in {a, b}^*}\)
🔒 Solution Locked
This solution will automatically unlock on Oct 27, 2026 at 23:59 +0530
(24 hours after the assignment due date).

Question 10 (Emptiness Decision Algorithm for CFGs)

Provide a complete, step-by-step formal algorithm to decide whether the language generated by an arbitrary Context-Free Grammar \(G = (V, T, S, P)\) is empty (\(L(G) = \emptyset\)). Prove its correctness and termination.

🔒 Solution Locked
This solution will automatically unlock on Oct 27, 2026 at 23:59 +0530
(24 hours after the assignment due date).
SDB Watermark