CS Atlas GATE 2027
TOC course
0 / 91 complete

TOC/Phase 6 · Integration & Final Test

Phase bridge B6 · Item 85 of 91

Turing machines & undecidability, recalled

Read at your own pace. Try the questions before opening the answers.

On this page

Where you are in the story

Phases 4 and 5 completed the climb: an unbounded two-way tape gave us the Turing machine — strong enough to simulate any computer — and Cantor’s diagonalization showed that most languages over Σ* cannot be recognized by any Turing machine. Before integrating all six phases into the Master Rule Sheet, Mixed Practice, Pattern Drill, and the 30-question Final Test, lock in the core facts from Phases 4 and 5.

Previous phase in pictures

The complete Chomsky & automata hierarchy

All languages P(Σ*) uncountable (2^ℵ₀) — L_d, A̅_TM, E_TM live outside RE
RE (Type 0) Turing machine (recognizer, may loop) — A_TM, HALT_TM, PCP
REC (Decidable) Halting TM (decider: halts on all inputs)
CSL (Type 1) Linear Bounded Automaton (LBA) — aⁿbⁿcⁿ, ww, a^{prime}
CFL (Type 2) NPDA / CFG — wwᴿ, aⁱbʲcᵏ (i=j or j=k)
DCFL DPDA — aⁿbⁿ, wcwᴿ, balanced parentheses
Regular (Type 3) DFA / NFA / regex — a*b*, remainders, finite languages
Every inclusion is strict: Regular ⊊ DCFL ⊊ CFL ⊊ CSL ⊊ REC ⊊ RE ⊊ All languages.

Decider vs Recognizer & the Complementation Theorem

Decider (REC)
Halts on every input w:
• w ∈ L ⇒ halts in qacc
• w ∉ L ⇒ halts in qrej
Recognizer (RE)
Halts and accepts on w ∈ L;
on w ∉ L it may halt in qrej or loop forever.
L ∈ REC ⇔ L ∈ RE and L̅ ∈ RE
Run recognizers M₁ (for L) and M₂ (for L̅) in parallel step by step; one must halt!
The bridge between semi-decidable (RE) and decidable (REC).

Mapping reduction A ≤_m B

w
instance of A
computable total f
transforms w → f(w)
f(w)
instance of B
Decider / Recognizer for B
w ∈ A ⇔ f(w) ∈ B
If B is decidable (or RE), then A is decidable (or RE). Contrapositive: if A is undecidable (or not RE), then B is undecidable (or not RE).

Rice’s theorem filter

Non-trivial semantic property of L(M)
Depends ONLY on the language L(M), true for some RE languages and false for others (e.g. L(M)=∅, L(M) finite, L(M) regular) ⇒ Always Undecidable.
Syntactic or bounded-step property of M
Mentions number of states, transitions in ⟨M⟩, or halts within k steps (e.g. "M halts on ε within 100 steps") ⇒ Decidable (Rice does not apply).
Check whether the property is about L(M) alone before invoking Rice’s theorem.

Phase 4–5 decidability & RE/co-RE map

Language / ProblemStatusWhy
L_d (diagonal language)Not RE (co-RE)Differs from every M_i on w_i
A_TM, HALT_TM, {⟨M⟩ : L(M) ≠ ∅}RE, not RECSimulate M (or dovetail); accept when it accepts/halts
A̅_TM, E_TM = {⟨M⟩ : L(M) = ∅}co-RE, not REComplements of RE-complete languages
EQ_TM, TOTAL_TM, ALL_TM (L(M)=Σ*)Neither RE nor co-RERequire checking infinitely many inputs
PCP over |Σ| ≥ 2 vs |Σ| = 1Undecidable (RE) vs DecidableBinary PCP simulates TM computation histories; unary reduces to GCD/lengths
High-frequency Phase 5 classification targets.

Carry these forward

Do multi-tape, nondeterministic, or 2-stack machines add power over a standard 1-tape DTM?

No — all recognize the exact same class (RE) and decide the same class (REC). (4.2)

What machine and grammar correspond to Context-Sensitive Languages (Type 1)?

Linear Bounded Automata (LBA) and non-contracting grammars |α| ≤ |β|. (4.2)

What is the difference between a Recursive (REC) and a Recursively Enumerable (RE) language?

A decider for REC halts on all inputs; a recognizer for RE halts on w ∈ L but may loop on w ∉ L. (4.3.1)

When is an RE language L guaranteed to be decidable (REC)?

Exactly when its complement L̅ is also RE (L ∈ RE ∩ co-RE). (4.3.3)

Which closure property fails for RE but holds for REC?

Complement (and set difference). Conversely, arbitrary homomorphism holds for RE but fails for REC. (4.3.3)

What does the Universal Turing Machine U_TM take as input and do?

It takes the encoding ⟨M, w⟩ and simulates M on w; it recognizes A_TM. (4.4)

How many languages exist over {0,1}, and how many TMs exist?

Uncountably many languages (2^ℵ₀), but only countably many TMs (ℵ₀) — so most languages are not RE. (5.1)

Is A_TM = {⟨M, w⟩ | M accepts w} decidable or RE?

RE (via U_TM), but undecidable (proven by diagonalization / reduction from L_d). (5.2)

To prove a new problem B undecidable by reduction, which direction must you reduce?

Reduce a known undecidable problem A to B: A ≤_m B. (5.3)

When does Rice’s theorem apply?

To every non-trivial semantic property of RE languages (depends only on L(M), neither empty nor all RE). (5.4)

When is the Post Correspondence Problem (PCP) decidable?

When the alphabet is unary (|Σ| = 1); for |Σ| ≥ 2 it is undecidable (RE, not REC). (5.4)

For CSLs (LBAs), is membership decidable? Is emptiness decidable?

Membership is decidable (finite configurations in linear space); emptiness is undecidable. (5.5)

Quick refresher

  1. MSQ

    Which of the following machines have the exact same computational power as a standard deterministic Turing machine?

    1. A Nondeterministic Turing machine
    2. A Push-Down Automaton with 2 stacks
    3. A Linear Bounded Automaton (LBA)
    4. A Multi-tape Turing machine
  2. MCQ

    If L₁ is Recursive (decidable) and L₂ is Recursively Enumerable (but not decidable), what can be said about L₂ − L₁?

    1. It is always Recursive
    2. It is always Recursively Enumerable
    3. It is never Recursively Enumerable
    4. It is always regular
  3. MCQ

    Let L = { ⟨M⟩ | M is a TM and L(M) = ∅ }. Which class does L belong to?

    1. REC (Decidable)
    2. RE, but not REC
    3. co-RE, but not RE
    4. Neither RE nor co-RE
  4. MSQ

    Which of the following problems about Turing machines are DECIDABLE?

    1. Given ⟨M, w⟩, does M halt on w within 1000 steps?
    2. Given ⟨M⟩, is L(M) finite?
    3. Given ⟨M⟩, is L(M) Recursively Enumerable?
    4. Given ⟨M⟩, does M have an even number of states?
  5. MCQ

    Suppose A ≤_m B. Which statement is FALSE?

    1. If B ∈ REC, then A ∈ REC
    2. If A ∉ RE, then B ∉ RE
    3. If A ∈ REC, then B ∈ REC
    4. If B ∈ RE, then A ∈ RE

What the next phase adds

6.1 Master Rule Sheet
all formulas, closure & decidability tables
6.2 Mixed Practice 1–3
45 interleaved questions across all phases
6.3 GATE Pattern Drill
12 exam archetypes + speed methods
6.4 Final End-to-End Test
30 questions · 90 min timed mock
Phase 6: bring every tool together and test under real exam conditions.

Answer Vault

Reveal answers when you’re ready
  1. ABD — NTM, 2-stack PDA, and multi-tape TM are all Turing-equivalent. An LBA is restricted to linear space and recognizes only CSLs.
    • C: LBAs recognize CSLs, which is a strict subset of RE.
  2. B — L₂ − L₁ = L₂ ∩ L̅₁. Since L₁ is Recursive, its complement L̅₁ is Recursive (hence RE). Since RE is closed under intersection, L₂ ∩ L̅₁ is always RE.
    • A: Take L₁ = ∅; then L₂ − L₁ = L₂, which is not Recursive.
    • C: It is always RE.
    • D: Need not be regular.
  3. C — The complement L̅ = {⟨M⟩ | L(M) ≠ ∅} is RE (via dovetailing M on all strings) and undecidable (by Rice’s theorem). Thus L is co-RE and cannot be RE.
    • A: Undecidable by Rice’s theorem.
    • B: Its complement is RE; if L were also RE, L would be decidable.
    • D: Its complement is RE, so L is in co-RE.
  4. ACD — A is bounded simulation (1000 steps); C is a trivial semantic property (every TM’s language is RE, so always answer YES); D is syntactic inspection of ⟨M⟩. B is a non-trivial semantic property of L(M), undecidable by Rice.
    • B: Finiteness of L(M) is undecidable by Rice’s theorem.
  5. C — A decidable problem A can easily reduce to an undecidable problem B (for instance, map every yes-instance of A to a fixed halting TM and every no-instance to a looping TM). Thus A ∈ REC does NOT imply B ∈ REC.
    • A: True property of ≤_m.
    • B: True (contrapositive of B ∈ RE ⇒ A ∈ RE).
    • D: True property of ≤_m.

Ready for the next idea?

Mark this item complete when you’ve finished reading and working through it.