Which of the following languages over {a,b,c} is accepted by a deterministic…

1997

Which of the following languages over {a,b,c} is accepted by a deterministic pushdown automata?

  1. A.

    {w c w R ∣ w ∈ {a,b}}

  2. B.

    { w wR ∣ w ∈ {a,b,c}}

  3. C.

    {an bn cn | n ≥ 0}

  4. D.

    {w ∣ w is a palindrome over {a,b,c}}

Attempted by 6 students.

Show answer & explanation

Correct answer: A

The language {w c wR | w∈{a,b}*} is accepted by a deterministic pushdown automaton because the middle symbol 'c' acts as an unambiguous center marker. The PDA can push all symbols from w onto the stack, transition upon reading 'c', and then pop to match the reversed portion. In contrast, palindromes without a center marker require non-determinism to guess the midpoint.

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…