← RGPV CD-501 Theory of Computation December 2024 Solved Question Paper
Question
Define PDA, discuss its closure properties, and draw a PDA accepting {0¹1ⁿ | n≥0} (exponent as printed).
Asked in: CD-501 | December 2024 | 4(a)
Answer
A pushdown automaton is M=(Q,Σ,Γ,δ,q₀,Z₀,F). It has a finite control and a stack; a transition reads a symbol or ε, inspects the stack top and replaces it by a stack string. Nondeterministic PDAs recognize exactly context-free languages.
Context-free languages are closed under union, concatenation, Kleene star, reversal, homomorphism, inverse homomorphism and intersection with regular languages. They are not closed under general intersection or complement. For instance, {aⁱbⁱcʲ} and {aⁱbʲcʲ} (nonnegative exponents) are context-free, but their intersection {aⁿbⁿcⁿ} is not.
The printed exponent on 0 is 1. Literally the language is 01*, which is regular. Use states A (initial), B (accepting), stack symbol Z and transitions δ(A,0,Z)={(B,Z)}, δ(B,1,Z)={(B,Z)}. All other transitions are undefined. Acceptance requires consuming the entire input. This accepts 0, 01 and 011, but rejects ε, 1 and 001.
If the intended exponent was n, the different language 0ⁿ1ⁿ can be accepted by pushing X for each 0, popping X for each 1, and accepting only after the input is exhausted and the bottom marker is exposed. Allow ε for n=0. This alternative is not a silent correction of the printed question.

← RGPV CD-501 Theory of Computation December 2024 Solved Question Paper
Discussion
Ask a question, share your thoughts or report an error.
Sign in to participate in the discussion.
Join the discussion