IAE Academy

GATE 2022 CS Q.46: solution and answer

GATE 2022 · CSQ.46 · 2 marks · MSQ

Which of the following is/are undecidable?

  1. (A)

    Given two Turing machines and , decide if .

  2. (B)

    Given a Turing machine , decide if is regular.

  3. (C)

    Given a Turing machine , decide if accepts all strings.

  4. (D)

    Given a Turing machine , decide if takes more than steps on every string.

See the question in the paper

Answer and solution

ANSWER

A, B and C are undecidable; D is decidable.

Official answer: A, B, CSource: Official answer key, GATE 2022 CS (IIT Kharagpur)

  1. (A) Equivalence of two Turing machines is a property of a pair of machines, so Rice's theorem does not apply directly. Reduce from the totality problem instead: fix to be a machine that accepts every string, so . Then exactly when accepts all strings. Totality is undecidable (see C), so equivalence is undecidable.

  2. (B) " is regular" is a property of the language . It is non-trivial: a machine for has it, and a machine for does not. By Rice's theorem it is undecidable.

  3. (C) "" is a property of the language . It is non-trivial: a machine accepting every string has it, and a machine accepting nothing does not. By Rice's theorem it is undecidable.

  4. (D) This is a property of the running time, not only of the language, so Rice's theorem does not apply and we argue directly. Let , a fixed constant. " takes more than steps on every string" means that no string makes halt within steps (a string on which loops forever counts as taking more than steps).

  5. In steps the head starts at cell and can reach at most cells . So the first steps depend only on the first input symbols. Hence if some string makes halt within steps, then the prefix of of length at most (or itself if it is shorter) makes halt within steps in the same way.

  6. So it is enough to simulate for steps on each of the finitely many strings over of length at most . If any simulation halts within steps the answer is NO, otherwise YES. This is a finite, if astronomically large, computation, so (D) is decidable.

  7. The undecidable problems are A, B and C.

KEY IDEA

Rice's theorem makes every non-trivial property of L(M) undecidable (B, C), and equivalence reduces from totality (A). A bound on running time with a fixed constant is different: only finitely many input prefixes matter, so brute-force simulation decides it (D).

WATCH OUT FOR

Calling D undecidable because it is about Turing machines, or applying Rice's theorem to it. It is a property of running time, not of the language, and the fixed step bound makes it a finite check.

From the GATE 2022 CS paper. Every question of this paper · Download the full paper · All 8 Turing machines questions, with notes

More Turing machines questions