PDA for (ab)ⁿ, n≥1, by empty stack

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

Share on WhatsApp

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

Question

Construct a PDA accepting L={(ab)ⁿ | n≥1} by empty stack.

Asked in: CS-501 | November 2023 | 5(i)

Answer

Use states s,t,u and initial stack Z. δ(s,a,Z)=(t,Z), δ(t,b,Z)=(u,Z), δ(u,a,Z)=(t,Z), δ(u,ε,Z)=(u,ε). No other moves. The machine must read at least one ab pair before it can empty the stack. It accepts ab and abab, rejects ε, aab and aba. Although a stack is unnecessary for this regular language, this construction satisfies empty-stack acceptance.

← RGPV CS-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