Convert the printed PDA to a CFG

December 4, 2026 · Team EasyExamNotes · 1 min read (est.) · 0 comments

Share on WhatsApp

← RGPV CD-501 Theory of Computation November 2023 Solved Paper

Question

Construct a CFG for N(M), where M=({q₀,q₁},{a,b},{x,z₀},δ,q₀,z₀,∅), with δ(q₀,0,z₀)=(q₀,xz₀), δ(q₀,0,x)=(q₀,xx), δ(q₀,1,z)=(q₁,ε), δ(q₁,1,x)=(q₁,ε), δ(q₁,ε,x)=(q₁,ε), δ(q₁,ε,z₀)=(q₁,ε). (Alphabet and z notation as printed.)

Asked in: CD-501 | November 2023 | 6(b)

Answer

The printed alphabet {a,b} conflicts with transitions on 0,1; the third transition uses undefined z. Assuming z means x, and the transition labels 0,1 are intended, q0 pushes one x per zero; the first 1 pops x and enters q1; further ones pop x; ε moves discard remaining x and bottom marker. Thus the language is 0ⁿ1ᵐ with n≥m≥1. A grammar is S→0S1|0T1; T→0T|ε. Each outer pair contributes one zero and one one; T supplies extra zeros. If z instead means z0, this interpretation changes, so the printed PDA does not uniquely determine the grammar.

← RGPV CD-501 Theory of Computation November 2023 Solved Paper

Discussion

Ask a question, share your thoughts or report an error.

Sign in to participate in the discussion.

Join the discussion