Undecidability Triple
7 pts · every exam · Always Q7 in current format
Exam Pattern

The exam always gives a language L over TM encodings. Three fixed sub-parts, same structure every time:

Part Task Pts What you do
(a) Prove L is TR or co-TR 2 Build a recognizer (for L or for L̄)
(b) Prove L is undecidable 4 Mapping reduction from ATM, ETM, or EQTM
(c) Prove L is not TR / not co-TR 1 Combine (a) + (b) via complement logic — free point
Every exam instance

24-25 endterm Q7: L = {⟨M⟩ | M is a DTM with an unreachable reject state}. (a) co-TR (2pts) (b) undecidable (4pts) (c) not TR (1pt)

24-25 resit Q7: L = {⟨M,k⟩ | M accepts at least k words of length ≥ k}. (a) TR (2pts) (b) undecidable (4pts) (c) not co-TR (1pt)

23-24 endterm Q9: L = {⟨M1,M2⟩ | {⟨M1⟩,⟨M2⟩} ∩ (L(M1) ∪ L(M2)) = ∅}. (a) co-TR (2pts) (b) undecidable (5pts) (c) not TR (1pt)

Decidability Reference Table
Problem Definition TR? co-TR? Decidable?
ATM {⟨M,w⟩ : M accepts w} Yes No No
ETM {⟨M⟩ : L(M) = ∅} No Yes No
EQTM {⟨M1,M2⟩ : L(M1) = L(M2)} No No No

Key theorem: L is decidable if and only if L is both TR and co-TR.

The Template

Part (a): Prove TR or co-TR — 2 pts

Decision tree: which side can you detect?

If L is Turing-recognizable (TR): Build a TM that accepts when input is in L. May loop on non-members.

If L is co-Turing-recognizable (co-TR): Build a TM that accepts the COMPLEMENT L̄. Equivalently: build a TM that accepts when input is NOT in L.

Rule of thumb: "finite/bounded properties" → often co-TR (check finitely many cases to refute). "Infinite/unbounded properties" → often TR (enumerate to confirm).

Part (b): Prove undecidable — 4 pts (THE CORE SKILL)

This is a mapping reduction. You prove: "if L were decidable, then ATM would be decidable too — contradiction." Three steps:

Step 1 — Setup: Assume R decides L.

Step 2 — Build the reduction: Construct a decider S for ATM:

S = "On input ⟨M, w⟩:
  1. Construct M' = "On input x:
       Run M on w.
       If M accepts → [behave so L(M') SATISFIES L's condition]
       If M rejects/loops → [behave so L(M') VIOLATES L's condition]"
  2. Run R on ⟨M'⟩ (or ⟨M', k⟩ etc.)
  3. Output R's answer (or flip it, if the mapping is inverted)."

Step 3 — Argue both directions:

Therefore S decides ATM. Contradiction.

The most common M' construction

Almost always: M' ignores its own input x, runs M on w, then either accepts everything (Σ*) or nothing (∅). This swings L(M') between satisfying and violating L's condition.

M accepts w → L(M') = Σ*.   M doesn't accept w → L(M') = ∅.

You never RUN M'. You just BUILD its description and hand it to R. M' is a specification, not an execution.

How to choose the source problem:

Part (c): Complement logic — 1 pt (FREE point)

The logic: TR + co-TR = decidable. So if one side holds and decidability fails, the other side must fail.

If (a) proved And (b) proved undecidable Then (c) concludes
L is co-TR L is undecidable L is not TR
L is TR L is undecidable L is not co-TR

Exam sentence: "From (a), L is [TR/co-TR]. From (b), L is undecidable. If L were also [co-TR/TR], then L would be decidable (TR + co-TR = decidable). Contradiction. Hence L is not [co-TR/TR]."

Worked Example — Resit 24-25 Q7

L = {⟨M,k⟩ | M is a TM that accepts at least k words of length ≥ k}

(a) Prove L is Turing-recognizable — 2 pts

Build a recognizer for L

"On input ⟨M,k⟩:

  1. Let s1, s2, … be all strings in Σ* with |si| ≥ k
  2. Initialise counter = 0
  3. For i = 1, 2, 3, …:
    1. Run M for i steps on each of s1, …, si
    2. If M accepts any sj (not previously counted), increment counter
    3. If counter ≥ k, accept"

This is a recognizer: if M really does accept ≥ k long words, dovetailing will eventually find them. If not, we loop forever. That's fine — TR only requires halting on yes-instances.

(b) Prove L is undecidable — 4 pts

Step 1 — Setup

Assume R decides L. We build a decider S for ATM.

Step 2 — Construct the reduction

S = "On input ⟨M, w⟩:

  1. Construct M' = "On input x:
    1. Run M on w. If it accepts, accept. If it rejects, reject."
  2. Run R on ⟨M', 1⟩.
  3. If R accepts, accept. Otherwise, reject."

Step 3 — Argue both directions

S decides ATM. But ATM is undecidable. Contradiction. ∎

(c) Prove L is not co-Turing-recognizable — 1 pt

From (a), L is TR. From (b), L is undecidable.

If L were also co-TR, then L would be decidable (since TR + co-TR = decidable). But L is undecidable. Contradiction.

Hence L is not co-TR. ∎
Worked Example — Endterm 24-25 Q7

L = {⟨M⟩ | M is a DTM with an unreachable reject state}

(a) Prove L is co-Turing-recognizable — 2 pts

Build a recognizer for L̄ (complement: "M has a REACHABLE reject state")

"On input ⟨M⟩:

  1. Let s1, s2, … enumerate all strings in Σ*
  2. For i = 1, 2, 3, …:
    1. Run M on s1, …, si for i steps each
    2. If M reaches qreject on any sj, accept"

If M has a reachable reject state, some input will reach it, and dovetailing finds it. If not, we loop. This recognizes L̄, so L is co-TR.

(b) Prove L is undecidable — 4 pts

Step 1 — Setup

Assume R decides L. We build a decider S for ATM.

Step 2 — Construct the reduction

S = "On input ⟨M, w⟩:

  1. Construct M' = "On input x: Run M on w. If it accepts, accept. If it rejects, reject."
  2. Run R on ⟨M'⟩.
  3. If R accepts, accept. Otherwise, reject."

Step 3 — Argue both directions

S decides ATM. But ATM is undecidable. Contradiction. ∎

(c) Prove L is not TR — 1 pt

From (a), L is co-TR. From (b), L is undecidable.

If L were also TR, then L would be decidable (since TR + co-TR = decidable). But L is undecidable. Contradiction.

Hence L is not TR. ∎
Practice
Q1 — Endterm 23-24 Q9 (real exam, 8 pts)

L = {⟨M1,M2⟩ | {⟨M1⟩, ⟨M2⟩} ∩ (L(M1) ∪ L(M2)) = ∅}

(a) Prove L is co-TR (2 pts). (b) Prove L is undecidable (5 pts). (c) Prove L is not TR (1 pt).

Solution

(a) co-TR: Build a recognizer for L̄ (complement: {⟨M1⟩, ⟨M2⟩} ∩ (L(M1) ∪ L(M2)) ≠ ∅).

"On input ⟨M1,M2⟩: Dovetail — run M1 and M2 on both ⟨M1⟩ and ⟨M2⟩. If any machine accepts either encoding, accept."

Only 4 simulations to interleave. If the intersection is non-empty, at least one will halt and accept.

(b) Undecidable: Reduce from ATM.

Step 1: Assume R decides L.

Step 2: Build decider S for ATM:

S = "On input ⟨M, w⟩:

  1. Construct M' = "On input x: Run M on w. If accepts, accept."
  2. Let Treject = a TM that rejects every input (L(Treject) = ∅).
  3. Run R on ⟨M', Treject⟩.
  4. If R accepts, reject. If R rejects, accept."

Step 3: Both directions:

  • M accepts w → L(M') = Σ* → ⟨M'⟩ ∈ L(M') → {⟨M'⟩, ⟨Treject⟩} ∩ (L(M') ∪ L(Treject)) ≠ ∅ → ⟨M', Treject⟩ ∉ L → R rejects → S accepts ✓
  • M doesn't accept w → L(M') = ∅ → intersection = ∅ → ⟨M', Treject⟩ ∈ L → R accepts → S rejects ✓

Note the flip: R's answer is inverted because ATM membership maps to L non-membership here.

S decides ATM. Contradiction. ∎

(c) Not TR: co-TR (from a) + undecidable (from b) → not TR. ∎

Q2 — Palindrome acceptance

L = {⟨M⟩ | M accepts at least one palindrome}

(a) Prove L is TR or co-TR. (b) Prove L is undecidable. (c) Prove L is not TR/co-TR.

Solution

(a) TR: Enumerate all palindromes p1, p2, … Dovetail: run M on p1, …, pi for i steps. If M accepts any palindrome, accept.

If M accepts a palindrome, dovetailing eventually finds it. If not, we loop forever. TR. ✓

(b) Undecidable: Reduce from ATM.

Step 1: Assume R decides L.

Step 2: Build decider S for ATM:

S = "On input ⟨M, w⟩:

  1. Construct M' = "On input x: Run M on w. If accepts, accept."
  2. Run R on ⟨M'⟩.
  3. If R accepts, accept. Otherwise, reject."

Step 3: Both directions:

  • M accepts w → L(M') = Σ* ⊇ palindromes → ⟨M'⟩ ∈ L → R accepts → S accepts ✓
  • M doesn't accept w → L(M') = ∅ → no palindromes accepted → ⟨M'⟩ ∉ L → R rejects → S rejects ✓
S decides ATM. Contradiction. ∎

(c) Not co-TR: TR (from a) + undecidable (from b) → not co-TR. ∎

Q3 — Accepts empty string

L = {⟨M⟩ | ε ∈ L(M)}   (M accepts the empty string)

(a) Prove L is TR or co-TR. (b) Prove L is undecidable. (c) Prove L is not TR/co-TR.

Solution

(a) TR: Run M on ε. If it accepts, accept.

If M accepts ε, we halt and accept. If M loops on ε, we loop. TR. ✓

(b) Undecidable: Reduce from ATM.

Step 1: Assume R decides L.

Step 2: Build decider S for ATM:

S = "On input ⟨M, w⟩:

  1. Construct M' = "On input x: Ignore x, run M on w. If accepts, accept."
  2. Run R on ⟨M'⟩.
  3. If R accepts, accept. Otherwise, reject."

Step 3: Both directions:

  • M accepts w → L(M') = Σ* → M' accepts ε → ⟨M'⟩ ∈ L → R accepts → S accepts ✓
  • M doesn't accept w → L(M') = ∅ → M' doesn't accept ε → ⟨M'⟩ ∉ L → R rejects → S rejects ✓
S decides ATM. Contradiction. ∎

(c) Not co-TR: TR (from a) + undecidable (from b) → not co-TR. ∎