BU CS 332 – Theory of Computation
Lecture 15:
- Undecidable and
Unrecognizable Languages
- Reductions
Reading: Sipser Ch 4.2, 5.1
Mark Bun March 23, 2020
BU CS 332 Theory of Computation Lecture 15: Reading: Undecidable - - PowerPoint PPT Presentation
BU CS 332 Theory of Computation Lecture 15: Reading: Undecidable and Unrecognizable Languages Sipser Ch 4.2, 5.1 Reductions Mark Bun March 23, 2020 How can we compare sizes of infinite sets? Definition: Two sets have the same size if
Unrecognizable Languages
Reading: Sipser Ch 4.2, 5.1
Mark Bun March 23, 2020
Definition: Two sets have the same size if there is a correspondence (bijection) between them A set is countable if
3/23/2020 CS332 ‐ Theory of Computation 2
Theorem: Let be a set. Then the power set does not have the same size as . Proof: Assume for the sake of contradiction that there is a correspondence Goal: Use diagonalization to construct a set that cannot be the output for any
3/23/2020 CS332 ‐ Theory of Computation 3
3/23/2020 CS332 ‐ Theory of Computation 4
3/23/2020 CS332 ‐ Theory of Computation 5
𝐄𝐆𝐁
decidable
𝐃𝐆𝐇
decidable
𝐄𝐆𝐁
decidable
𝐃𝐆𝐇
decidable
𝐄𝐆𝐁
decidable
𝐔𝐍
?
𝐔𝐍
?
𝐔𝐍
?
𝐃𝐆𝐇
?
These natural computational questions about computational models are undecidable I.e., computers cannot solve these problems no matter how much time they are given
3/23/2020 CS332 ‐ Theory of Computation 6
Theorem: There exists an undecidable language over Proof: A simplifying assumption: Every string in
∗ is the
encoding
Set of all Turing machines:
∗
Set of all languages over : There are more languages than there are TM deciders!
3/23/2020 CS332 ‐ Theory of Computation 7
all subsets of
∗
=
Theorem: There exists an unrecognizable language over Proof: A simplifying assumption: Every string in
∗ is the
encoding
Set of all Turing machines:
∗
Set of all languages over : There are more languages than there are TM recognizers!
3/23/2020 CS332 ‐ Theory of Computation 8
all subsets of
∗
=
3/23/2020 CS332 ‐ Theory of Computation 9
TM 𝑁 𝑁 𝑁 𝑁 𝑁
…
3/23/2020 CS332 ‐ Theory of Computation 10
TM 𝑁 𝑁 𝑁 ? 𝑁 𝑁 ? 𝑁 𝑁 ? 𝑁 𝑁 ? 𝑁
Y N Y Y
𝑁
N N Y Y
𝑁
Y Y Y N
𝑁
N N Y N
… …
Suppose decides
𝐸 𝐸 ? 𝐸
Theorem: is undecidable Proof: Suppose for contradiction, that decides Corollary:
3/23/2020 CS332 ‐ Theory of Computation 11
is undecidable
But first:
is Turing‐recognizable
The following “universal TM” recognizes
:
accepts, accept. If rejects, reject.
3/23/2020 CS332 ‐ Theory of Computation 12
"It is possible to invent a single machine which can be used to compute any computable sequence. If this machine U is supplied with a tape on the beginning of which is written the S.D ["standard description"] of some computing machine M, then U will compute the same sequence as M.” ‐ Turing, “On Computable Numbers…” 1936
3/23/2020 CS332 ‐ Theory of Computation 13
Harvard architecture: Separate instruction and data pathways von Neumann architecture: Programs can be treated as data
is undecidable
Proof: Assume for the sake of contradiction that TM decides
:
Idea: Show that can be used to decide the (undecidable) language
‐‐ a contradiction.
3/23/2020 CS332 ‐ Theory of Computation 14
decides
On input where is a TM: 1. Run
2. If accepts, accept. If rejects, reject. Claim: decides
3/23/2020 CS332 ‐ Theory of Computation 15
Theorem: A language is decidable if and only if and are both Turing‐recognizable. Proof:
3/23/2020 CS332 ‐ Theory of Computation 16
3/23/2020 CS332 ‐ Theory of Computation 17
context free regular recognizable decidable
3/23/2020 CS332 ‐ Theory of Computation 18
is undecidable
Proof: Assume for the sake of contradiction that TM decides
:
Idea: Show that can be used to decide the (undecidable) language
‐‐ a contradiction.
“A reduction from
to ”
3/23/2020 CS332 ‐ Theory of Computation 19
A computer scientist and an engineer are stranded on a desert island. They find two palm trees with one coconut
eats. The computer scientist climbs the second tree, picks a coconut, climbs down, climbs up the first tree and places it there, declaring success. “Now we’ve reduced the problem to one we’ve already solved.”
3/23/2020 CS332 ‐ Theory of Computation 20
A reduction from problem to problem is an algorithm for problem which uses an algorithm for problem as a subroutine If such a reduction exists, we say “ reduces to ”
3/23/2020 CS332 ‐ Theory of Computation 21
Positive uses: If reduces to and is decidable, then is also decidable
3/23/2020 CS332 ‐ Theory of Computation 22
is decidable
Proof: The following TM decides
that recognizes the symmetric difference
and return its output
Negative uses: If reduces to and is undecidable, then is also undecidable
3/23/2020 CS332 ‐ Theory of Computation 23
𝐵 𝑁, 𝑥 𝑁 is a TM that accepts input 𝑥 Suppose 𝐼 decides 𝐵 Consider the following TM 𝐸. On input 𝑁 where 𝑁 is a TM: 1. Run 𝐼 on input 𝑁, 𝑁 2. If 𝐼 accepts, accept. If 𝐼 rejects, reject. Claim: 𝐸 decides 𝑇𝐵 𝑁 𝑁 is a TM that accepts on input 𝑁
Negative uses: If reduces to and is undecidable, then is also undecidable Proof template:
is decidable
as a subroutine, construct an algorithm deciding
is undecidable. Contradiction!
3/23/2020 CS332 ‐ Theory of Computation 24
is undecidable
Proof: Suppose for contradiction that there exists a decider for
. We construct a decider for as follows:
On input : 1. Run
2. If rejects, reject 3. If accepts, simulate
4. If accepts, accept. Otherwise, reject This is a reduction from
to
CS332 ‐ Theory of Computation 25
Proof: Suppose for contradiction that there exists a decider for . We construct a decider for
as follows:
On input : 1. Run
This is a reduction from
to
3/23/2020 CS332 ‐ Theory of Computation 26
Proof: Suppose for contradiction that there exists a decider for . We construct a decider for
as follows:
On input : 1. Construct a TM as follows:
, accept. Otherwise, reject This is a reduction from
to
3/23/2020 CS332 ‐ Theory of Computation 27