2. Reduction via computation histories
EECS 2001 Introduction to Theory of Computation 2
Post correspondence problem
Suppose we have two sets of strings over the alphabet {a,b}.
Suppose we make a longer string by concatenating members of the first set (repetition is
allowed)
Suppose we make another longer string by concatenating members of the second set (repetition
is allowed)
Is it possible to make the above two longer strings identical using the members of the sets
provided to us – is it decidable?
3. Reduction via computation histories
EECS 2001 Introduction to Theory of Computation 3
Post correspondence problem
Suppose Set 1 = {bb, ab, c}
Suppose Set 2 = {b, ba, bc}
The longer string from Set 1 = bbababababababc (we repeated the second string from set 1)
The longer string from Set 2 = bbababababababc (we repeated the second string from set 2)
Is this possible for all sets?
4. Reduction via computation histories
EECS 2001 Introduction to Theory of Computation 4
Post correspondence problem
Suppose Set 3 = {a, ab, bba}
Suppose Set 4 = {baa, aa, bb}
The longer string from Set 3 = bbaabbbaa
The longer string from Set 4 = bbaabbbaa
Is this possible for all sets?
5. Reduction via computation histories
EECS 2001 Introduction to Theory of Computation 5
Post correspondence problem
PCP = {⟨P⟩| P is an instance of the Post Correspondence Problem with a match}
Overview of the proof
The strings will be accepted by the TM if there is a computation history. If there is no computation
history, the TM can say reject. This is the functionality we need for deciding ATM. Contradiction.
Hence PCP is undecidable.
Detailed proof in the book. Read – not in the exam.
6. Reducibility
EECS 2001 Introduction to Theory of Computation 6
Until now, we have been using reducibility to prove whether a
language is decidable or not
Can we use reducibility to check a language for Turing-
recognizability?
7. Mapping Reducibility
EECS 2001 Introduction to Theory of Computation 7
Mapping reducibility (not a new concept – just formalizing
what we have already discussed)
If we can reduce problem A to B by using mapping reducibility, then
this means that there is a computable function which converts
instances of A into instances of B
There are other ways to formally define reducing one problem
to another
Mapping reducibility is just one way to define
Depends on the application of reducibility
8. Mapping Reducibility
EECS 2001 Introduction to Theory of Computation 8
Mapping reducibility (not a new concept – just formalizing
what we have already discussed)
If we can reduce problem A to B by using mapping reducibility, then
this means that there is a computable function which converts
instances of A to instances of B
Such a function is called a reduction
We can solve A with a solver for B
9. Mapping Reducibility
EECS 2001 Introduction to Theory of Computation 9
Computable function
A TM computes a function by starting with the input to the function and
stopping (halts) when the output of the function is on the tape
Formally, f: Σ*Σ*, where f is a computable function if there is a TM M
such that for every input w, M halts with only f(w) on the tape
10. Mapping Reducibility
EECS 2001 Introduction to Theory of Computation 10
Computable function example
Arithmetic operation on integers are computable functions
Think of a TM which takes as input one or more integers (m1,
m2, m3, m4, …) and returns
m1+m2+…,
m1-m2,
m1/m2,
m1*m2,
- m1
11. Mapping Reducibility
EECS 2001 Introduction to Theory of Computation 11
More complex computable function example
Takes a description of a TM as a string, and converts it into another
TM (output is the description of the new TM)
e.g.,
one which does not attempt to move left of the leftmost cell,
one that does not use any symbol to mark the start of the tape,
…
12. Mapping Reducibility
EECS 2001 Introduction to Theory of Computation 12
Formal definition
Language A is mapping reducible to Language B (A ≤m B), if there is a
computable function f: Σ*Σ*, where
w A f(w) B
13. Mapping Reducibility
EECS 2001 Introduction to Theory of Computation 13
Theorem 5.22
If A ≤m B and B is decidable, then A is decidable
Proof
Let M be the decider for B
Let f be the reduction from A to B
N (a decider for A) is described as
When w is received as input
Compute f(w)
Run M on f(w) and let N output whatever M outputs
In essence, If f(w) belongs to B, then w belongs to A
14. Mapping Reducibility
EECS 2001 Introduction to Theory of Computation 14
Previously, we have been using the following
Corollary 5.23
If A ≤m B and A is undecidable, then B is undecidable
Using the proven undecidability of something (ATM) to decide the
undecidability of some other problems
As compared to
Theorem 5.22 (previous slide)
If A ≤m B and B is decidable, then A is decidable
Using the proven decidability of something to decide the decidability of
some other problems
Note: the results will not change
15. Mapping Reducibility
EECS 2001 Introduction to Theory of Computation 15
Revisiting HALTTM
Previously: a decider for HALTTM was used to decide ATM, and we
ended up with a contradiction
Mapping reducibility from ATM to HALTTM
Computable function:
Input ⟨M, w⟩, Output ⟨M’, w’⟩
⟨M, w⟩ ∈ ATM if and only if ⟨M′, w′⟩ ∈ HALTTM.
Why is that?
Answer: if the HALT machine stops on the complement of the input then
only our input will be accepted by ATM
Remember: complement of something decidable should be recognizable
otherwise the original will not be decidable (HALT is a recognizer)
16. Mapping Reducibility
EECS 2001 Introduction to Theory of Computation 16
Revisiting HALTTM
Previously: a decider for HALTTM was used to decide ATM, and we
ended up with a contradiction
Mapping reducibility from ATM to HALTTM
Let F be a TM which computes the reduction f as follows
On input ⟨M, w⟩
F Constructs M’ which works as follows (on input x)
Run M on x (any string)
If M accepts, M’ accepts. If M rejects, M’ enters a loop.
Let D be the decider for HALT
Run D on ⟨M’, w⟩ as follows
If D accepts ⟨M’, w⟩ then F accepts ⟨M, w⟩
If D rejects ⟨M’, w⟩ then F rejects ⟨M, w⟩
17. Mapping Reducibility
EECS 2001 Introduction to Theory of Computation 17
Theorem 5.28
If A ≤m B and B is Turing-recognizable, then A is Turing-recognizable
Proof (similar to 5.22)
Let M be the Turing-recognizer for B
Let f be the reduction from A to B
N (a Turing-recognizer for A) is described as
When w is received as input
Compute f(w)
Run M on f(w) and output whenever M outputs
18. Mapping Reducibility
EECS 2001 Introduction to Theory of Computation 18
Corollary 5.29
If A ≤m B and A is not Turing-recognizable, then B is not
Turing-recognizable.
19. Mapping Reducibility
EECS 2001 Introduction to Theory of Computation 19
Corollary 4.23
ATM’ is not Turing recognizable
ATM is Turing recognizable
If ATM’ was also Turing recognizable, then ATM would be decidable
Since we have already proved that ATM is not decidable (Theorem 4.11), ATM’
must not be Turing-recognizable
20. EQTM is neither T-recognizable nor co-T-recognizable
EECS 2001 Introduction to Theory of Computation 20
Step 1: EQTM is not T-recognizable
Reducing ATM to EQTM’
Reducing function f
TM F takes (M, w) as input
1. Construct M1 and M2
M1 rejects on all inputs
M2 runs M on all inputs (w)
If M accepts w, then M2 accepts
2. Output (M1, M2)
The above steps mean that M1 accepts nothing and M2 accepts everything
(provided M accepts w). Hence the machines are not equivalent
Conversely, if M does not accept w, then M2 accepts nothing and they are
equivalent
Hence f reduces ATM to EQTM
21. EQTM is neither T-recognizable nor co-T-recognizable
EECS 2001 Introduction to Theory of Computation 21
Step 2: EQTM’ is not T-recognizable
Reducing ATM to EQTM (complement of EQTM’)
Showing ATM ≤m EQTM
Let the reducing function be g
TM G takes (M, w) as input
1. Construct M1 and M2
M1 Accept on all inputs
M2 run M on all inputs
If M accepts, then accept
2. Output (M1, M2)
The above steps mean that M1 accepts everything and M2 accepts
everything (provided M accepts w)
22. EQTM is neither T-recognizable nor co-T-recognizable
EECS 2001 Introduction to Theory of Computation 22
Difference between f and g
f
M1 always rejects
M accepts w iff M1 and M2 are equivalent
g
M1 always accepts
f and g
M accepts iff M2 always accepts
23. References
EECS 2001 Introduction to Theory of Computation 23
Ideas, problems and their solutions in this lecture/tutorial have been taken from
• Prof. Jeffery Edmonds’ Lecture notes for EECS 2001 at York University
• Prof. Suprakash Datta’ Lecture notes for EECS 2001 at York University
• Introduction to the Theory of Computation (3rd edition) by Michael Sipser
• Introduction to Theory of Computation by Anil Maheshwari and Michiel Smid
• Wikipedia and other webpages of different professors/universities