PDA for a²ⁿbⁿ, 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={a²ⁿbⁿ | n≥1} by empty stack.

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

Answer

Use states e (even number of a), o (odd), and m (matching b). Start e with Z. On a in e move to o without changing stack; on a in o push X and return e. From e on b with X pop and enter m; in m on b with X pop. In m pop Z by ε. No other transitions. Thus every pair of a symbols contributes one X, and each b removes one. At least one b is required, and odd counts or incorrect ordering reject.

← 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