SlideShare a Scribd company logo
1 of 23
Download to read offline
Computational Complexity; slides 3, HT 2019
Undecidability
Prof. Paul W. Goldberg (Dept. of Computer Science,
University of Oxford)
HT 2019
Paul Goldberg Undecidability 1 / 19
Undecidable Languages
Aim of this section
Show that there are languages (problems) that cannot be decided
no matter how long we are willing to wait for an answer.
A counting argument (sketch):
The number of Turing machines is infinite but countable
The number of different languages is infinite but uncountable
Therefore, there are “more” languages than Turing machines
It follows that there are languages that are not decidable.
Indeed some aren’t even semi-decidable.
Paul Goldberg Undecidability 2 / 19
The Halting Problem
previous argument shows that there are undecidable languages.
Can we find a concrete example?
Halting problem (HALT)
Input: A Turing machine M and an input string w
Question: Does M halt on w?
Theorem.
1 HALT is recursively enumerable (accepted by a TM).
2 HALT is undecidable.
details in e.g. Sipser Chapter 4.2
Paul Goldberg Undecidability 3 / 19
Undecidability of HALT
Theorem.
1 HALT is recursively enumerable (accepted by a TM).
2 HALT is undecidable.
Proof structure of 2nd part:
1 A decidable language can be decided by a 1-tape machine.
2 universal Turing acceptor – a TM U that can simulate other
TMs given as input (an interpreter for TMs).
3 reduce halting (in general) to halting of UTM U.
4 if halting of U is decidable, there exists a TM D that decides
if a given TM M running on itself is non-terminating.
5 running D on itself reveals a paradox: running D on itself
terminates (and accepts) iff running D on itself is
non-terminating.
6 no such D can exist, so halting of U (and hence halting in
general) is undecidable.
Paul Goldberg Undecidability 4 / 19
some details
I’ll skip construction of UTM U
HALT: Decide for any hM, wi where M is a TM and w ∈ {0, 1}∗:
M halts on w?
Reduce to: Decide for 1-tape TM M and w ∈ {0, 1}∗
U halts on hM, wi
Note: U simulates the computation of M on w
In particular, U halts on hM, wi iff M halts on w
Paul Goldberg Undecidability 5 / 19
some details (design of “contradictory” TM D)
Assume L := {hM, wi | U halts on hM, wi} is decidable
I.e. we can predict with some TM for all M with Σ = {0, 1} and
w ∈ {0, 1}∗ whether or not U halts on hM, wi
i.e. there is a TM H such that
H(hM, wi) :=

accept if U halts on hM, wi
reject otherwise
We can use H to build another TM D:
D(hMi) :=

accept if H rejects hM, hMi
reject otherwise
i.e., D(hMi) = accept iff M(hMi) does not halt
But what result does D compute for input hDi?
D(hDi) halts and accepts iff D(hDi) does not halt
Paul Goldberg Undecidability 6 / 19
HALT, wrapping up
So, HALT is rec. enum. but not decidable, where HALT is
{hM, wi : M halts on w}
Recall: A language L ⊆ Σ∗ is decidable iff L and Σ∗  L are
recursively enumerable.
Proof: ⇒ trivial. ⇐ Let acceptors for L and Σ∗  L run in parallel.
Corollary. HALT is not recursively enumerable.
L(HALT) := {hM, wi : M does not halt on input w }
Proof. A decided for HALT can be modified to get a decider for
HALT.
Paul Goldberg Undecidability 7 / 19
Classification of Languages
Definition. A language L ⊆ Σ∗ is co-recursively enumerable, or
co-r.e., if Σ∗  L is recursively enumerable.
Example: L(HALT) is co-r.e (but not r.e.).
Observation.1 Decidable = r.e. ∩ co-r.e.
1
deserves more detailed explanation
Paul Goldberg Undecidability 8 / 19
Further Undecidable Problems
We want to show that the following problems are also undecidable.
ε-Halting
Input: Turing acceptor M
Problem: Does M halt on the empty input?
Equivalence
Input: Turing acceptors M and M0
Problem: Is it true that L(M) = L(M0)?
Emptiness
Input: Turing acceptor M
Problem: Is L(M) = ∅?
Paul Goldberg Undecidability 9 / 19
Reductions
A major tool in analysing and classifying problems is the idea of
“reducing one problem to another”
Reductions.
Informally, a problem A is reducible to a problem B if we can
use methods to solve B in order to solve A.
We want to capture the idea, that A is ”no harder” than B.
(as we can use B to solve A.)
Paul Goldberg Undecidability 10 / 19
Turing Reductions
Turing Reduction:
Informally, a problem A is Turing reducible to B if we can solve A
using a program solving B as sub-program.
We write A ≤T B.
Example: HALT is Turing reducible to HALT.
take a Turing acceptor accepting HALT as sub-program
and reverse its output
Paul Goldberg Undecidability 11 / 19
Turing Reductions
Turing Reduction:
Informally, a problem A is Turing reducible to B if we can solve A
using a program solving B as sub-program.
We write A ≤T B.
Example: HALT is Turing reducible to HALT.
take a Turing acceptor accepting HALT as sub-program
and reverse its output
Turing reductions are free/unrestricted; sometimes too much so for
our purposes.
Many-One Reductions (Sipser: “mapping reduction”) are
more informative: A ≤T B relates (un)decidability of problems;
use A ≤m B (next slide) to find out if a problem (or its
complement) is recursively enumerable.
Paul Goldberg Undecidability 11 / 19
Many-One Reductions
Definition. A language A is many-one reducible to a language B if
there exists a computable function f such that for all w ∈ Σ∗:
x ∈ A ⇐⇒ f (x) ∈ B.
We write A ≤m B.
Observation 1. If A ≤m B and B is decidable, then so is A.
Proof. A many-one reduction is a Turing reduction, so it inherits
that functionality
Observation 2. If A ≤m B and B is recursively enumerable, then so
is A.
Equivalently, if A is not decidable (resp. r.e.) then neither is B; so,
a tool for “negative results”
Paul Goldberg Undecidability 12 / 19
Properties of Many-One Reductions
1 ≤m is reflexive and transitive
(if A ≤m B and B ≤m C then A ≤m C, by composition of
functions.)
2 If A is decidable and B is any language apart from ∅ and Σ∗,
then A ≤m B.
As B 6= ∅ and B 6= Σ∗ there are wa ∈ B and wr 6∈ B.
For w ∈ Σ∗, define f (w) :=
(
wa if w ∈ A
wr if w 6∈ A
(Hence, many-one reductions are too weak to distinguish
between decidable problems. later: “smarter” reductions)
Paul Goldberg Undecidability 13 / 19
Examples for Many-One Reductions
We will show the following chain of reductions:
HALT ≤m ε-HALT ≤m EQUIVALENCE
ε-HALT: Does M halt on the empty input?
EQUIVALENCE: L(M) = L(M0)?
Hence, all these problems are undecidable.
Paul Goldberg Undecidability 14 / 19
HALT ≤m ε-HALT
Lemma. HALT ≤m ε-HALT
Proof. Define function f such that w ∈ HALT ⇐⇒ f (w) ∈ ε-HALT
For w := hM, vi compute the following Turing machine Mw :
1 Write v onto the input tape.
2 Simulate M.
Clearly, Mw accepts the empty word if, and only if, M accepts v.
Let Mr be a TM that does not halt on the empty input.
Define f (w) :=
(
Mw if w = hM, vi
Mr if w is not of the correct input form 2
2
i.e. doesn’t encode a TM with word
Paul Goldberg Undecidability 15 / 19
ε-HALT ≤m EQUIVALENCE
Lemma. ε-HALT ≤m EQUIVALENCE
Proof. Define f such that w ∈ ε-HALT ⇐⇒ f (w) ∈ EQUIVALENCE
Let Ma be a Turing machine that accepts all inputs.
For a TM M compute the following Turing machine M∗ :
1 Run M on the empty input
2 If M halts, accept.
M∗ is equivalent to Ma if, and only if, M halts on the empty
input.
Define
f (w) :=
(
(hM∗i, hMai) if w = hMi
(w, hMai) if w is not of the correct input form
Paul Goldberg Undecidability 16 / 19
Rice’s Theorem
Theorem. Every non-trivial property of Turing machines is
undecidable.
Paul Goldberg Undecidability 17 / 19
Rice’s Theorem
Theorem. Every non-trivial property of Turing machines is
undecidable.
Formally: Let R be a non-trivial subclass of the class of all
recursively enumerable languages. (R 6= ∅ and R 6= all r.e. lang.)
Then “R-ness” is undecidable:
Given: Turing machine M
Problem: Is L(M) ∈ R?
(that is, R-ness = {hMi : L(M) ∈ R} is undecidable.)
Paul Goldberg Undecidability 17 / 19
Rice’s Theorem
Theorem. Every non-trivial property of Turing machines is
undecidable.
Formally: Let R be a non-trivial subclass of the class of all
recursively enumerable languages. (R 6= ∅ and R 6= all r.e. lang.)
Then “R-ness” is undecidable:
Given: Turing machine M
Problem: Is L(M) ∈ R?
(that is, R-ness = {hMi : L(M) ∈ R} is undecidable.)
Proof. Define f such that w ∈ ε-HALT ⇐⇒ f (w) ∈ R-ness
Paul Goldberg Undecidability 17 / 19
Rice’s Theorem
Proof. Define f such that w ∈ ε-HALT ⇐⇒ f (w) ∈ R-ness
W.l.o.g. assume ∅ 6∈ R. (We could always use R.)
Let ML be a Turing machine that accepts some L ∈ R.
For a TM M compute the following Turing machine M∗:
On input s ∈ Σ∗
1 Simulate M on ε
2 If M halts, then simulate ML on s
Clearly L(M∗) = L ∈ R if M halts on ε,
and L(M∗) = ∅ 6∈ R if M does not halt on ε.
Let M∅ be a TM that does not accept any input (i.e.,
L(M∅) = ∅).
Define f (w) :=
(
M∗ if w = hMi
M∅ if w is not of the correct input form
Paul Goldberg Undecidability 18 / 19
Decidable and Enumerable Languages
Recursion Theory:
Study the border between decidable and undecidable languages
Study the fine structure of undecidable languages.
(The work of Turing, Church, Post, ... was before
computers existed.)
Paul Goldberg Undecidability 19 / 19
Decidable and Enumerable Languages
Recursion Theory:
Study the border between decidable and undecidable languages
Study the fine structure of undecidable languages.
(The work of Turing, Church, Post, ... was before
computers existed.)
Complexity Theory:
Look at the fine structure of decidable languages.
Paul Goldberg Undecidability 19 / 19

More Related Content

Similar to slides3.pdf

practice-final-soln.pdf
practice-final-soln.pdfpractice-final-soln.pdf
practice-final-soln.pdfT17Rockstar
 
Winter 9 Decidability.pptx
Winter 9 Decidability.pptxWinter 9 Decidability.pptx
Winter 9 Decidability.pptxHarisPrince
 
hghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghgggggggggggggggggggggggggggggggggghghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghggggggggggggggggggggggggggggggggggadugnanegero
 
Winter 11 Lecture Reducibility.pptx
Winter 11 Lecture Reducibility.pptxWinter 11 Lecture Reducibility.pptx
Winter 11 Lecture Reducibility.pptxHarisPrince
 
Theory of Computer Science - Post Correspondence Problem
Theory of Computer Science - Post Correspondence ProblemTheory of Computer Science - Post Correspondence Problem
Theory of Computer Science - Post Correspondence ProblemKaran Thakkar
 
Godels First Incompleteness Theorem
Godels First Incompleteness TheoremGodels First Incompleteness Theorem
Godels First Incompleteness Theoremmmanning02474
 
Winter 12 Lecture Mapping Reducibility.pptx
Winter 12 Lecture Mapping Reducibility.pptxWinter 12 Lecture Mapping Reducibility.pptx
Winter 12 Lecture Mapping Reducibility.pptxHarisPrince
 
Winter 11 Tutorial Reducibility.pptx
Winter 11 Tutorial Reducibility.pptxWinter 11 Tutorial Reducibility.pptx
Winter 11 Tutorial Reducibility.pptxHarisPrince
 
Theory of computation homework help
Theory of computation homework helpTheory of computation homework help
Theory of computation homework helpAssignmentpedia
 
Pushdown AutomataChapter 12Recognizing Context-F.docx
Pushdown AutomataChapter 12Recognizing Context-F.docxPushdown AutomataChapter 12Recognizing Context-F.docx
Pushdown AutomataChapter 12Recognizing Context-F.docxwoodruffeloisa
 
Hardness of approximation
Hardness of approximationHardness of approximation
Hardness of approximationcarlol
 
How Hard Can a Problem Be ?
How Hard Can a Problem Be ?How Hard Can a Problem Be ?
How Hard Can a Problem Be ?Ahmed Saeed
 

Similar to slides3.pdf (19)

practice-final-soln.pdf
practice-final-soln.pdfpractice-final-soln.pdf
practice-final-soln.pdf
 
chapter 2.pptx
chapter 2.pptxchapter 2.pptx
chapter 2.pptx
 
Winter 9 Decidability.pptx
Winter 9 Decidability.pptxWinter 9 Decidability.pptx
Winter 9 Decidability.pptx
 
Ch11.ppt
Ch11.pptCh11.ppt
Ch11.ppt
 
Ch11.ppt
Ch11.pptCh11.ppt
Ch11.ppt
 
hghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghgggggggggggggggggggggggggggggggggghghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghgggggggggggggggggggggggggggggggggg
 
lect_23.pdf
lect_23.pdflect_23.pdf
lect_23.pdf
 
Winter 11 Lecture Reducibility.pptx
Winter 11 Lecture Reducibility.pptxWinter 11 Lecture Reducibility.pptx
Winter 11 Lecture Reducibility.pptx
 
Theory of Computer Science - Post Correspondence Problem
Theory of Computer Science - Post Correspondence ProblemTheory of Computer Science - Post Correspondence Problem
Theory of Computer Science - Post Correspondence Problem
 
Godels First Incompleteness Theorem
Godels First Incompleteness TheoremGodels First Incompleteness Theorem
Godels First Incompleteness Theorem
 
Winter 12 Lecture Mapping Reducibility.pptx
Winter 12 Lecture Mapping Reducibility.pptxWinter 12 Lecture Mapping Reducibility.pptx
Winter 12 Lecture Mapping Reducibility.pptx
 
NP completeness
NP completenessNP completeness
NP completeness
 
L3 cfg
L3 cfgL3 cfg
L3 cfg
 
Winter 11 Tutorial Reducibility.pptx
Winter 11 Tutorial Reducibility.pptxWinter 11 Tutorial Reducibility.pptx
Winter 11 Tutorial Reducibility.pptx
 
Theory of computation homework help
Theory of computation homework helpTheory of computation homework help
Theory of computation homework help
 
Pushdown AutomataChapter 12Recognizing Context-F.docx
Pushdown AutomataChapter 12Recognizing Context-F.docxPushdown AutomataChapter 12Recognizing Context-F.docx
Pushdown AutomataChapter 12Recognizing Context-F.docx
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Hardness of approximation
Hardness of approximationHardness of approximation
Hardness of approximation
 
How Hard Can a Problem Be ?
How Hard Can a Problem Be ?How Hard Can a Problem Be ?
How Hard Can a Problem Be ?
 

Recently uploaded

1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdfAldoGarca30
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxmaisarahman1
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadhamedmustafa094
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersMairaAshraf6
 

Recently uploaded (20)

Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 

slides3.pdf

  • 1. Computational Complexity; slides 3, HT 2019 Undecidability Prof. Paul W. Goldberg (Dept. of Computer Science, University of Oxford) HT 2019 Paul Goldberg Undecidability 1 / 19
  • 2. Undecidable Languages Aim of this section Show that there are languages (problems) that cannot be decided no matter how long we are willing to wait for an answer. A counting argument (sketch): The number of Turing machines is infinite but countable The number of different languages is infinite but uncountable Therefore, there are “more” languages than Turing machines It follows that there are languages that are not decidable. Indeed some aren’t even semi-decidable. Paul Goldberg Undecidability 2 / 19
  • 3. The Halting Problem previous argument shows that there are undecidable languages. Can we find a concrete example? Halting problem (HALT) Input: A Turing machine M and an input string w Question: Does M halt on w? Theorem. 1 HALT is recursively enumerable (accepted by a TM). 2 HALT is undecidable. details in e.g. Sipser Chapter 4.2 Paul Goldberg Undecidability 3 / 19
  • 4. Undecidability of HALT Theorem. 1 HALT is recursively enumerable (accepted by a TM). 2 HALT is undecidable. Proof structure of 2nd part: 1 A decidable language can be decided by a 1-tape machine. 2 universal Turing acceptor – a TM U that can simulate other TMs given as input (an interpreter for TMs). 3 reduce halting (in general) to halting of UTM U. 4 if halting of U is decidable, there exists a TM D that decides if a given TM M running on itself is non-terminating. 5 running D on itself reveals a paradox: running D on itself terminates (and accepts) iff running D on itself is non-terminating. 6 no such D can exist, so halting of U (and hence halting in general) is undecidable. Paul Goldberg Undecidability 4 / 19
  • 5. some details I’ll skip construction of UTM U HALT: Decide for any hM, wi where M is a TM and w ∈ {0, 1}∗: M halts on w? Reduce to: Decide for 1-tape TM M and w ∈ {0, 1}∗ U halts on hM, wi Note: U simulates the computation of M on w In particular, U halts on hM, wi iff M halts on w Paul Goldberg Undecidability 5 / 19
  • 6. some details (design of “contradictory” TM D) Assume L := {hM, wi | U halts on hM, wi} is decidable I.e. we can predict with some TM for all M with Σ = {0, 1} and w ∈ {0, 1}∗ whether or not U halts on hM, wi i.e. there is a TM H such that H(hM, wi) := accept if U halts on hM, wi reject otherwise We can use H to build another TM D: D(hMi) := accept if H rejects hM, hMi reject otherwise i.e., D(hMi) = accept iff M(hMi) does not halt But what result does D compute for input hDi? D(hDi) halts and accepts iff D(hDi) does not halt Paul Goldberg Undecidability 6 / 19
  • 7. HALT, wrapping up So, HALT is rec. enum. but not decidable, where HALT is {hM, wi : M halts on w} Recall: A language L ⊆ Σ∗ is decidable iff L and Σ∗ L are recursively enumerable. Proof: ⇒ trivial. ⇐ Let acceptors for L and Σ∗ L run in parallel. Corollary. HALT is not recursively enumerable. L(HALT) := {hM, wi : M does not halt on input w } Proof. A decided for HALT can be modified to get a decider for HALT. Paul Goldberg Undecidability 7 / 19
  • 8. Classification of Languages Definition. A language L ⊆ Σ∗ is co-recursively enumerable, or co-r.e., if Σ∗ L is recursively enumerable. Example: L(HALT) is co-r.e (but not r.e.). Observation.1 Decidable = r.e. ∩ co-r.e. 1 deserves more detailed explanation Paul Goldberg Undecidability 8 / 19
  • 9. Further Undecidable Problems We want to show that the following problems are also undecidable. ε-Halting Input: Turing acceptor M Problem: Does M halt on the empty input? Equivalence Input: Turing acceptors M and M0 Problem: Is it true that L(M) = L(M0)? Emptiness Input: Turing acceptor M Problem: Is L(M) = ∅? Paul Goldberg Undecidability 9 / 19
  • 10. Reductions A major tool in analysing and classifying problems is the idea of “reducing one problem to another” Reductions. Informally, a problem A is reducible to a problem B if we can use methods to solve B in order to solve A. We want to capture the idea, that A is ”no harder” than B. (as we can use B to solve A.) Paul Goldberg Undecidability 10 / 19
  • 11. Turing Reductions Turing Reduction: Informally, a problem A is Turing reducible to B if we can solve A using a program solving B as sub-program. We write A ≤T B. Example: HALT is Turing reducible to HALT. take a Turing acceptor accepting HALT as sub-program and reverse its output Paul Goldberg Undecidability 11 / 19
  • 12. Turing Reductions Turing Reduction: Informally, a problem A is Turing reducible to B if we can solve A using a program solving B as sub-program. We write A ≤T B. Example: HALT is Turing reducible to HALT. take a Turing acceptor accepting HALT as sub-program and reverse its output Turing reductions are free/unrestricted; sometimes too much so for our purposes. Many-One Reductions (Sipser: “mapping reduction”) are more informative: A ≤T B relates (un)decidability of problems; use A ≤m B (next slide) to find out if a problem (or its complement) is recursively enumerable. Paul Goldberg Undecidability 11 / 19
  • 13. Many-One Reductions Definition. A language A is many-one reducible to a language B if there exists a computable function f such that for all w ∈ Σ∗: x ∈ A ⇐⇒ f (x) ∈ B. We write A ≤m B. Observation 1. If A ≤m B and B is decidable, then so is A. Proof. A many-one reduction is a Turing reduction, so it inherits that functionality Observation 2. If A ≤m B and B is recursively enumerable, then so is A. Equivalently, if A is not decidable (resp. r.e.) then neither is B; so, a tool for “negative results” Paul Goldberg Undecidability 12 / 19
  • 14. Properties of Many-One Reductions 1 ≤m is reflexive and transitive (if A ≤m B and B ≤m C then A ≤m C, by composition of functions.) 2 If A is decidable and B is any language apart from ∅ and Σ∗, then A ≤m B. As B 6= ∅ and B 6= Σ∗ there are wa ∈ B and wr 6∈ B. For w ∈ Σ∗, define f (w) := ( wa if w ∈ A wr if w 6∈ A (Hence, many-one reductions are too weak to distinguish between decidable problems. later: “smarter” reductions) Paul Goldberg Undecidability 13 / 19
  • 15. Examples for Many-One Reductions We will show the following chain of reductions: HALT ≤m ε-HALT ≤m EQUIVALENCE ε-HALT: Does M halt on the empty input? EQUIVALENCE: L(M) = L(M0)? Hence, all these problems are undecidable. Paul Goldberg Undecidability 14 / 19
  • 16. HALT ≤m ε-HALT Lemma. HALT ≤m ε-HALT Proof. Define function f such that w ∈ HALT ⇐⇒ f (w) ∈ ε-HALT For w := hM, vi compute the following Turing machine Mw : 1 Write v onto the input tape. 2 Simulate M. Clearly, Mw accepts the empty word if, and only if, M accepts v. Let Mr be a TM that does not halt on the empty input. Define f (w) := ( Mw if w = hM, vi Mr if w is not of the correct input form 2 2 i.e. doesn’t encode a TM with word Paul Goldberg Undecidability 15 / 19
  • 17. ε-HALT ≤m EQUIVALENCE Lemma. ε-HALT ≤m EQUIVALENCE Proof. Define f such that w ∈ ε-HALT ⇐⇒ f (w) ∈ EQUIVALENCE Let Ma be a Turing machine that accepts all inputs. For a TM M compute the following Turing machine M∗ : 1 Run M on the empty input 2 If M halts, accept. M∗ is equivalent to Ma if, and only if, M halts on the empty input. Define f (w) := ( (hM∗i, hMai) if w = hMi (w, hMai) if w is not of the correct input form Paul Goldberg Undecidability 16 / 19
  • 18. Rice’s Theorem Theorem. Every non-trivial property of Turing machines is undecidable. Paul Goldberg Undecidability 17 / 19
  • 19. Rice’s Theorem Theorem. Every non-trivial property of Turing machines is undecidable. Formally: Let R be a non-trivial subclass of the class of all recursively enumerable languages. (R 6= ∅ and R 6= all r.e. lang.) Then “R-ness” is undecidable: Given: Turing machine M Problem: Is L(M) ∈ R? (that is, R-ness = {hMi : L(M) ∈ R} is undecidable.) Paul Goldberg Undecidability 17 / 19
  • 20. Rice’s Theorem Theorem. Every non-trivial property of Turing machines is undecidable. Formally: Let R be a non-trivial subclass of the class of all recursively enumerable languages. (R 6= ∅ and R 6= all r.e. lang.) Then “R-ness” is undecidable: Given: Turing machine M Problem: Is L(M) ∈ R? (that is, R-ness = {hMi : L(M) ∈ R} is undecidable.) Proof. Define f such that w ∈ ε-HALT ⇐⇒ f (w) ∈ R-ness Paul Goldberg Undecidability 17 / 19
  • 21. Rice’s Theorem Proof. Define f such that w ∈ ε-HALT ⇐⇒ f (w) ∈ R-ness W.l.o.g. assume ∅ 6∈ R. (We could always use R.) Let ML be a Turing machine that accepts some L ∈ R. For a TM M compute the following Turing machine M∗: On input s ∈ Σ∗ 1 Simulate M on ε 2 If M halts, then simulate ML on s Clearly L(M∗) = L ∈ R if M halts on ε, and L(M∗) = ∅ 6∈ R if M does not halt on ε. Let M∅ be a TM that does not accept any input (i.e., L(M∅) = ∅). Define f (w) := ( M∗ if w = hMi M∅ if w is not of the correct input form Paul Goldberg Undecidability 18 / 19
  • 22. Decidable and Enumerable Languages Recursion Theory: Study the border between decidable and undecidable languages Study the fine structure of undecidable languages. (The work of Turing, Church, Post, ... was before computers existed.) Paul Goldberg Undecidability 19 / 19
  • 23. Decidable and Enumerable Languages Recursion Theory: Study the border between decidable and undecidable languages Study the fine structure of undecidable languages. (The work of Turing, Church, Post, ... was before computers existed.) Complexity Theory: Look at the fine structure of decidable languages. Paul Goldberg Undecidability 19 / 19