SlideShare a Scribd company logo
EECS 2001: Introduction to the
Theory of Computation
Muhammad Umair Khan
Reducibility
EECS 2001 Introduction to Theory of Computation 2
 Converting one problem into another problem
 Aim: solution to the second problem can be used to solve the first one
 Reducibility can be used to prove that certain problems are
computationally unsolvable
Halting problem
EECS 2001 Introduction to Theory of Computation 3
 HALTTM
 Determine whether a TM stops (HALTS) on a given input
 It may accept or reject
 HALT does not mean reject
HALTTM = {⟨M,w⟩| M is a TM and M halts on input w}
Halting problem
EECS 2001 Introduction to Theory of Computation 4
 Prove HALTTM is undecidable (informal discussion)
 Assume it is decidable
 We use this assumption to show that ATM is also decidable
 We will try to show that ATM is reducible to HALTTM
 Suppose we have a TM R
 R decides HALTTM
 R can be used to test whether a TM M halts on w
 If R says the M does not halt at w, then reject as (M, w) will not be in ATM
 If R says the M halts on w, then we can be assured that the M will eventually
accept or reject w and we will have a decision on whether it is part of ATM or
not.
 What does this mean?
Halting problem
EECS 2001 Introduction to Theory of Computation 5
 HALTTM is undecidable (informal discussion)
 Assume it is decidable
 We use this assumption to show that ATM is also decidable
 We will try to show that ATM is reducible to HALTTM
 Suppose we have a TM R
 R decides HALTTM
 R can be used to test whether a TM M halts on w
 If R says the M does not halt at w, then reject as (M, w) will not be in ATM
 If R says the M halts on w, then we can be assured that the M will eventually
accept or reject w and we will have a decision on whether it is part of ATM or
not.
 What does this mean? That there is a decider for ATM
 This cannot be true because we have already proved that ATM is undecidable:
hence R cannot exist, hence HALTTM is undecidable
Halting problem
EECS 2001 Introduction to Theory of Computation 6
 Prove HALTTM is undecidable (Formal Proof -Algorithmic steps)
 Assume R decides HALTTM
 Construct S to decide ATM
 S works as follows:
 Input (M, w)
 Run R on (M, w)
 If R rejects, S rejects
 If R accepts, simulate M on w till we get a result
 If M accepts, S accept, if M rejects, S reject
 Hence, if R decides HALTTM, S decides ATM
 Contradiction: Nothing can decide ATM
Computation histories
EECS 2001 Introduction to Theory of Computation 7
 Method used to prove that ATM is reducible to certain languages
 Usually used for problems where we have to show the
existence of something
 Remember finding the contradictory example in pumping lemmas
 Example, finding the integral root of a polynomial
 Computation history: sequence of configurations of a TM when it is
provided an input i.e., the record of computation of this TM
 Remember the derivation in CFGs
Reduction via computation histories
EECS 2001 Introduction to Theory of Computation 8
 If M is a TM and v is a string,
 Then an accepting computation history of M on v is a sequence of
configurations C1, C2, …, Ck where Ck is the accepting configuration
of M on v
 And each Ci leads to Ci+1 through a legal transition
 A rejecting computation history is similar except that Ck is a
rejecting configuration
 Computation histories are finite sequences
 TM has to halt
 If it does not halt, then there is no history
Reduction via computation histories
EECS 2001 Introduction to Theory of Computation 9
 Deterministic TMs have exactly one computation history for a
given string
 Non-deterministic TMs may have more than one computation
history for a given string
Reduction via computation histories
EECS 2001 Introduction to Theory of Computation 10
 A linear bounded automaton (LBA) is a type of TM which
has some restriction on its tape
 The head can only move on the portion of the tape where there is input
 If it tries to move to the left of the leftmost input character or to the right of the
rightmost input character, it will stay where it was.
 Hence the amount of memory is limited
 What do you think about the power of an LBA?
 It can only solve those problems which can be solved using the memory that was
used to store the input.
Reduction via computation histories
EECS 2001 Introduction to Theory of Computation 11
 A linear bounded automaton (LBA) is a type of TM which
has some restriction on its tape
 The head can only move on the portion of the tape where there is input
 If it tries to move to the left of the leftmost input character or to the right of the
rightmost input character, it will stay where it was.
 Hence the amount of memory is limited
 What do you think about the power of an LBA?
 It can only solve those problems which can be solved using the memory that was
used to store the input.
 Deciders for ADFA, ACFG, EDFA, and ECFG are all LBAs
Reduction via computation histories
EECS 2001 Introduction to Theory of Computation 12
 The following language decidable
ALBA = {⟨M,w⟩| M is an LBA that accepts string w}
Compare with ATM = {⟨M,w⟩| M is a TM that accepts string w}
Reduction via computation histories
EECS 2001 Introduction to Theory of Computation 13
 Lemma 5.8
 Let M be an LBA with q states and g symbols in the tape alphabet.
There are exactly qngn distinct configurations of M for a tape of length
n.
 M has q states
 Number of tape symbols is g
 Tape length is n – hence the head can be in one of n many places
 Number of possible strings is gn
 The total number of different possible configurations is qngn
Reduction via computation histories
EECS 2001 Introduction to Theory of Computation 14
 Prove ALBA is decidable
 Informal discussion
 If M accepts or rejects, we accept or reject accordingly
 If M loops, it is bound to be in one of the same configurations it has been already.
 As M is an LBA, the tape is limited. According to Lemma 5.8, there can be a
limited number of configurations.
 Hence if M goes into a loop, it can be easily detected (simulate M for qngn steps
and if it does not halt it is in a loop)
 Formal proof
 Simulate M on w for qngn steps or until it halts
 If M has halted, accept if it has accepted, reject if it has rejected.
 If it is has not halted it must be in a loop, reject.
Reduction via computation histories
EECS 2001 Introduction to Theory of Computation 15
 ELBA is undecidable (language of a given LBA is empty)
 Idea: if ELBA is decidable then so will be ATM
 Informal discussion
 For a TM M and input string v, suppose we build an LBA C such that the
language of C comprises of all computation histories which make M end up in
the accepting state on v (this can be done in bounded memory)
 If M accepts v, then there is at least one computation history
 If M does not accept v, then C is empty
 Therefore, if we can determine that the language C is empty or not, then we can
say M accepts v or not
 Construction of C
 C gets a computation history, identifies the start configuration, finds an identical match for Ci
and Ci+1, and keeps moving on until it matches the accepting configuration
Reduction via computation histories
EECS 2001 Introduction to Theory of Computation 16
 ELBA is undecidable (language of a given LBA is empty)
 Idea: if ELBA is decidable then so will be ATM
 Formal proof
 The TM S gets as input ⟨M,v⟩ and works as follows:
 Build an LBA C as described above
 Run R on input ⟨C⟩ (R is the decider for ELBA)
 If R reject, accept. If R accepts, reject.
 If R has accepted then it means that the language of C is empty and M has no accepting computation
history for v. Hence S rejects
 If R rejects, then L(C) is non-empty, which is only possible when there is a computation history of v on
M. therefore M must accept v. Hence, S will accept.
 We have successfully made a decider for ATM using ELBA. Contradiction. Therefore there
cannot be an ELBA
Reduction via computation histories
EECS 2001 Introduction to Theory of Computation 17
 ALLCFG is undecidable (whether a CFG generates all possible strings)
ALLCFG = {⟨G⟩| G is a CFG and L(G) = Σ∗}.
 Same strategy assume ALLCFG is decidable and then show that this
makes ATM decidable
 Informal discussion:
 For a TM M and string v, build a CFG G
 If v is accepted by M then G will generate all strings
 If v is not accepted by M, then G does not generate one specific string
 Specific string = accepting computation history for v being accepted by M
 Other strings = all computation histories that do not allow M to accept v
Reduction via computation histories
EECS 2001 Introduction to Theory of Computation 18
 ALLCFG is undecidable (whether a CFG generates all possible strings)
ALLCFG = {⟨G⟩| G is a CFG and L(G) = Σ∗}.
 Informal discussion:
 Building G
 Remember a computation history is represented as a string
 Try to remember how we proved the uncountability of real number
 Similarly, we make G such that it generates all string (computation histories) except the
accepting one
 Starting configuration different
 Ending configuration different
 Some transition from Ci to Ci+1 does not match
 Details on page 226 – omit for the purposes of the test
References
EECS 2001 Introduction to Theory of Computation 19
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

More Related Content

Similar to Winter 11 Tutorial Reducibility.pptx

Pushdown AutomataChapter 12Recognizing Context-F.docx
Pushdown AutomataChapter 12Recognizing Context-F.docxPushdown AutomataChapter 12Recognizing Context-F.docx
Pushdown AutomataChapter 12Recognizing Context-F.docx
woodruffeloisa
 
chapter 2.pptx
chapter 2.pptxchapter 2.pptx
chapter 2.pptx
sampathkumar912515
 
slides3.pdf
slides3.pdfslides3.pdf
slides3.pdf
test490946
 
Ch11.ppt
Ch11.pptCh11.ppt
Ch11.ppt
mukul narayana
 
Ch11.ppt
Ch11.pptCh11.ppt
Ch11.ppt
mukul narayana
 
Winter 9 Tutorial Decidability.pptx
Winter 9 Tutorial Decidability.pptxWinter 9 Tutorial Decidability.pptx
Winter 9 Tutorial Decidability.pptx
HarisPrince
 
Reductions
ReductionsReductions
Reductions
Muhammad Alhalaby
 
QB104545.pdf
QB104545.pdfQB104545.pdf
QB104545.pdf
MrRRajasekarCSE
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
azmizryk
 
smtlectures.1
smtlectures.1smtlectures.1
smtlectures.1
Roberto Bruttomesso
 
a simple idealized machine used to recognize patterns within input taken from...
a simple idealized machine used to recognize patterns within input taken from...a simple idealized machine used to recognize patterns within input taken from...
a simple idealized machine used to recognize patterns within input taken from...
NALESVPMEngg
 
Busy week • Lab 9 due Thursday at 5 pm L = { M,s s.docx
Busy  week • Lab 9 due Thursday at 5 pm L = { M,s  s.docxBusy  week • Lab 9 due Thursday at 5 pm L = { M,s  s.docx
Busy week • Lab 9 due Thursday at 5 pm L = { M,s s.docx
jasoninnes20
 
Busy week • Lab 9 due Thursday at 5 pm L = { M,s s.docx
Busy  week • Lab 9 due Thursday at 5 pm L = { M,s  s.docxBusy  week • Lab 9 due Thursday at 5 pm L = { M,s  s.docx
Busy week • Lab 9 due Thursday at 5 pm L = { M,s s.docx
clairbycraft
 
NP completeness
NP completenessNP completeness
NP completeness
Amrinder Arora
 
03-FiniteAutomata.pptx
03-FiniteAutomata.pptx03-FiniteAutomata.pptx
03-FiniteAutomata.pptx
ssuser47f7f2
 
practice-final-soln.pdf
practice-final-soln.pdfpractice-final-soln.pdf
practice-final-soln.pdf
T17Rockstar
 
Winter 8 TM.pptx
Winter 8 TM.pptxWinter 8 TM.pptx
Winter 8 TM.pptx
HarisPrince
 
2,Combinational Logic Circuits.pdf
2,Combinational Logic Circuits.pdf2,Combinational Logic Circuits.pdf
2,Combinational Logic Circuits.pdf
DamotTesfaye
 
Finite automata
Finite automataFinite automata
Finite automata
ankitamakin
 
Finite automata
Finite automataFinite automata
Finite automata
ankitamakin
 

Similar to Winter 11 Tutorial Reducibility.pptx (20)

Pushdown AutomataChapter 12Recognizing Context-F.docx
Pushdown AutomataChapter 12Recognizing Context-F.docxPushdown AutomataChapter 12Recognizing Context-F.docx
Pushdown AutomataChapter 12Recognizing Context-F.docx
 
chapter 2.pptx
chapter 2.pptxchapter 2.pptx
chapter 2.pptx
 
slides3.pdf
slides3.pdfslides3.pdf
slides3.pdf
 
Ch11.ppt
Ch11.pptCh11.ppt
Ch11.ppt
 
Ch11.ppt
Ch11.pptCh11.ppt
Ch11.ppt
 
Winter 9 Tutorial Decidability.pptx
Winter 9 Tutorial Decidability.pptxWinter 9 Tutorial Decidability.pptx
Winter 9 Tutorial Decidability.pptx
 
Reductions
ReductionsReductions
Reductions
 
QB104545.pdf
QB104545.pdfQB104545.pdf
QB104545.pdf
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
smtlectures.1
smtlectures.1smtlectures.1
smtlectures.1
 
a simple idealized machine used to recognize patterns within input taken from...
a simple idealized machine used to recognize patterns within input taken from...a simple idealized machine used to recognize patterns within input taken from...
a simple idealized machine used to recognize patterns within input taken from...
 
Busy week • Lab 9 due Thursday at 5 pm L = { M,s s.docx
Busy  week • Lab 9 due Thursday at 5 pm L = { M,s  s.docxBusy  week • Lab 9 due Thursday at 5 pm L = { M,s  s.docx
Busy week • Lab 9 due Thursday at 5 pm L = { M,s s.docx
 
Busy week • Lab 9 due Thursday at 5 pm L = { M,s s.docx
Busy  week • Lab 9 due Thursday at 5 pm L = { M,s  s.docxBusy  week • Lab 9 due Thursday at 5 pm L = { M,s  s.docx
Busy week • Lab 9 due Thursday at 5 pm L = { M,s s.docx
 
NP completeness
NP completenessNP completeness
NP completeness
 
03-FiniteAutomata.pptx
03-FiniteAutomata.pptx03-FiniteAutomata.pptx
03-FiniteAutomata.pptx
 
practice-final-soln.pdf
practice-final-soln.pdfpractice-final-soln.pdf
practice-final-soln.pdf
 
Winter 8 TM.pptx
Winter 8 TM.pptxWinter 8 TM.pptx
Winter 8 TM.pptx
 
2,Combinational Logic Circuits.pdf
2,Combinational Logic Circuits.pdf2,Combinational Logic Circuits.pdf
2,Combinational Logic Circuits.pdf
 
Finite automata
Finite automataFinite automata
Finite automata
 
Finite automata
Finite automataFinite automata
Finite automata
 

Recently uploaded

一比一原版(uoit毕业证书)加拿大安大略理工大学毕业证如何办理
一比一原版(uoit毕业证书)加拿大安大略理工大学毕业证如何办理一比一原版(uoit毕业证书)加拿大安大略理工大学毕业证如何办理
一比一原版(uoit毕业证书)加拿大安大略理工大学毕业证如何办理
vfefek
 
Health Insurance Coverage for the U.S. Population, 2024 to 2034
Health Insurance Coverage for the U.S. Population, 2024 to 2034Health Insurance Coverage for the U.S. Population, 2024 to 2034
Health Insurance Coverage for the U.S. Population, 2024 to 2034
Congressional Budget Office
 
一比一原版(theauckland毕业证书)新西兰奥克兰大学毕业证成绩单如何办理
一比一原版(theauckland毕业证书)新西兰奥克兰大学毕业证成绩单如何办理一比一原版(theauckland毕业证书)新西兰奥克兰大学毕业证成绩单如何办理
一比一原版(theauckland毕业证书)新西兰奥克兰大学毕业证成绩单如何办理
odmqk
 
The cost of poor health: What does rising health-related benefit spending mea...
The cost of poor health: What does rising health-related benefit spending mea...The cost of poor health: What does rising health-related benefit spending mea...
The cost of poor health: What does rising health-related benefit spending mea...
ResolutionFoundation
 
在线办理(西班牙UPV毕业证书)瓦伦西亚理工大学毕业证毕业完成信一模一样
在线办理(西班牙UPV毕业证书)瓦伦西亚理工大学毕业证毕业完成信一模一样在线办理(西班牙UPV毕业证书)瓦伦西亚理工大学毕业证毕业完成信一模一样
在线办理(西班牙UPV毕业证书)瓦伦西亚理工大学毕业证毕业完成信一模一样
dj1cx4ex
 
Causes Supporting Charity for Elderly People
Causes Supporting Charity for Elderly PeopleCauses Supporting Charity for Elderly People
Causes Supporting Charity for Elderly People
SERUDS INDIA
 
G7 Apulia Leaders Communique, June 2024 (1).pdf
G7 Apulia Leaders Communique, June 2024 (1).pdfG7 Apulia Leaders Communique, June 2024 (1).pdf
G7 Apulia Leaders Communique, June 2024 (1).pdf
Energy for One World
 
在线制作(umich毕业证书)美国密歇根大学毕业证学位证书原版一模一样
在线制作(umich毕业证书)美国密歇根大学毕业证学位证书原版一模一样在线制作(umich毕业证书)美国密歇根大学毕业证学位证书原版一模一样
在线制作(umich毕业证书)美国密歇根大学毕业证学位证书原版一模一样
zvpwjpty
 
GUIA_LEGAL_CHAPTER_8_COLOMBIAN ENVIROMENTAL REGIME.pdf
GUIA_LEGAL_CHAPTER_8_COLOMBIAN ENVIROMENTAL REGIME.pdfGUIA_LEGAL_CHAPTER_8_COLOMBIAN ENVIROMENTAL REGIME.pdf
GUIA_LEGAL_CHAPTER_8_COLOMBIAN ENVIROMENTAL REGIME.pdf
ProexportColombia1
 
SPONSORED CONTENT - Palmetier Law - Unleashing Small Business Innovations: A ...
SPONSORED CONTENT - Palmetier Law - Unleashing Small Business Innovations: A ...SPONSORED CONTENT - Palmetier Law - Unleashing Small Business Innovations: A ...
SPONSORED CONTENT - Palmetier Law - Unleashing Small Business Innovations: A ...
JSchaus & Associates
 
Draft CP-Baggao on Landslide final copyocx
Draft CP-Baggao on Landslide final copyocxDraft CP-Baggao on Landslide final copyocx
Draft CP-Baggao on Landslide final copyocx
DivineLapada
 
The Power of Community Newsletters: A Case Study from Wolverton and Greenleys...
The Power of Community Newsletters: A Case Study from Wolverton and Greenleys...The Power of Community Newsletters: A Case Study from Wolverton and Greenleys...
The Power of Community Newsletters: A Case Study from Wolverton and Greenleys...
Scribe
 
How To Cultivate Community Affinity Throughout The Generosity Journey
How To Cultivate Community Affinity Throughout The Generosity JourneyHow To Cultivate Community Affinity Throughout The Generosity Journey
How To Cultivate Community Affinity Throughout The Generosity Journey
Aggregage
 
Lecture 7 Module VII Agriculture Insurance - Support Services (2).pdf
Lecture 7 Module VII Agriculture Insurance - Support Services (2).pdfLecture 7 Module VII Agriculture Insurance - Support Services (2).pdf
Lecture 7 Module VII Agriculture Insurance - Support Services (2).pdf
tshree896
 
TRUE BOOK OF LIFE 1.15 OF TRUE JESUS CHRIST
TRUE BOOK OF LIFE 1.15 OF TRUE JESUS CHRISTTRUE BOOK OF LIFE 1.15 OF TRUE JESUS CHRIST
TRUE BOOK OF LIFE 1.15 OF TRUE JESUS CHRIST
Cheong Man Keong
 
一比一原版英国阿伯丁大学毕业证(AU毕业证书)学历如何办理
一比一原版英国阿伯丁大学毕业证(AU毕业证书)学历如何办理一比一原版英国阿伯丁大学毕业证(AU毕业证书)学历如何办理
一比一原版英国阿伯丁大学毕业证(AU毕业证书)学历如何办理
afsebu
 
ColombiaPresentation.pptx macroeconomics
ColombiaPresentation.pptx macroeconomicsColombiaPresentation.pptx macroeconomics
ColombiaPresentation.pptx macroeconomics
JuanFelipeHerrera4
 
一比一原版(Adelaide毕业证)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证)阿德莱德大学毕业证如何办理一比一原版(Adelaide毕业证)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证)阿德莱德大学毕业证如何办理
teeaszt
 
GUIA_LEGAL_CHAPTER_6_IMMIGRATION_REGIME.pdf
GUIA_LEGAL_CHAPTER_6_IMMIGRATION_REGIME.pdfGUIA_LEGAL_CHAPTER_6_IMMIGRATION_REGIME.pdf
GUIA_LEGAL_CHAPTER_6_IMMIGRATION_REGIME.pdf
ProexportColombia1
 
G7 Apulia Leaders Communique, 14th June 2024
G7 Apulia Leaders Communique, 14th June 2024G7 Apulia Leaders Communique, 14th June 2024
G7 Apulia Leaders Communique, 14th June 2024
Energy for One World
 

Recently uploaded (20)

一比一原版(uoit毕业证书)加拿大安大略理工大学毕业证如何办理
一比一原版(uoit毕业证书)加拿大安大略理工大学毕业证如何办理一比一原版(uoit毕业证书)加拿大安大略理工大学毕业证如何办理
一比一原版(uoit毕业证书)加拿大安大略理工大学毕业证如何办理
 
Health Insurance Coverage for the U.S. Population, 2024 to 2034
Health Insurance Coverage for the U.S. Population, 2024 to 2034Health Insurance Coverage for the U.S. Population, 2024 to 2034
Health Insurance Coverage for the U.S. Population, 2024 to 2034
 
一比一原版(theauckland毕业证书)新西兰奥克兰大学毕业证成绩单如何办理
一比一原版(theauckland毕业证书)新西兰奥克兰大学毕业证成绩单如何办理一比一原版(theauckland毕业证书)新西兰奥克兰大学毕业证成绩单如何办理
一比一原版(theauckland毕业证书)新西兰奥克兰大学毕业证成绩单如何办理
 
The cost of poor health: What does rising health-related benefit spending mea...
The cost of poor health: What does rising health-related benefit spending mea...The cost of poor health: What does rising health-related benefit spending mea...
The cost of poor health: What does rising health-related benefit spending mea...
 
在线办理(西班牙UPV毕业证书)瓦伦西亚理工大学毕业证毕业完成信一模一样
在线办理(西班牙UPV毕业证书)瓦伦西亚理工大学毕业证毕业完成信一模一样在线办理(西班牙UPV毕业证书)瓦伦西亚理工大学毕业证毕业完成信一模一样
在线办理(西班牙UPV毕业证书)瓦伦西亚理工大学毕业证毕业完成信一模一样
 
Causes Supporting Charity for Elderly People
Causes Supporting Charity for Elderly PeopleCauses Supporting Charity for Elderly People
Causes Supporting Charity for Elderly People
 
G7 Apulia Leaders Communique, June 2024 (1).pdf
G7 Apulia Leaders Communique, June 2024 (1).pdfG7 Apulia Leaders Communique, June 2024 (1).pdf
G7 Apulia Leaders Communique, June 2024 (1).pdf
 
在线制作(umich毕业证书)美国密歇根大学毕业证学位证书原版一模一样
在线制作(umich毕业证书)美国密歇根大学毕业证学位证书原版一模一样在线制作(umich毕业证书)美国密歇根大学毕业证学位证书原版一模一样
在线制作(umich毕业证书)美国密歇根大学毕业证学位证书原版一模一样
 
GUIA_LEGAL_CHAPTER_8_COLOMBIAN ENVIROMENTAL REGIME.pdf
GUIA_LEGAL_CHAPTER_8_COLOMBIAN ENVIROMENTAL REGIME.pdfGUIA_LEGAL_CHAPTER_8_COLOMBIAN ENVIROMENTAL REGIME.pdf
GUIA_LEGAL_CHAPTER_8_COLOMBIAN ENVIROMENTAL REGIME.pdf
 
SPONSORED CONTENT - Palmetier Law - Unleashing Small Business Innovations: A ...
SPONSORED CONTENT - Palmetier Law - Unleashing Small Business Innovations: A ...SPONSORED CONTENT - Palmetier Law - Unleashing Small Business Innovations: A ...
SPONSORED CONTENT - Palmetier Law - Unleashing Small Business Innovations: A ...
 
Draft CP-Baggao on Landslide final copyocx
Draft CP-Baggao on Landslide final copyocxDraft CP-Baggao on Landslide final copyocx
Draft CP-Baggao on Landslide final copyocx
 
The Power of Community Newsletters: A Case Study from Wolverton and Greenleys...
The Power of Community Newsletters: A Case Study from Wolverton and Greenleys...The Power of Community Newsletters: A Case Study from Wolverton and Greenleys...
The Power of Community Newsletters: A Case Study from Wolverton and Greenleys...
 
How To Cultivate Community Affinity Throughout The Generosity Journey
How To Cultivate Community Affinity Throughout The Generosity JourneyHow To Cultivate Community Affinity Throughout The Generosity Journey
How To Cultivate Community Affinity Throughout The Generosity Journey
 
Lecture 7 Module VII Agriculture Insurance - Support Services (2).pdf
Lecture 7 Module VII Agriculture Insurance - Support Services (2).pdfLecture 7 Module VII Agriculture Insurance - Support Services (2).pdf
Lecture 7 Module VII Agriculture Insurance - Support Services (2).pdf
 
TRUE BOOK OF LIFE 1.15 OF TRUE JESUS CHRIST
TRUE BOOK OF LIFE 1.15 OF TRUE JESUS CHRISTTRUE BOOK OF LIFE 1.15 OF TRUE JESUS CHRIST
TRUE BOOK OF LIFE 1.15 OF TRUE JESUS CHRIST
 
一比一原版英国阿伯丁大学毕业证(AU毕业证书)学历如何办理
一比一原版英国阿伯丁大学毕业证(AU毕业证书)学历如何办理一比一原版英国阿伯丁大学毕业证(AU毕业证书)学历如何办理
一比一原版英国阿伯丁大学毕业证(AU毕业证书)学历如何办理
 
ColombiaPresentation.pptx macroeconomics
ColombiaPresentation.pptx macroeconomicsColombiaPresentation.pptx macroeconomics
ColombiaPresentation.pptx macroeconomics
 
一比一原版(Adelaide毕业证)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证)阿德莱德大学毕业证如何办理一比一原版(Adelaide毕业证)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证)阿德莱德大学毕业证如何办理
 
GUIA_LEGAL_CHAPTER_6_IMMIGRATION_REGIME.pdf
GUIA_LEGAL_CHAPTER_6_IMMIGRATION_REGIME.pdfGUIA_LEGAL_CHAPTER_6_IMMIGRATION_REGIME.pdf
GUIA_LEGAL_CHAPTER_6_IMMIGRATION_REGIME.pdf
 
G7 Apulia Leaders Communique, 14th June 2024
G7 Apulia Leaders Communique, 14th June 2024G7 Apulia Leaders Communique, 14th June 2024
G7 Apulia Leaders Communique, 14th June 2024
 

Winter 11 Tutorial Reducibility.pptx

  • 1. EECS 2001: Introduction to the Theory of Computation Muhammad Umair Khan
  • 2. Reducibility EECS 2001 Introduction to Theory of Computation 2  Converting one problem into another problem  Aim: solution to the second problem can be used to solve the first one  Reducibility can be used to prove that certain problems are computationally unsolvable
  • 3. Halting problem EECS 2001 Introduction to Theory of Computation 3  HALTTM  Determine whether a TM stops (HALTS) on a given input  It may accept or reject  HALT does not mean reject HALTTM = {⟨M,w⟩| M is a TM and M halts on input w}
  • 4. Halting problem EECS 2001 Introduction to Theory of Computation 4  Prove HALTTM is undecidable (informal discussion)  Assume it is decidable  We use this assumption to show that ATM is also decidable  We will try to show that ATM is reducible to HALTTM  Suppose we have a TM R  R decides HALTTM  R can be used to test whether a TM M halts on w  If R says the M does not halt at w, then reject as (M, w) will not be in ATM  If R says the M halts on w, then we can be assured that the M will eventually accept or reject w and we will have a decision on whether it is part of ATM or not.  What does this mean?
  • 5. Halting problem EECS 2001 Introduction to Theory of Computation 5  HALTTM is undecidable (informal discussion)  Assume it is decidable  We use this assumption to show that ATM is also decidable  We will try to show that ATM is reducible to HALTTM  Suppose we have a TM R  R decides HALTTM  R can be used to test whether a TM M halts on w  If R says the M does not halt at w, then reject as (M, w) will not be in ATM  If R says the M halts on w, then we can be assured that the M will eventually accept or reject w and we will have a decision on whether it is part of ATM or not.  What does this mean? That there is a decider for ATM  This cannot be true because we have already proved that ATM is undecidable: hence R cannot exist, hence HALTTM is undecidable
  • 6. Halting problem EECS 2001 Introduction to Theory of Computation 6  Prove HALTTM is undecidable (Formal Proof -Algorithmic steps)  Assume R decides HALTTM  Construct S to decide ATM  S works as follows:  Input (M, w)  Run R on (M, w)  If R rejects, S rejects  If R accepts, simulate M on w till we get a result  If M accepts, S accept, if M rejects, S reject  Hence, if R decides HALTTM, S decides ATM  Contradiction: Nothing can decide ATM
  • 7. Computation histories EECS 2001 Introduction to Theory of Computation 7  Method used to prove that ATM is reducible to certain languages  Usually used for problems where we have to show the existence of something  Remember finding the contradictory example in pumping lemmas  Example, finding the integral root of a polynomial  Computation history: sequence of configurations of a TM when it is provided an input i.e., the record of computation of this TM  Remember the derivation in CFGs
  • 8. Reduction via computation histories EECS 2001 Introduction to Theory of Computation 8  If M is a TM and v is a string,  Then an accepting computation history of M on v is a sequence of configurations C1, C2, …, Ck where Ck is the accepting configuration of M on v  And each Ci leads to Ci+1 through a legal transition  A rejecting computation history is similar except that Ck is a rejecting configuration  Computation histories are finite sequences  TM has to halt  If it does not halt, then there is no history
  • 9. Reduction via computation histories EECS 2001 Introduction to Theory of Computation 9  Deterministic TMs have exactly one computation history for a given string  Non-deterministic TMs may have more than one computation history for a given string
  • 10. Reduction via computation histories EECS 2001 Introduction to Theory of Computation 10  A linear bounded automaton (LBA) is a type of TM which has some restriction on its tape  The head can only move on the portion of the tape where there is input  If it tries to move to the left of the leftmost input character or to the right of the rightmost input character, it will stay where it was.  Hence the amount of memory is limited  What do you think about the power of an LBA?  It can only solve those problems which can be solved using the memory that was used to store the input.
  • 11. Reduction via computation histories EECS 2001 Introduction to Theory of Computation 11  A linear bounded automaton (LBA) is a type of TM which has some restriction on its tape  The head can only move on the portion of the tape where there is input  If it tries to move to the left of the leftmost input character or to the right of the rightmost input character, it will stay where it was.  Hence the amount of memory is limited  What do you think about the power of an LBA?  It can only solve those problems which can be solved using the memory that was used to store the input.  Deciders for ADFA, ACFG, EDFA, and ECFG are all LBAs
  • 12. Reduction via computation histories EECS 2001 Introduction to Theory of Computation 12  The following language decidable ALBA = {⟨M,w⟩| M is an LBA that accepts string w} Compare with ATM = {⟨M,w⟩| M is a TM that accepts string w}
  • 13. Reduction via computation histories EECS 2001 Introduction to Theory of Computation 13  Lemma 5.8  Let M be an LBA with q states and g symbols in the tape alphabet. There are exactly qngn distinct configurations of M for a tape of length n.  M has q states  Number of tape symbols is g  Tape length is n – hence the head can be in one of n many places  Number of possible strings is gn  The total number of different possible configurations is qngn
  • 14. Reduction via computation histories EECS 2001 Introduction to Theory of Computation 14  Prove ALBA is decidable  Informal discussion  If M accepts or rejects, we accept or reject accordingly  If M loops, it is bound to be in one of the same configurations it has been already.  As M is an LBA, the tape is limited. According to Lemma 5.8, there can be a limited number of configurations.  Hence if M goes into a loop, it can be easily detected (simulate M for qngn steps and if it does not halt it is in a loop)  Formal proof  Simulate M on w for qngn steps or until it halts  If M has halted, accept if it has accepted, reject if it has rejected.  If it is has not halted it must be in a loop, reject.
  • 15. Reduction via computation histories EECS 2001 Introduction to Theory of Computation 15  ELBA is undecidable (language of a given LBA is empty)  Idea: if ELBA is decidable then so will be ATM  Informal discussion  For a TM M and input string v, suppose we build an LBA C such that the language of C comprises of all computation histories which make M end up in the accepting state on v (this can be done in bounded memory)  If M accepts v, then there is at least one computation history  If M does not accept v, then C is empty  Therefore, if we can determine that the language C is empty or not, then we can say M accepts v or not  Construction of C  C gets a computation history, identifies the start configuration, finds an identical match for Ci and Ci+1, and keeps moving on until it matches the accepting configuration
  • 16. Reduction via computation histories EECS 2001 Introduction to Theory of Computation 16  ELBA is undecidable (language of a given LBA is empty)  Idea: if ELBA is decidable then so will be ATM  Formal proof  The TM S gets as input ⟨M,v⟩ and works as follows:  Build an LBA C as described above  Run R on input ⟨C⟩ (R is the decider for ELBA)  If R reject, accept. If R accepts, reject.  If R has accepted then it means that the language of C is empty and M has no accepting computation history for v. Hence S rejects  If R rejects, then L(C) is non-empty, which is only possible when there is a computation history of v on M. therefore M must accept v. Hence, S will accept.  We have successfully made a decider for ATM using ELBA. Contradiction. Therefore there cannot be an ELBA
  • 17. Reduction via computation histories EECS 2001 Introduction to Theory of Computation 17  ALLCFG is undecidable (whether a CFG generates all possible strings) ALLCFG = {⟨G⟩| G is a CFG and L(G) = Σ∗}.  Same strategy assume ALLCFG is decidable and then show that this makes ATM decidable  Informal discussion:  For a TM M and string v, build a CFG G  If v is accepted by M then G will generate all strings  If v is not accepted by M, then G does not generate one specific string  Specific string = accepting computation history for v being accepted by M  Other strings = all computation histories that do not allow M to accept v
  • 18. Reduction via computation histories EECS 2001 Introduction to Theory of Computation 18  ALLCFG is undecidable (whether a CFG generates all possible strings) ALLCFG = {⟨G⟩| G is a CFG and L(G) = Σ∗}.  Informal discussion:  Building G  Remember a computation history is represented as a string  Try to remember how we proved the uncountability of real number  Similarly, we make G such that it generates all string (computation histories) except the accepting one  Starting configuration different  Ending configuration different  Some transition from Ci to Ci+1 does not match  Details on page 226 – omit for the purposes of the test
  • 19. References EECS 2001 Introduction to Theory of Computation 19 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