SlideShare a Scribd company logo
12.4 Proving Non-Computability
We can show that a problem is computable by describing a procedure and proving that
the procedure always terminates and always produces the correct answer.
It is enough to provide a convincing argument that such a procedure exists; finding the
actual procedure is not necessary (but often helps to make the argument
more convincing).
To show that a problem is not computable, we need to show that *no& algorithm exists
that solves the problem. Since there are an infinite number of possible procedures, we
cannot just list all possible procedures and show why each one does not solve
the problem.
Instead, we need to construct an argument showing that if there were such an algorithm
it would lead to a contradiction.
The core of our argument is based on knowing the Halting Problem is noncomputable.
If a solution to some new problem PP could be used to solve the Halting Problem, then
we know that PP is also noncomputable.
That is, no algorithm exists that can solve PP since if such an algorithm exists it could
be used to also solve the Halting Problem which we already know is impossible.
Reduction Proofs. The proof technique where we show that a solution for some
problem PP can be used to solve a different problem QQ is known as a reduction.
A problem QQ is reducible to a problem PP if a solution to PP could be used
to solveQQ. This means that problem QQ is no harder than problem PP, since a
solution to problem QQ leads to a solution to problem PP.
Example 12.1: Prints-Three Problem
Consider the problem of determining if an application of a procedure would ever print 3:
Prints-ThreePrints-Three
Input: A string representing a Python program.
Output: If evaluating the input program would print 3, output True;
otherwise, output False.
We show the Prints-Three Problem is noncomputable by showing that it is as hard as
the Halting Problem, which we already know is noncomputable.
Suppose we had an algorithm printsThree that solves the Prints-Three Problem.
Then, we could define halts as:
defhalts(p):
return printsThree(p + '; print(3)')
The printsThree application would evaluate to True if evaluating the Python program
specified by p would halt since that means the print(3) statement appended to p
would be evaluated.
On the other hand, if evaluating p would not halt, the added print statement
never evaluated.
As long as the program specified by p would never print 3, the application
of printsThree should evaluate toFalse.
Hence, if a printsThree algorithm exists, we would use it to implement an algorithm that
solves the Halting Problem.
The one wrinkle is that the specified input program might print 3 itself. We can avoid
this problem by transforming the input program so it would never print 3itself, without
otherwise altering its behavior.
One way to do this would be to replace all occurrences of print (or any other
built-in procedure that prints) in the string with a new procedure, dontprint that
behaves like print but doesn't actually print out anything.
Suppose the replacePrints procedure
use printsThree to define halts:
is defined to do this. Then, we could
def halts(p): return printsThree(replacePrints(p) + '; print(3)')

More Related Content

PDF
11 ml system design
PPTX
"A short and knowledgeable concept about Algorithm "
ODP
Why you should use a testing framework
PPTX
Algorithm paradigms
PPTX
What is algorithm
PPT
03 algorithm properties
PPTX
Modelling in physical
11 ml system design
"A short and knowledgeable concept about Algorithm "
Why you should use a testing framework
Algorithm paradigms
What is algorithm
03 algorithm properties
Modelling in physical

Viewers also liked (16)

DOCX
Muhammad Imran Mugha1
DOC
CV. Ahmad Yusuf
DOC
CV Rauf 2014
PPTX
Ledesma sandoval
PPT
Understanding the Tremendous Value of Mobile Analytics
PPS
Elaguila
DOCX
Mundo virtual
PPTX
Tổ chức sự kiện khai trương,động thổ, khánh thành uy tín,chuyên nghiệp, chất ...
PPS
Practices Impacting Workplace
PPTX
Improving Business Agility through IBM Business Insight Advanced
PDF
First Aid Certificate
DOC
monde voiture embaucher
PPTX
Presentación1
PPTX
Seres vivospincence astoreca-ruffini
PPTX
Tipos de cliente
DOCX
Jaoa m3 u4_repote_recursoweb2.0_personal
Muhammad Imran Mugha1
CV. Ahmad Yusuf
CV Rauf 2014
Ledesma sandoval
Understanding the Tremendous Value of Mobile Analytics
Elaguila
Mundo virtual
Tổ chức sự kiện khai trương,động thổ, khánh thành uy tín,chuyên nghiệp, chất ...
Practices Impacting Workplace
Improving Business Agility through IBM Business Insight Advanced
First Aid Certificate
monde voiture embaucher
Presentación1
Seres vivospincence astoreca-ruffini
Tipos de cliente
Jaoa m3 u4_repote_recursoweb2.0_personal
Ad

Similar to proving non-computability (20)

PPT
Halting Problemof P vesus NP Problems in TOC
PPT
the halting_problem
PPT
compatibility and complexity in the IS.ppt
PDF
1_2 Introduction to Machine Learning.pdf
PDF
theory of computation chapter 2 notes pdf
PDF
Algoritmos
PPTX
ALGORITHMS BASIC PRESENTATION FOR EVERYONE TO UNDERSTAND
PDF
Introduction to Programming
PDF
Workbook_2_Problem_Solving_and_programming.pdf
PDF
Conditional Statements
PPTX
Recursion | C++ | DSA
DOCX
Essentials of machine learning algorithms
PDF
Algorithms notes 2 tutorials duniya
PPTX
WEKA: Credibility Evaluating Whats Been Learned
PPTX
WEKA:Credibility Evaluating Whats Been Learned
PPTX
DAA UNIT 3
Halting Problemof P vesus NP Problems in TOC
the halting_problem
compatibility and complexity in the IS.ppt
1_2 Introduction to Machine Learning.pdf
theory of computation chapter 2 notes pdf
Algoritmos
ALGORITHMS BASIC PRESENTATION FOR EVERYONE TO UNDERSTAND
Introduction to Programming
Workbook_2_Problem_Solving_and_programming.pdf
Conditional Statements
Recursion | C++ | DSA
Essentials of machine learning algorithms
Algorithms notes 2 tutorials duniya
WEKA: Credibility Evaluating Whats Been Learned
WEKA:Credibility Evaluating Whats Been Learned
DAA UNIT 3
Ad

More from Rajendran (20)

PPT
Element distinctness lower bounds
PPT
Scheduling with Startup and Holding Costs
PPT
Divide and conquer surfing lower bounds
PPT
Red black tree
PPT
Hash table
PPT
Medians and order statistics
PPT
Proof master theorem
PPT
Recursion tree method
PPT
Recurrence theorem
PPT
Master method
PPT
Master method theorem
PPT
Hash tables
PPT
Lower bound
PPT
Master method theorem
PPT
Greedy algorithms
PPT
Longest common subsequences in Algorithm Analysis
PPT
Dynamic programming in Algorithm Analysis
PPT
Average case Analysis of Quicksort
PPT
Np completeness
PPT
computer languages
Element distinctness lower bounds
Scheduling with Startup and Holding Costs
Divide and conquer surfing lower bounds
Red black tree
Hash table
Medians and order statistics
Proof master theorem
Recursion tree method
Recurrence theorem
Master method
Master method theorem
Hash tables
Lower bound
Master method theorem
Greedy algorithms
Longest common subsequences in Algorithm Analysis
Dynamic programming in Algorithm Analysis
Average case Analysis of Quicksort
Np completeness
computer languages

Recently uploaded (20)

PPTX
Presentation on HIE in infants and its manifestations
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Classroom Observation Tools for Teachers
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
A systematic review of self-coping strategies used by university students to ...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PPTX
GDM (1) (1).pptx small presentation for students
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Pharma ospi slides which help in ospi learning
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Presentation on HIE in infants and its manifestations
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Microbial diseases, their pathogenesis and prophylaxis
Classroom Observation Tools for Teachers
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
A systematic review of self-coping strategies used by university students to ...
Final Presentation General Medicine 03-08-2024.pptx
O7-L3 Supply Chain Operations - ICLT Program
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
102 student loan defaulters named and shamed – Is someone you know on the list?
202450812 BayCHI UCSC-SV 20250812 v17.pptx
GDM (1) (1).pptx small presentation for students
2.FourierTransform-ShortQuestionswithAnswers.pdf
Pharma ospi slides which help in ospi learning
O5-L3 Freight Transport Ops (International) V1.pdf
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Microbial disease of the cardiovascular and lymphatic systems
VCE English Exam - Section C Student Revision Booklet
Chapter 2 Heredity, Prenatal Development, and Birth.pdf

proving non-computability

  • 1. 12.4 Proving Non-Computability We can show that a problem is computable by describing a procedure and proving that the procedure always terminates and always produces the correct answer. It is enough to provide a convincing argument that such a procedure exists; finding the actual procedure is not necessary (but often helps to make the argument more convincing). To show that a problem is not computable, we need to show that *no& algorithm exists that solves the problem. Since there are an infinite number of possible procedures, we cannot just list all possible procedures and show why each one does not solve the problem. Instead, we need to construct an argument showing that if there were such an algorithm it would lead to a contradiction. The core of our argument is based on knowing the Halting Problem is noncomputable. If a solution to some new problem PP could be used to solve the Halting Problem, then we know that PP is also noncomputable. That is, no algorithm exists that can solve PP since if such an algorithm exists it could be used to also solve the Halting Problem which we already know is impossible.
  • 2. Reduction Proofs. The proof technique where we show that a solution for some problem PP can be used to solve a different problem QQ is known as a reduction. A problem QQ is reducible to a problem PP if a solution to PP could be used to solveQQ. This means that problem QQ is no harder than problem PP, since a solution to problem QQ leads to a solution to problem PP. Example 12.1: Prints-Three Problem Consider the problem of determining if an application of a procedure would ever print 3: Prints-ThreePrints-Three Input: A string representing a Python program. Output: If evaluating the input program would print 3, output True; otherwise, output False. We show the Prints-Three Problem is noncomputable by showing that it is as hard as the Halting Problem, which we already know is noncomputable. Suppose we had an algorithm printsThree that solves the Prints-Three Problem. Then, we could define halts as: defhalts(p): return printsThree(p + '; print(3)')
  • 3. The printsThree application would evaluate to True if evaluating the Python program specified by p would halt since that means the print(3) statement appended to p would be evaluated. On the other hand, if evaluating p would not halt, the added print statement never evaluated. As long as the program specified by p would never print 3, the application of printsThree should evaluate toFalse. Hence, if a printsThree algorithm exists, we would use it to implement an algorithm that solves the Halting Problem. The one wrinkle is that the specified input program might print 3 itself. We can avoid this problem by transforming the input program so it would never print 3itself, without otherwise altering its behavior. One way to do this would be to replace all occurrences of print (or any other built-in procedure that prints) in the string with a new procedure, dontprint that behaves like print but doesn't actually print out anything. Suppose the replacePrints procedure use printsThree to define halts: is defined to do this. Then, we could def halts(p): return printsThree(replacePrints(p) + '; print(3)')