SlideShare a Scribd company logo
1 of 17
Chapters 11 and 12
Decision Problems and
Undecidability
2
11.1 Decision Problems
 A decision problem
 consists of a set of questions whose answers are either
yes or no
 is undecidable if no algorithm that can solve the problem;
otherwise, it is decidable
 The Church-Turing thesis asserts that
 a decision problem P has a solution if, and only if, there
exists a TM that determines the answer for every p  P
 if no such TM exists, the problem is said to be undecidable
 An unsolvable problem
 is a problem such that there does not exist any TM that
can solve the problem
3
Decision Problems
 Algorithm L that solves a decision problem should be
effective, i.e.,
 Complete: L produces the correct answer (yes/or) to each
question (of the problem)
 Mechanistic: L consists of a finite sequence of instructions
 Deterministic: L produces the same result for the same input
 The Church-Turing Thesis for Computable Functions:
 A function f is effective, i.e., effectively computable, if and only if
there is a TM that computes f.
4
11.2 Recursive Languages
 Defn. A recursive language L is a formal language for
which there exists a TM that will halt and accept an
input string in L, and halt and reject, otherwise.
 Example 11.2.1 The decision problem of determining
whether a natural number is a perfect square
(represented by using the string an) is decidable.
 Example 11.2.2 The decision problem of determining
whether there is a path P from node vi to a node vj in a
directed graph G (with nodes v1, …, vn) using a NTM M
with 2-tape is decidable. G is represented over {0, 1} as
• Encode vk (1  k  n) as 1k+1, and arc (vs,vt) as 1s+1 0 1t+1
• Separate each arc by 00; three 0’s separate G and vi and vj
• Write vi (as vs) on tape 2 and consider each arc (vs,vt) in G
• M accepts, if vt = vj , or rejects if vt has been visited/no edge
5
 The halting problem
Given an arbitrary TM M with input alphabet  and a
string w  *, will the computation of M with w halt?
 There is no algorithm that solves the halting problem,
i.e., the halting problem is undecidable.
 A solution to the halting problem requires a general
algorithm that answers the halting question for
each combination of TM and input string.
 Proposed solution: encode the TM M and the string w
as an input over the alphabet { 0, 1 } and tape alphabet
{ 0,1, B } with { q0, q1, …, qn } being the states of M and
q0 is the start state.
12.1 The Halting Problem for TMs
6
 Consider the following encoding scheme (as shown in Section
11.5):
Symbol Encoding
0 1
1 11
B 111
q0 1
q1 11
… …
qn 1n+1
L 1
R 11
Let en(Z) denotes the encoding of a symbol Z. A transition
(qi, X) = [qj, Y, d] is encoded by the string
en(qi) 0 en(X) 0 en(qj) 0 en(Y) 0 en(d)
where 0’s separate the components of the transition, 2 0s separate
transitions, and 3 0s designate the beginning & end of the encoding
12.1 The Halting Problem for TMs
7
12.1 The Halting Problem for TMs
 We can construct a TM to determine whether an arbitrary
string u  { 0, 1 }* is the encoding of a DTM M.
 Theorem 12.1.1. The halting problem of TMs is undecidable.
Proof. The proof is by contradiction. Assume that there
is a TM H that solves the halting problem. A string z is
accepted by H if
(i) z consists of the representation of a TM M following
by a string W, and
(ii) the computation of M with input W halts.
If either of these conditions is not satisfied, then H rejects
the input. …
8
11.2 Recursive vs. Recursively Enumerable Languages
 Defn. A recursively enumerable language L is a formal language
for which there exists a TM that will halt and accept an
input string in L, and may either (i) halt and reject, or (ii)
loop forever, otherwise.
 Defn. A recursive language L is a formal language for which
there exists a TM that will halt and accept an input string
in L, and halt and reject, otherwise.
 Corollary 12.1.3 The recursive languages are a proper subset
of recursively enumerable languages.
Proof. Let a language L be LH = { R(M)w | R(M) is the representation
of a TM M and M halts with input w } over { 0, 1 }* is recursively
enumerable according to Theorem 11.5.1 (i.e., LH is recursively
enumerable). LH is not recursive according to Corollary 12.1.2,
which states that the language LH is not recursive.
9
11.2 Recursive vs. Recursively Enumerable Languages
 Given that L and P are two recursively enumerable languages,
then the following languages are recursively enumerable:
 The union, L  P
 The intersection, L  P
 The concatenation LP of L and P
 The Kleene star L* of L
 Recursively enumerable languages are not closed under set
difference or complementation, i.e., given two recursively
enumerable languages L and P
 If L is also recursively enumerable, then L is recursive
 L – P may or may not be recursively enumerable, since
L – P = L  L  P
10
11.2 Recursive vs. Recursively Enumerable Languages
 The union of two recursively enumerable languages is
recursively enumerable
Proof. Let L1 and L2 be two recursively enumerable languages
accepted by TMs M1 and M2, respectively. We show that
L1  L2 is accepted by a 2-tape TM M.
Let x = w1  w2. To determine if M1 or M2 accepts x, i.e.,
w1  L1 or w2  L2, run both M1 & M2 on x simultaneously
using the 2-tape TM M.
M simulates M1 on the first tape & M2 on the second tape. If
either one of the TM enters the final state and halts, then the
input x is accepted by M, i.e.,
x
M1
M2
Yes
Yes
M
11
11.2 Recursive vs. Recursively Enumerable Languages
 If the languages L and L are recursively enumerable, then
L is recursive.
Proof. Let M1 & M2 be two TMs, such that L = L(M1) and L = L(M2).
Construct a 2-tapeTM that simulates M1 & M2 in parallel, with
M1 on tape 1 & M2 on tape 2.
If an input x to M is in L, then M1 halts & accepts x, and hence
M accepts x and halts.
If input x to M is not in L, hence it is in L, then M2 accepts and
halts for x and M halts w/o accepting. Hence, M halts with
every input and L = L(M), and L is recursive.
x
M1
M2
Accept
Reject
M
Accept
Accept
12
11.2 Recursive vs. Recursively Enumerable Languages
 Given that L and P are two recursive languages, then the
following languages are recursive as well:
 The union, L  P
 The intersection, L  P
 The difference, L – P
 The complement of L, L
 The concatenation LP of L and P
 The Kleene star L* of L
 Recursively languages L and P are closed under set difference,
since
L – P = L  L  P
13
11.2 Recursive vs. Recursively Enumerable Languages
 Given that L is a recursive language and P is a recursively
enumerable language, then the following languages are
recursively enumerable as well:
 The union, L  P
 The intersection, L  P
 The concatenation LP of L and P
 The difference, P – L (but not L – P)
14
11.2 Recursive vs. Recursively Enumerable Languages
 The intersection of a recursive language L1 & a recursively
enumerable language L2 is recursively enumerable
Proof. Let L1 and L2 be the languages accepted by TMs M1 and
M2, respectively. We show that L1  L2 is accepted by a TM
M which halts and accepts an input string x if x  L1  L2.
M simply simulates M1 & M2 one after the other on the same
input x. If M1 halts and accepts x, M clears the tape, copies x
on the tape & starts simulating M2 . If M2 also halts & accepts
x, then M accepts x.
Clearly, M accepts L1  L2, and if M1 & M2 halts on all inputs,
then M also halts on all inputs
x M1 M2
Yes Yes
M
15
11.4 The Church-Turing Thesis
 The Church-Turing thesis asserts that every solvable decision
problem can be transformed into an equivalent Turing
machine problem.
 The Church-Turing thesis for decision problems:
There is an effective procedure to solve a decision problem if,
and only if, there is a TM that halts for all input strings and
solves the problem.
 A solution to a decision problem is a equivalent to the question
of membership in a recursive language.
 The Church-Turing thesis for Recognition Problems:
A decision problem P is partially solvable if, and only if, there is a
TM that accepts precisely the instances of P whose answer is “yes”.
 A partial solution to a decision problem is equivalent to the question
of membership in a recursively enumerable language.
16
11.5 A Universal Machine
 Universal Turning machine (U)
 designed to simulate the computations of any TM M
 Accepts the input R(M)w, whenever M (accepts by halting)
halts with w
 Loop whenever M does not halt with w
 U accepts the set of strings in L(U), which consists of all
strings R(M)w for which M halts with input w
 U represents the entire family of TMs, since the outcome
of the computation of any TM M with input w can be
obtained by the computation of U with input R(M)w
Universal
Machine
U
M halts with input w
M does not halt with w
Accept
Loop
R(M)w
17
11.5 A Universal Machine
 Theorem 11.5.1 The language LH = { R(M)w | M halts with input
w } is recursively enumerable.
Proof. Use a deterministic 3-tape TM U to accept LH by halting, where
1) an input string S is placed on tape 1 and U moves indefinitely
to the right if S does not have the form R(M)w
2) the computation of M with w, which is copied to tape 3, is
simulated on tape 3
3) the current state, i.e., start state q0, is encoded as ‘1’ on tape 2
4) let x be the symbol on tape 3 and qi the state encoded on tape 2:
a) Scan tape 1 for en(qi) and en(x). If such transition does not exist, U
halts and accepts S. (* Recall that U accepts by halting *)
b) Otherwise, en(qi) 0 en(x) 0 en(qj) 0 en(y) 0 en(d) exists. Then
i. Replace en(qi) by en(qj) on tape 2.
ii. Write y to tape 3.
iii. Move the tape head of tape 3 in the direction of d.
5) Repeat Step 4 to simulate the next transition of M.

More Related Content

Similar to Ch11.ppt

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.docxjasoninnes20
 
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.docxclairbycraft
 
Undecidability1
Undecidability1Undecidability1
Undecidability1ishapadhy
 
Undecidability.pptx
Undecidability.pptxUndecidability.pptx
Undecidability.pptxPEzhumalai
 
Lecture: Regular Expressions and Regular Languages
Lecture: Regular Expressions and Regular LanguagesLecture: Regular Expressions and Regular Languages
Lecture: Regular Expressions and Regular LanguagesMarina Santini
 
Undecidable problem.pptxUndecidable problemUndecidable problem
Undecidable problem.pptxUndecidable problemUndecidable problemUndecidable problem.pptxUndecidable problemUndecidable problem
Undecidable problem.pptxUndecidable problemUndecidable problemDeepakM509554
 
Flat notes iii i (1)(7-9-20)
Flat notes iii i (1)(7-9-20)Flat notes iii i (1)(7-9-20)
Flat notes iii i (1)(7-9-20)saithirumalg
 
practice-final-soln.pdf
practice-final-soln.pdfpractice-final-soln.pdf
practice-final-soln.pdfT17Rockstar
 
Theory of Computation - Lectures 4 and 5
Theory of Computation - Lectures 4 and 5Theory of Computation - Lectures 4 and 5
Theory of Computation - Lectures 4 and 5Dr. Maamoun Ahmed
 
Winter 9 Decidability.pptx
Winter 9 Decidability.pptxWinter 9 Decidability.pptx
Winter 9 Decidability.pptxHarisPrince
 
Winter 9 Tutorial Decidability.pptx
Winter 9 Tutorial Decidability.pptxWinter 9 Tutorial Decidability.pptx
Winter 9 Tutorial Decidability.pptxHarisPrince
 
Resumen material MIT
Resumen material MITResumen material MIT
Resumen material MITRawel Luciano
 
Turing Machine
Turing MachineTuring Machine
Turing MachineRajendran
 
Thoery of Computaion and Chomsky's Classification
Thoery of Computaion and Chomsky's ClassificationThoery of Computaion and Chomsky's Classification
Thoery of Computaion and Chomsky's ClassificationPrafullMisra
 
Presentation (5).pdf
Presentation (5).pdfPresentation (5).pdf
Presentation (5).pdfGaurav447273
 
Automata
AutomataAutomata
AutomataGaditek
 

Similar to Ch11.ppt (20)

Unit ii
Unit iiUnit ii
Unit ii
 
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
 
Undecidability1
Undecidability1Undecidability1
Undecidability1
 
Undecidability.pptx
Undecidability.pptxUndecidability.pptx
Undecidability.pptx
 
Lecture: Regular Expressions and Regular Languages
Lecture: Regular Expressions and Regular LanguagesLecture: Regular Expressions and Regular Languages
Lecture: Regular Expressions and Regular Languages
 
lect_23.pdf
lect_23.pdflect_23.pdf
lect_23.pdf
 
Undecidable problem.pptxUndecidable problemUndecidable problem
Undecidable problem.pptxUndecidable problemUndecidable problemUndecidable problem.pptxUndecidable problemUndecidable problem
Undecidable problem.pptxUndecidable problemUndecidable problem
 
Flat notes iii i (1)(7-9-20)
Flat notes iii i (1)(7-9-20)Flat notes iii i (1)(7-9-20)
Flat notes iii i (1)(7-9-20)
 
practice-final-soln.pdf
practice-final-soln.pdfpractice-final-soln.pdf
practice-final-soln.pdf
 
Theory of Computation - Lectures 4 and 5
Theory of Computation - Lectures 4 and 5Theory of Computation - Lectures 4 and 5
Theory of Computation - Lectures 4 and 5
 
Winter 9 Decidability.pptx
Winter 9 Decidability.pptxWinter 9 Decidability.pptx
Winter 9 Decidability.pptx
 
Winter 9 Tutorial Decidability.pptx
Winter 9 Tutorial Decidability.pptxWinter 9 Tutorial Decidability.pptx
Winter 9 Tutorial Decidability.pptx
 
Lesson 08
Lesson 08Lesson 08
Lesson 08
 
Resumen material MIT
Resumen material MITResumen material MIT
Resumen material MIT
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Thoery of Computaion and Chomsky's Classification
Thoery of Computaion and Chomsky's ClassificationThoery of Computaion and Chomsky's Classification
Thoery of Computaion and Chomsky's Classification
 
slides3.pdf
slides3.pdfslides3.pdf
slides3.pdf
 
Presentation (5).pdf
Presentation (5).pdfPresentation (5).pdf
Presentation (5).pdf
 
Automata
AutomataAutomata
Automata
 

More from mukul narayana

Note for Artificial Neural Network - ANN by Aman Kumar _ LectureNotes.pdf
Note for Artificial Neural Network - ANN by Aman Kumar _ LectureNotes.pdfNote for Artificial Neural Network - ANN by Aman Kumar _ LectureNotes.pdf
Note for Artificial Neural Network - ANN by Aman Kumar _ LectureNotes.pdfmukul narayana
 
churchturingthesis-160906170827.pptx
churchturingthesis-160906170827.pptxchurchturingthesis-160906170827.pptx
churchturingthesis-160906170827.pptxmukul narayana
 
Energy Management Presentation (1).ppt
Energy Management Presentation (1).pptEnergy Management Presentation (1).ppt
Energy Management Presentation (1).pptmukul narayana
 

More from mukul narayana (6)

Note for Artificial Neural Network - ANN by Aman Kumar _ LectureNotes.pdf
Note for Artificial Neural Network - ANN by Aman Kumar _ LectureNotes.pdfNote for Artificial Neural Network - ANN by Aman Kumar _ LectureNotes.pdf
Note for Artificial Neural Network - ANN by Aman Kumar _ LectureNotes.pdf
 
Presentation_ADP.pptx
Presentation_ADP.pptxPresentation_ADP.pptx
Presentation_ADP.pptx
 
Ch11.ppt
Ch11.pptCh11.ppt
Ch11.ppt
 
ch15.ppt
ch15.pptch15.ppt
ch15.ppt
 
churchturingthesis-160906170827.pptx
churchturingthesis-160906170827.pptxchurchturingthesis-160906170827.pptx
churchturingthesis-160906170827.pptx
 
Energy Management Presentation (1).ppt
Energy Management Presentation (1).pptEnergy Management Presentation (1).ppt
Energy Management Presentation (1).ppt
 

Recently uploaded

Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 

Recently uploaded (20)

Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 

Ch11.ppt

  • 1. Chapters 11 and 12 Decision Problems and Undecidability
  • 2. 2 11.1 Decision Problems  A decision problem  consists of a set of questions whose answers are either yes or no  is undecidable if no algorithm that can solve the problem; otherwise, it is decidable  The Church-Turing thesis asserts that  a decision problem P has a solution if, and only if, there exists a TM that determines the answer for every p  P  if no such TM exists, the problem is said to be undecidable  An unsolvable problem  is a problem such that there does not exist any TM that can solve the problem
  • 3. 3 Decision Problems  Algorithm L that solves a decision problem should be effective, i.e.,  Complete: L produces the correct answer (yes/or) to each question (of the problem)  Mechanistic: L consists of a finite sequence of instructions  Deterministic: L produces the same result for the same input  The Church-Turing Thesis for Computable Functions:  A function f is effective, i.e., effectively computable, if and only if there is a TM that computes f.
  • 4. 4 11.2 Recursive Languages  Defn. A recursive language L is a formal language for which there exists a TM that will halt and accept an input string in L, and halt and reject, otherwise.  Example 11.2.1 The decision problem of determining whether a natural number is a perfect square (represented by using the string an) is decidable.  Example 11.2.2 The decision problem of determining whether there is a path P from node vi to a node vj in a directed graph G (with nodes v1, …, vn) using a NTM M with 2-tape is decidable. G is represented over {0, 1} as • Encode vk (1  k  n) as 1k+1, and arc (vs,vt) as 1s+1 0 1t+1 • Separate each arc by 00; three 0’s separate G and vi and vj • Write vi (as vs) on tape 2 and consider each arc (vs,vt) in G • M accepts, if vt = vj , or rejects if vt has been visited/no edge
  • 5. 5  The halting problem Given an arbitrary TM M with input alphabet  and a string w  *, will the computation of M with w halt?  There is no algorithm that solves the halting problem, i.e., the halting problem is undecidable.  A solution to the halting problem requires a general algorithm that answers the halting question for each combination of TM and input string.  Proposed solution: encode the TM M and the string w as an input over the alphabet { 0, 1 } and tape alphabet { 0,1, B } with { q0, q1, …, qn } being the states of M and q0 is the start state. 12.1 The Halting Problem for TMs
  • 6. 6  Consider the following encoding scheme (as shown in Section 11.5): Symbol Encoding 0 1 1 11 B 111 q0 1 q1 11 … … qn 1n+1 L 1 R 11 Let en(Z) denotes the encoding of a symbol Z. A transition (qi, X) = [qj, Y, d] is encoded by the string en(qi) 0 en(X) 0 en(qj) 0 en(Y) 0 en(d) where 0’s separate the components of the transition, 2 0s separate transitions, and 3 0s designate the beginning & end of the encoding 12.1 The Halting Problem for TMs
  • 7. 7 12.1 The Halting Problem for TMs  We can construct a TM to determine whether an arbitrary string u  { 0, 1 }* is the encoding of a DTM M.  Theorem 12.1.1. The halting problem of TMs is undecidable. Proof. The proof is by contradiction. Assume that there is a TM H that solves the halting problem. A string z is accepted by H if (i) z consists of the representation of a TM M following by a string W, and (ii) the computation of M with input W halts. If either of these conditions is not satisfied, then H rejects the input. …
  • 8. 8 11.2 Recursive vs. Recursively Enumerable Languages  Defn. A recursively enumerable language L is a formal language for which there exists a TM that will halt and accept an input string in L, and may either (i) halt and reject, or (ii) loop forever, otherwise.  Defn. A recursive language L is a formal language for which there exists a TM that will halt and accept an input string in L, and halt and reject, otherwise.  Corollary 12.1.3 The recursive languages are a proper subset of recursively enumerable languages. Proof. Let a language L be LH = { R(M)w | R(M) is the representation of a TM M and M halts with input w } over { 0, 1 }* is recursively enumerable according to Theorem 11.5.1 (i.e., LH is recursively enumerable). LH is not recursive according to Corollary 12.1.2, which states that the language LH is not recursive.
  • 9. 9 11.2 Recursive vs. Recursively Enumerable Languages  Given that L and P are two recursively enumerable languages, then the following languages are recursively enumerable:  The union, L  P  The intersection, L  P  The concatenation LP of L and P  The Kleene star L* of L  Recursively enumerable languages are not closed under set difference or complementation, i.e., given two recursively enumerable languages L and P  If L is also recursively enumerable, then L is recursive  L – P may or may not be recursively enumerable, since L – P = L  L  P
  • 10. 10 11.2 Recursive vs. Recursively Enumerable Languages  The union of two recursively enumerable languages is recursively enumerable Proof. Let L1 and L2 be two recursively enumerable languages accepted by TMs M1 and M2, respectively. We show that L1  L2 is accepted by a 2-tape TM M. Let x = w1  w2. To determine if M1 or M2 accepts x, i.e., w1  L1 or w2  L2, run both M1 & M2 on x simultaneously using the 2-tape TM M. M simulates M1 on the first tape & M2 on the second tape. If either one of the TM enters the final state and halts, then the input x is accepted by M, i.e., x M1 M2 Yes Yes M
  • 11. 11 11.2 Recursive vs. Recursively Enumerable Languages  If the languages L and L are recursively enumerable, then L is recursive. Proof. Let M1 & M2 be two TMs, such that L = L(M1) and L = L(M2). Construct a 2-tapeTM that simulates M1 & M2 in parallel, with M1 on tape 1 & M2 on tape 2. If an input x to M is in L, then M1 halts & accepts x, and hence M accepts x and halts. If input x to M is not in L, hence it is in L, then M2 accepts and halts for x and M halts w/o accepting. Hence, M halts with every input and L = L(M), and L is recursive. x M1 M2 Accept Reject M Accept Accept
  • 12. 12 11.2 Recursive vs. Recursively Enumerable Languages  Given that L and P are two recursive languages, then the following languages are recursive as well:  The union, L  P  The intersection, L  P  The difference, L – P  The complement of L, L  The concatenation LP of L and P  The Kleene star L* of L  Recursively languages L and P are closed under set difference, since L – P = L  L  P
  • 13. 13 11.2 Recursive vs. Recursively Enumerable Languages  Given that L is a recursive language and P is a recursively enumerable language, then the following languages are recursively enumerable as well:  The union, L  P  The intersection, L  P  The concatenation LP of L and P  The difference, P – L (but not L – P)
  • 14. 14 11.2 Recursive vs. Recursively Enumerable Languages  The intersection of a recursive language L1 & a recursively enumerable language L2 is recursively enumerable Proof. Let L1 and L2 be the languages accepted by TMs M1 and M2, respectively. We show that L1  L2 is accepted by a TM M which halts and accepts an input string x if x  L1  L2. M simply simulates M1 & M2 one after the other on the same input x. If M1 halts and accepts x, M clears the tape, copies x on the tape & starts simulating M2 . If M2 also halts & accepts x, then M accepts x. Clearly, M accepts L1  L2, and if M1 & M2 halts on all inputs, then M also halts on all inputs x M1 M2 Yes Yes M
  • 15. 15 11.4 The Church-Turing Thesis  The Church-Turing thesis asserts that every solvable decision problem can be transformed into an equivalent Turing machine problem.  The Church-Turing thesis for decision problems: There is an effective procedure to solve a decision problem if, and only if, there is a TM that halts for all input strings and solves the problem.  A solution to a decision problem is a equivalent to the question of membership in a recursive language.  The Church-Turing thesis for Recognition Problems: A decision problem P is partially solvable if, and only if, there is a TM that accepts precisely the instances of P whose answer is “yes”.  A partial solution to a decision problem is equivalent to the question of membership in a recursively enumerable language.
  • 16. 16 11.5 A Universal Machine  Universal Turning machine (U)  designed to simulate the computations of any TM M  Accepts the input R(M)w, whenever M (accepts by halting) halts with w  Loop whenever M does not halt with w  U accepts the set of strings in L(U), which consists of all strings R(M)w for which M halts with input w  U represents the entire family of TMs, since the outcome of the computation of any TM M with input w can be obtained by the computation of U with input R(M)w Universal Machine U M halts with input w M does not halt with w Accept Loop R(M)w
  • 17. 17 11.5 A Universal Machine  Theorem 11.5.1 The language LH = { R(M)w | M halts with input w } is recursively enumerable. Proof. Use a deterministic 3-tape TM U to accept LH by halting, where 1) an input string S is placed on tape 1 and U moves indefinitely to the right if S does not have the form R(M)w 2) the computation of M with w, which is copied to tape 3, is simulated on tape 3 3) the current state, i.e., start state q0, is encoded as ‘1’ on tape 2 4) let x be the symbol on tape 3 and qi the state encoded on tape 2: a) Scan tape 1 for en(qi) and en(x). If such transition does not exist, U halts and accepts S. (* Recall that U accepts by halting *) b) Otherwise, en(qi) 0 en(x) 0 en(qj) 0 en(y) 0 en(d) exists. Then i. Replace en(qi) by en(qj) on tape 2. ii. Write y to tape 3. iii. Move the tape head of tape 3 in the direction of d. 5) Repeat Step 4 to simulate the next transition of M.