What language is accepted by the PDA M = ({q0, q1, q2}, {a, b}, {a, b, z}, δ, q0, z, {q2}) where in q0 every input symbol is pushed, δ(q0, λ, a) = {(q1, a)}, δ(q0, λ, b) = {(q1, b)}, in q1 a matches a and b matches b (pop), and δ(q1, λ, z) = {(q2, z)}?
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: D. L = {wwᴿ | w ∈ {a, b}⁺}
Explanation
q0 pushes the first half, nondeterministically switches to q1, then pops matching symbols in reverse order, accepting when the stack is back to z. That is the even-length palindromes wwᴿ.
More Theory of Computation and Compilers questions
- Match List I (production rules) with List II (grammar). List I: A. S → XY, X → 0, Y → 1. B. S → aS | bSS | c. C. S → AB, A → 0A | 1A | 0, B…
- Which of the following concepts can be used to identify loops? A. Depth first ordering B. Dominators C. Reducible graphs
- Given below are two statements Statement I: LL(1) and LR are examples of Bottom‐up parsers. Statement II: Recursive descent parser and SLR…
- Let L = L₁ ∩ L₂, where L₁ = {0ᵐ1ᵐ2 0ⁿ1ⁿ | m, n ≥ 0} and L₂ = {0ᵐ1ⁿ2ᵏ | m, n, k ≥ 0}. Then L is
- Let 1 and 2 be languages over represented by the regular expressions (a∗ + b)∗ (a + b)∗ and respectively. Which of the following is true wi…
- Which of the following statements is true?