SlideShare ist ein Scribd-Unternehmen logo
1 von 3
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)')

Weitere ähnliche Inhalte

Andere mochten auch

Muhammad Imran Mugha1
Muhammad Imran Mugha1Muhammad Imran Mugha1
Muhammad Imran Mugha1
mynain
 
Seres vivospincence astoreca-ruffini
Seres vivospincence astoreca-ruffiniSeres vivospincence astoreca-ruffini
Seres vivospincence astoreca-ruffini
Claudia Poza
 
Jaoa m3 u4_repote_recursoweb2.0_personal
Jaoa m3 u4_repote_recursoweb2.0_personalJaoa m3 u4_repote_recursoweb2.0_personal
Jaoa m3 u4_repote_recursoweb2.0_personal
olague99
 

Andere mochten auch (17)

Muhammad Imran Mugha1
Muhammad Imran Mugha1Muhammad Imran Mugha1
Muhammad Imran Mugha1
 
CV. Ahmad Yusuf
CV. Ahmad YusufCV. Ahmad Yusuf
CV. Ahmad Yusuf
 
CV Rauf 2014
CV Rauf 2014CV Rauf 2014
CV Rauf 2014
 
Ledesma sandoval
Ledesma sandovalLedesma sandoval
Ledesma sandoval
 
Understanding the Tremendous Value of Mobile Analytics
Understanding the Tremendous Value of Mobile AnalyticsUnderstanding the Tremendous Value of Mobile Analytics
Understanding the Tremendous Value of Mobile Analytics
 
Elaguila
ElaguilaElaguila
Elaguila
 
Mundo virtual
Mundo virtualMundo virtual
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 ...
Tổ chức sự kiện khai trương,động thổ, khánh thành uy tín,chuyên nghiệp, chất ...Tổ chức sự kiện khai trương,động thổ, khánh thành uy tín,chuyên nghiệp, chất ...
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
Practices Impacting WorkplacePractices Impacting Workplace
Practices Impacting Workplace
 
Improving Business Agility through IBM Business Insight Advanced
Improving Business Agility through IBM Business Insight AdvancedImproving Business Agility through IBM Business Insight Advanced
Improving Business Agility through IBM Business Insight Advanced
 
First Aid Certificate
First Aid CertificateFirst Aid Certificate
First Aid Certificate
 
monde voiture embaucher
monde voiture embauchermonde voiture embaucher
monde voiture embaucher
 
Presentación1
Presentación1Presentación1
Presentación1
 
Seres vivospincence astoreca-ruffini
Seres vivospincence astoreca-ruffiniSeres vivospincence astoreca-ruffini
Seres vivospincence astoreca-ruffini
 
Los 11 Principios de la Propaganda de Goebbels
Los 11 Principios de la Propaganda de GoebbelsLos 11 Principios de la Propaganda de Goebbels
Los 11 Principios de la Propaganda de Goebbels
 
Tipos de cliente
Tipos de clienteTipos de cliente
Tipos de cliente
 
Jaoa m3 u4_repote_recursoweb2.0_personal
Jaoa m3 u4_repote_recursoweb2.0_personalJaoa m3 u4_repote_recursoweb2.0_personal
Jaoa m3 u4_repote_recursoweb2.0_personal
 

Ähnlich wie proving non-computability

Ähnlich wie proving non-computability (20)

the halting_problem
the halting_problemthe halting_problem
the halting_problem
 
compatibility and complexity in the IS.ppt
compatibility and complexity in the IS.pptcompatibility and complexity in the IS.ppt
compatibility and complexity in the IS.ppt
 
Algoritmos
AlgoritmosAlgoritmos
Algoritmos
 
Introduction to Programming
Introduction to ProgrammingIntroduction to Programming
Introduction to Programming
 
Workbook_2_Problem_Solving_and_programming.pdf
Workbook_2_Problem_Solving_and_programming.pdfWorkbook_2_Problem_Solving_and_programming.pdf
Workbook_2_Problem_Solving_and_programming.pdf
 
Conditional Statements
Conditional StatementsConditional Statements
Conditional Statements
 
Recursion | C++ | DSA
Recursion | C++ | DSARecursion | C++ | DSA
Recursion | C++ | DSA
 
Essentials of machine learning algorithms
Essentials of machine learning algorithmsEssentials of machine learning algorithms
Essentials of machine learning algorithms
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 
Algorithms notes 2 tutorials duniya
Algorithms notes 2   tutorials duniyaAlgorithms notes 2   tutorials duniya
Algorithms notes 2 tutorials duniya
 
WEKA:Credibility Evaluating Whats Been Learned
WEKA:Credibility Evaluating Whats Been LearnedWEKA:Credibility Evaluating Whats Been Learned
WEKA:Credibility Evaluating Whats Been Learned
 
WEKA: Credibility Evaluating Whats Been Learned
WEKA: Credibility Evaluating Whats Been LearnedWEKA: Credibility Evaluating Whats Been Learned
WEKA: Credibility Evaluating Whats Been Learned
 
DAA UNIT 3
DAA UNIT 3DAA UNIT 3
DAA UNIT 3
 
Python breakdown-workbook
Python breakdown-workbookPython breakdown-workbook
Python breakdown-workbook
 
OCT-20
OCT-20OCT-20
OCT-20
 
Daa unit 1
Daa unit 1Daa unit 1
Daa unit 1
 
Chapter 3 introduction to algorithms handouts (with notes)
Chapter 3 introduction to algorithms handouts (with notes)Chapter 3 introduction to algorithms handouts (with notes)
Chapter 3 introduction to algorithms handouts (with notes)
 
maXbox Starter 36 Software Testing
maXbox Starter 36 Software TestingmaXbox Starter 36 Software Testing
maXbox Starter 36 Software Testing
 
Create and analyse programs
Create and analyse programsCreate and analyse programs
Create and analyse programs
 

Mehr von Rajendran

Mehr von Rajendran (20)

Element distinctness lower bounds
Element distinctness lower boundsElement distinctness lower bounds
Element distinctness lower bounds
 
Scheduling with Startup and Holding Costs
Scheduling with Startup and Holding CostsScheduling with Startup and Holding Costs
Scheduling with Startup and Holding Costs
 
Divide and conquer surfing lower bounds
Divide and conquer  surfing lower boundsDivide and conquer  surfing lower bounds
Divide and conquer surfing lower bounds
 
Red black tree
Red black treeRed black tree
Red black tree
 
Hash table
Hash tableHash table
Hash table
 
Medians and order statistics
Medians and order statisticsMedians and order statistics
Medians and order statistics
 
Proof master theorem
Proof master theoremProof master theorem
Proof master theorem
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree method
 
Recurrence theorem
Recurrence theoremRecurrence theorem
Recurrence theorem
 
Master method
Master method Master method
Master method
 
Master method theorem
Master method theoremMaster method theorem
Master method theorem
 
Hash tables
Hash tablesHash tables
Hash tables
 
Lower bound
Lower boundLower bound
Lower bound
 
Master method theorem
Master method theoremMaster method theorem
Master method theorem
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
Longest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm AnalysisLongest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm Analysis
 
Dynamic programming in Algorithm Analysis
Dynamic programming in Algorithm AnalysisDynamic programming in Algorithm Analysis
Dynamic programming in Algorithm Analysis
 
Average case Analysis of Quicksort
Average case Analysis of QuicksortAverage case Analysis of Quicksort
Average case Analysis of Quicksort
 
Np completeness
Np completenessNp completeness
Np completeness
 
computer languages
computer languagescomputer languages
computer languages
 

Kürzlich hochgeladen

An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 

Kürzlich hochgeladen (20)

Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 

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)')