04/25/13 Halting Problem Discrete Structures (CS 173) Derek Hoiem, University of Illinois 1

Slides:



Advertisements
Similar presentations
Lecture 19. Reduction: More Undecidable problems
Advertisements

Data Structures and Functional Programming Computability Ramin Zabih Cornell University Fall 2012.
Problem: Give as many proofs as you can for the Pythagorean Theorem. i.e., a 2 + b 2 = c 2 holds for any right triangle with sides a & b and hypotenuse.
1 The Limits of Computation Intractable and Non-computable functions.
Week 7 - Wednesday.  What did we talk about last time?  Set proofs and disproofs  Russell’s paradox.
04/23/13 Countability Discrete Structures (CS 173) Derek Hoiem, University of Illinois 1.
CSE115/ENGR160 Discrete Mathematics 02/28/12
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Computability and Complexity 4-1 Existence of Undecidable Problems Computability and Complexity Andrei Bulatov.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
The Halting Problem Sipser 4.2 (pages ).
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
CSE115/ENGR160 Discrete Mathematics 03/03/11 Ming-Hsuan Yang UC Merced 1.
Decidable and undecidable problems deciding regular languages and CFL’s Undecidable problems.
1 Lecture 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex.
CHAPTER 4 Decidability Contents Decidable Languages
CS Summer 2005 Final class - July 1st Assorted fun topics in computability and complexity.
1 Lecture 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex.
1 Decidability continued. 2 Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input.
CS 310 – Fall 2006 Pacific University CS310 The Halting Problem Section 4.2 November 15, 2006.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 18 Instructor: Paul Beame.
Lecture 27UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 27.
CS21 Decidability and Tractability
CS212: DATASTRUCTURES Lecture 3: Recursion 1. Lecture Contents 2  The Concept of Recursion  Why recursion?  Factorial – A case study  Content of a.
Functions A B f( ) =. This Lecture We will define a function formally, and then in the next lecture we will use this concept in counting. We will also.
CSE 311 Foundations of Computing I Lecture 30 Computability: Other Undecidable Problems Autumn 2012 CSE 3111.
CS 484 – Artificial Intelligence1 Announcements Lab 4 due today, November 8 Homework 8 due Tuesday, November 13 ½ to 1 page description of final project.
04/30/13 Last class: summary, goggles, ices Discrete Structures (CS 173) Derek Hoiem, University of Illinois 1 Image: wordpress.com/2011/11/22/lig.
CS212: DATASTRUCTURES Lecture 3: Recursion 1. Lecture Contents 2  The Concept of Recursion  Why recursion?  Factorial – A case study  Content of a.
MA/CSSE 474 Theory of Computation More Reduction Examples Non-SD Reductions.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
Great Theoretical Ideas in Computer Science for Some.
CS 345: Chapter 8 Noncomputability and Undecidability Or Sometimes You Can’t Get It Done At All.
Halting Problem Introduction to Computing Science and Programming I.
CSE 311 Foundations of Computing I Lecture 26 Computability: Turing machines, Undecidability of the Halting Problem Spring
CSE 311 Foundations of Computing I Lecture 29 Computability: Turing machines, Undecidability of the Halting Problem Autumn 2012 CSE 3111.
CMP-MX21: Lecture 5 Repetitions Steve Hordley. Overview 1. Repetition using the do-while construct 2. Repetition using the while construct 3. Repetition.
ITEC 109 Lecture 11 While loops. while loops Review Choices –1 st –2 nd to ?th –Last What happens if you only use ifs? Can you have just an else by itself?
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
SNU OOPSLA Lab. 1 Great Ideas of CS with Java Part 1 WWW & Computer programming in the language Java Ch 1: The World Wide Web Ch 2: Watch out: Here comes.
CSE 311 Foundations of Computing I Lecture 28 Computability: Other Undecidable Problems Autumn 2011 CSE 3111.
8.1 8 Algorithms Foundations of Computer Science  Cengage Learning.
CompSci On the Limits of Computing  Reasons for Failure 1. Runs too long o Real time requirements o Predicting yesterday's weather 2. Non-computable.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan Today we will review sections 7.3, 7.4 and 7.5.
CSE 311: Foundations of Computing Fall 2014 Lecture 27: Cardinality.
Week 7 - Wednesday.  What did we talk about last time?  Proving the subset relationship  Proving set equality  Set counterexamples  Laws of set algebra.
CompSci Today’s Topics Computer Science Noncomputability Upcoming Special Topic: Enabled by Computer -- Decoding the Human Genome Reading Great.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
Module 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex 1.
The Acceptance Problem for TMs
CS 461 – Nov. 2 Sets Prepare for ATM finite vs. infinite Infinite sets
Introduction to Computing Science and Programming I
1.5 Intractable problems.
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
CSE 105 theory of computation
CSCE 411 Design and Analysis of Algorithms
How Hard Can It Be?.
CSE 311 Foundations of Computing I
Discrete Math for CS CMPSC 360 LECTURE 43 Last time: Variance
CSE 311: Foundations of Computing
Formal Languages, Automata and Models of Computation
CS21 Decidability and Tractability
CSE 311: Foundations of Computing
State Machines and Infinity
CSE 105 theory of computation
Algorithms CSCI 235, Spring 2019 Lecture 37 The Halting Problem
Lecture 4: Unsolvable Problems
Intro to Theory of Computation
Presentation transcript:

04/25/13 Halting Problem Discrete Structures (CS 173) Derek Hoiem, University of Illinois 1

Final exam Tuesday, May 7, 7-10pm DCL 1320: Students with last names Afridi to Mehta Siebel 1404: Students with last names Melvin to Zmick Tell me about any conflicts asap. Note there is no specific conflict exam --- most conflicts should be resolved by other classes unless due to 3 tests in one day. 2 Final exam study materials will be posted soon.

Today’s class: halting problem Review of basic concepts from Tuesday The halting problem Examples of infinitely varying patterns – Game of life – Penrose tilings 3

Previous lecture Some infinite sets are bigger than others A “countable” set is the same size (or smaller) than the natural numbers We can compare sizes of infinite sets using bijections or one-to-one functions Diagonalization is a useful technique for constructing a new element that is different than every element of a countably infinite set 4

Size of infinite sets 5 |Naturals| = |Integers| = |Odd Numbers| < |Reals| < |Powerset(Reals)| = |Powerset(Naturals)| Countably Infinite

Diagonalization 6

Uncomputability A computer program is just a string (finite series of characters), so the set of all programs is countable But the set of functions is uncountable (e.g., functions that map reals to reals) So there are more functions than programs – some functions cannot be computed by any program 7

Example: not all real numbers are computable 8

Halting problem: Is there a general purpose algorithm that can determine whether a program will terminate? Example: Suppose you have written a machine learning algorithm that has been running for days. Will it ever stop on its own? 9

Potential solutions to halting problem Run program for a really long time and see if it stops Analyze code to see if there are infinite loops Check if loop exit conditions become closer to being met over time 10

Halting problem is undecidable 11 Suppose we have a magic program that solves the halting function: p = a program i = the input Now we write this evil program: What happens if we call trouble(trouble)? Example source:

bool does_it_halt( char * program, char * input ) { if( some terribly clever test for halting ) { return TRUE; } else { return FALSE; } } bool evil_program( char * program ) { if( does_it_halt( program, program ) ) { while( 1 ) {} return FALSE; } else { return TRUE; } } What does evil_program(evil_program) do? 12 Example from: Halting problem is undecidable

Why the halting problem matters We often want to know if a program converges (halts), but not possible to provide one algorithm that answers this for all programs In practice, convergence can be proven in many cases First example of a decidability problem – Many other problems are shown to be undecidable by being reduced to halting problem 13

Halting behaviors Program halts Program loops but keeps repeating itself – Sometimes detectable, unless loop is really long Program continues changing without repetition – Hard to tell if it will stop or start repeating or keep changing forever 14

Example: is there a finite or repeating set of digits? 15

Another example: game of life Simple rules Any live cell with fewer than two live neighbours dies, as if caused by under-population. Any live cell with two or three live neighbours lives on to the next generation. Any live cell with more than three live neighbours dies, as if by overcrowding. Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction. Complex outputs Some programs halt, some loop repeatedly, some continually change 16

Historical significance of Conway’s Game of Life Proposed in answer to question of whether self-replicating machines are possible – artificial life – Invented in 1970 (on paper) Example of emergence and self-organization 17 Game of life online:

Aperiodic tilings Tiles that lead to periodic tilings Tiles that can create periodic or aperiodic tilings 18 Examples from ure-column/fcarc-penrose ure-column/fcarc-penrose

Is it possible to create tiles that always lead to aperiodic tilings? 19 Question asked by Hao Wang in 1961: First solved by his student Berger in 1963 with 20,000+ tiles

Is it possible to create tiles that always lead to aperiodic tilings? Penrose tilings 20 Examples from ure-column/fcarc-penrose ure-column/fcarc-penrose

Application: quasicrystals Eventually understood to be analogous to 3D Penrose tilings 21 Image from Ron Lifschitz More on this here:

Tuesday: Last class! How to find an object in a large image set very quickly – How Google Goggles works – See application of many concepts learned in class ICES forms 22