NPDA for wwᴿ by empty stack

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

Share on WhatsApp

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

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

Question

Construct a PDA accepting L={wwᴿ | w∈{a,b}*} by empty stack.

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

Construct an NPDA accepting L={wwᴿ | w∈{a,b}*} by empty stack.

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

Answer

Start with bottom symbol Z. In push state p, for each input a or b and stack top X push that input above X. Nondeterministically switch to matching state m without consuming input or changing stack. In m, consume a only with top a and pop; similarly b. Pop Z by ε in m. Accept only when input and stack are both empty. Example abba pushes a,b then matches b,a. The guessed midpoint ensures equal halves in reverse order; ε is accepted.

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

← 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