Fill-in Reduction
1–3 pts · most exams · Q8 (24-25) / Q11 (23-24) · Backwards reasoning
Exam Pattern

A partial mapping reduction is shown. The reduction function F is mostly written — you fill in what the constructed machine M' must do (what L(M') should be), and/or explain what the reduction proves about L.

Two sub-parts:

Every exam instance

24-25 endterm Q8: Reduction from EQTM to L = {⟨M1,M2,M3,M4⟩ | ∀w ∈ Σ*: w is in exactly 1 or exactly 3 of these TMs' languages}. Fill in L(M3) and L(M4). Then: what does this prove about L?

24-25 resit Q8: Reduction from ETM to L = {⟨M1,M2,c⟩ | M1, M2 have finite languages with |L(M1)| − |L(M2)| ≥ c}. Fill in L(M'). Output is ⟨M', M, 3⟩.

23-24 endterm Q11: Reduction from L to ECFG. F converts grammar G to CNF, adds a new symbol. What is L? Does this prove L decidable?

The Mechanic

Backwards reasoning — how to find L(M')

Step 1. READ the reduction structure
   - What is the SOURCE problem? (ATM, ETM, EQTM, ...)
   - What is the TARGET problem? (the language L being analyzed)
   - What does F construct? (M', or a tuple like ⟨M', M, 3⟩)

Step 2. WORK BACKWARDS from the iff requirement
   For the reduction to be valid, both directions must hold:
   - YES case: if source input IS in the source language,
     what must L(M') be so that the output IS in L?
   - NO case: if source input is NOT in the source language,
     what must L(M') be so that the output is NOT in L?

Step 3. VERIFY both directions
   Does your choice of L(M') make YES → in L and NO → not in L?

Reduction direction rules — what A ≤m B transfers

Upward (from source to target):
  A undecidable  →  B undecidable
  A not TR       →  B not TR
  A not co-TR    →  B not co-TR

Downward (from target to source):
  B decidable    →  A decidable
  B recognizable →  A recognizable

Complement trick:
  A ≤m B  ⇔  Ā ≤m B̄   (same reduction function works)

Common source problems and what they transfer:

Source Known properties What it proves about target
ATM Undecidable, TR, not co-TR Target undecidable. Via complement: target not co-TR.
ETM Undecidable, co-TR, not TR Target undecidable. Via complement: target not TR.
EQTM Undecidable, not TR, not co-TR Target undecidable, not TR, not co-TR.
ECFG Decidable If reducing TO ECFG: source is decidable.

Why the complement trick matters for ATM and ETM: ATM is TR (not "not TR"), so ATMm L doesn't directly prove L is not TR. But it does give ĀTMm L̄, and ĀTM is not TR → L̄ not TR → L not co-TR. Same logic applies to ETM in the other direction.

Worked Example — Resit 24-25 Q8

L = {⟨M1, M2, c⟩ | M1 and M2 are TMs with finite languages such that |L(M1)| − |L(M2)| ≥ c}

Reduction from ETM to L:

F = "On input ⟨M⟩:

  1. Construct M' = "On input w: (a) …
  2. Write ⟨M', M, 3⟩ to the output tape."

What should L(M') be?

Step 1 — Read the structure

Source = ETM. Target = L. Output tuple = ⟨M', M, 3⟩, so M1=M', M2=M, c=3.

Step 2 — Work backwards

YES case (M ∈ ETM, i.e. L(M) = ∅):

NO case (M ∉ ETM, i.e. L(M) ≠ ∅):

Step 3 — Verify

Simplest answer: L(M') = {a, aa, aaa} — a fixed finite language of size 3.

L(M') = {a, aa, aaa} — any fixed finite language of size exactly 3.
Worked Example — Endterm 24-25 Q8

L = {⟨M1, M2, M3, M4⟩ | ∀w ∈ Σ*: w is in the language of exactly 1 or exactly 3 of these TMs}

Reduction from EQTM to L:

F = "On input ⟨M1, M2⟩:

  1. Construct M3 = "On input w: (a) …
  2. Construct M4 = "On input w: (a) …
  3. Write ⟨M1, M2, M3, M4⟩ to the output tape."

(a) What should L(M3) and L(M4) be?

YES case (⟨M1,M2⟩ ∈ EQTM, i.e. L(M1) = L(M2)):

NO case (⟨M1,M2⟩ ∉ EQTM, i.e. L(M1) ≠ L(M2)):

L(M3) = Σ*, L(M4) = ∅   (or vice versa)

(b) What does this reduction prove about L?

EQTMm L. Since EQTM is undecidable, not TR, and not co-TR:

L is undecidable, not Turing-recognizable, and not co-Turing-recognizable.
Worked Example — Endterm 23-24 Q11

Reduction from L to ECFG:

F = "On input ⟨G⟩:

  1. Convert G to CNF: G' = (V', Σ', R', S')
  2. Take symbol x ∉ Σ', construct G'' = (V', Σ' ∪ {x}, R' ∪ {S' → x}, S')
  3. Write ⟨G''⟩."

(a) Describe language L.

Key observation: G'' always has x ∈ L(G'') via the added rule S' → x. So L(G'') ≠ ∅ for any input G. Therefore ⟨G''⟩ ∉ ECFG always.

The reduction maps everything to NO-instances of ECFG. For A ≤m B: yes-instances of A must map to yes-instances of B. Since nothing maps to yes, L (the source) must have no yes-instances.

L = ∅

(b) Does this prove L decidable?

Yes. ∅ is decidable (reject everything). And ECFG is decidable. The reduction confirms: L ≤m ECFG, ECFG decidable → L decidable.

Yes — L is decidable (it's the empty language).
Practice
Q1 — ATM to "accepts everything"

Reduction from ATM to L. F = "On input ⟨M,w⟩: Construct M' = 'On input x: Run M on w. If accepts, accept.' Write ⟨M'⟩."

L = {⟨M⟩ | L(M) = Σ*}.

(a) Verify L(M') works for both cases. (b) What does ATMm L prove?

Solution

(a) Verify:

  • M accepts w → M' accepts every x → L(M') = Σ* → ⟨M'⟩ ∈ L ✓
  • M doesn't accept w → M' loops/rejects on every x → L(M') = ∅ → ⟨M'⟩ ∉ L ✓

(b) What it proves:

  • ATM undecidable → L is undecidable
  • Complement trick: ATMm L ⇔ ĀTMm L̄. ĀTM is not TR → L̄ is not TR → L is not co-TR.

Note: ATM is TR, but TR transfers downward (B recognizable → A recognizable), so we can't conclude L is TR from this reduction. We use the complement trick instead to get the not-co-TR result.

L is undecidable and not co-Turing-recognizable.
Q2 — ATM to "accepts at least 3 strings"

Given partial reduction from ATM to L = {⟨M⟩ | M accepts at least 3 strings}.

F = "On input ⟨M,w⟩: Construct M' = 'On input x: [???]'. Write ⟨M'⟩."

What should M' do?

Solution

M' = "On input x: Run M on w. If accepts, accept."

  • M accepts w → L(M') = Σ* (infinite, ≥ 3) ✓
  • M doesn't accept w → L(M') = ∅ (0 < 3) ✓
M' ignores its input and runs M on w. If M accepts, M' accepts.
Q3 — Reduction TO a decidable language

The reduction goes FROM L TO ADFA. What can we conclude about L?

Solution

ADFA is decidable. L ≤m ADFA with ADFA decidable → L is decidable.

Decidability transfers downward: if the target is decidable, the source must be too.

L is decidable.