All mock tests are FREE till 31 December — register to save your progress
Unit 8 · Theory of Computation and Compilers Paper 2 CS · June 2024 (Cancelled Exam)

The language of the following PDA would be:
δ(q0, a, z0) = (q0, aaaz0)
δ(q0, a, a) = (q0, aaaa)
δ(q0, b, a) = (q1, λ)
δ(q1, b, a) = (q1, λ)
δ(q1, ε, z0) = (qf, z0), where qf is the final state.

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: C. {aⁿb³ⁿ | n > 0}

Explanation

Each a pushes three a's onto the stack, and each b pops one. Acceptance requires the stack to return to z0, so #b = 3·#a.

More Theory of Computation and Compilers questions