Foundations of Computer Science Lecture 27 Unsolvable Problems No - - PowerPoint PPT Presentation

foundations of computer science lecture 27 unsolvable
SMART_READER_LITE
LIVE PREVIEW

Foundations of Computer Science Lecture 27 Unsolvable Problems No - - PowerPoint PPT Presentation

Foundations of Computer Science Lecture 27 Unsolvable Problems No Automatic Program Verifier for Hello-World No Ultimate Debugger or Algorithm for PCP The Complexity Zoo Last Time: Turing Machines Intuitive notion of algorithm Turing Machine


slide-1
SLIDE 1

Foundations of Computer Science Lecture 27 Unsolvable Problems

No Automatic Program Verifier for Hello-World No Ultimate Debugger or Algorithm for PCP The Complexity Zoo

slide-2
SLIDE 2

Last Time: Turing Machines

Intuitive notion of algorithm

Turing Machine Solvable problem

Turing-decidable

1 2 3 4

L = {G | G is connected} G =

2; 1; 3; 4 # 1,2; 2,3; 1,3; 3,4

(G is the encoding of graph G as a string.)

Creator: Malik Magdon-Ismail Unsolvable Problems: 2 / 13 Today →

slide-3
SLIDE 3

Last Time: Turing Machines

Intuitive notion of algorithm

Turing Machine Solvable problem

Turing-decidable

1 2 3 4

L = {G | G is connected} G =

2; 1; 3; 4 # 1,2; 2,3; 1,3; 3,4

(G is the encoding of graph G as a string.)

M = Turing Machine that solves graph connectivity input: G, the encoding of a graph G.

Creator: Malik Magdon-Ismail Unsolvable Problems: 2 / 13 Today →

slide-4
SLIDE 4

Last Time: Turing Machines

Intuitive notion of algorithm

Turing Machine Solvable problem

Turing-decidable

1 2 3 4 1 2 3 4

L = {G | G is connected} G =

2; 1; 3; 4 # 1,2; 2,3; 1,3; 3,4

(G is the encoding of graph G as a string.)

M = Turing Machine that solves graph connectivity input: G, the encoding of a graph G.

1: Check that G is a valid encoding of a graph and mark the first vertex in G.

Creator: Malik Magdon-Ismail Unsolvable Problems: 2 / 13 Today →

slide-5
SLIDE 5

Last Time: Turing Machines

Intuitive notion of algorithm

Turing Machine Solvable problem

Turing-decidable

1 2 3 4 1 2 3 4 1 2 3 4

L = {G | G is connected} G =

2; 1; 3; 4 # 1,2; 2,3; 1,3; 3,4

(G is the encoding of graph G as a string.)

M = Turing Machine that solves graph connectivity input: G, the encoding of a graph G.

1: Check that G is a valid encoding of a graph and mark the first vertex in G. 2: repeat: Find an edge in G between a marked and an unmarked vertex.

Mark the unmarked node or goto step 3 if there is no such edge.

Creator: Malik Magdon-Ismail Unsolvable Problems: 2 / 13 Today →

slide-6
SLIDE 6

Last Time: Turing Machines

Intuitive notion of algorithm

Turing Machine Solvable problem

Turing-decidable

1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4

L = {G | G is connected} G =

2; 1; 3; 4 # 1,2; 2,3; 1,3; 3,4

(G is the encoding of graph G as a string.)

M = Turing Machine that solves graph connectivity input: G, the encoding of a graph G.

1: Check that G is a valid encoding of a graph and mark the first vertex in G. 2: repeat: Find an edge in G between a marked and an unmarked vertex.

Mark the unmarked node or goto step 3 if there is no such edge.

Creator: Malik Magdon-Ismail Unsolvable Problems: 2 / 13 Today →

slide-7
SLIDE 7

Last Time: Turing Machines

Intuitive notion of algorithm

Turing Machine Solvable problem

Turing-decidable

1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4

L = {G | G is connected} G =

2; 1; 3; 4 # 1,2; 2,3; 1,3; 3,4

(G is the encoding of graph G as a string.)

M = Turing Machine that solves graph connectivity input: G, the encoding of a graph G.

1: Check that G is a valid encoding of a graph and mark the first vertex in G. 2: repeat: Find an edge in G between a marked and an unmarked vertex.

Mark the unmarked node or goto step 3 if there is no such edge.

Creator: Malik Magdon-Ismail Unsolvable Problems: 2 / 13 Today →

slide-8
SLIDE 8

Last Time: Turing Machines

Intuitive notion of algorithm

Turing Machine Solvable problem

Turing-decidable

1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4

L = {G | G is connected} G =

2; 1; 3; 4 # 1,2; 2,3; 1,3; 3,4

(G is the encoding of graph G as a string.)

M = Turing Machine that solves graph connectivity input: G, the encoding of a graph G.

1: Check that G is a valid encoding of a graph and mark the first vertex in G. 2: repeat: Find an edge in G between a marked and an unmarked vertex.

Mark the unmarked node or goto step 3 if there is no such edge.

Creator: Malik Magdon-Ismail Unsolvable Problems: 2 / 13 Today →

slide-9
SLIDE 9

Last Time: Turing Machines

Intuitive notion of algorithm

Turing Machine Solvable problem

Turing-decidable

1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4

L = {G | G is connected} G =

2; 1; 3; 4 # 1,2; 2,3; 1,3; 3,4

(G is the encoding of graph G as a string.)

M = Turing Machine that solves graph connectivity input: G, the encoding of a graph G.

1: Check that G is a valid encoding of a graph and mark the first vertex in G. 2: repeat: Find an edge in G between a marked and an unmarked vertex.

Mark the unmarked node or goto step 3 if there is no such edge.

3: reject if there is an unmarked vertex remaining in G; otherwise accept.

To tell your friend on the other coast about this fancy Turing Machine M, encode its description into the bit-string M and send over the telegraph. You want to solve a different problem? Build another Turing Machine!

Creator: Malik Magdon-Ismail Unsolvable Problems: 2 / 13 Today →

slide-10
SLIDE 10

Today: Unsolvable Problems

1

Programmable Turing Machines.

2

Examples of unsolvable problems.

Post’s Correspondence Problem (PCP)? HalfSum? Auto-Grade? Ultimate-Debugger?

3

Ltm: The language recognized by a Universal Turing Machine.

Ltm is undecidable – cannot be solved!

4

Auto-Grade and Ultimate-Debugger do not exist.

5

What about HalfSum?

Creator: Malik Magdon-Ismail Unsolvable Problems: 3 / 13 Programmable Turing Machine →

slide-11
SLIDE 11

Programmable Turing Machine: Universal Turing Machine

A Turing Machine M has a binary encoding M. Its input w is a binary string.

Creator: Malik Magdon-Ismail Unsolvable Problems: 4 / 13 PCP and HalfSum →

slide-12
SLIDE 12

Programmable Turing Machine: Universal Turing Machine

A Turing Machine M has a binary encoding M. Its input w is a binary string.

M#w can be the input to another Turing Machine Utm. Utm(M#w) =

                    

halt with accept if M(w) = halt with accept; halt with reject if M(w) = halt with reject; loop forever if M(w) = loop forever;

Utm outputs on M#w whatever M outputs on w. Utm simulates M

Creator: Malik Magdon-Ismail Unsolvable Problems: 4 / 13 PCP and HalfSum →

slide-13
SLIDE 13

Programmable Turing Machine: Universal Turing Machine

A Turing Machine M has a binary encoding M. Its input w is a binary string.

M#w can be the input to another Turing Machine Utm. Utm(M#w)

computer

=

                    

halt with accept if M(w) = halt with accept; halt with reject if M(w) = halt with reject; loop forever if M(w) = loop forever;

Utm outputs on M#w whatever M outputs on w. Utm simulates M

Creator: Malik Magdon-Ismail Unsolvable Problems: 4 / 13 PCP and HalfSum →

slide-14
SLIDE 14

Programmable Turing Machine: Universal Turing Machine

A Turing Machine M has a binary encoding M. Its input w is a binary string.

M#w can be the input to another Turing Machine Utm. Utm(M#w)

computer program

=

                    

halt with accept if M(w) = halt with accept; halt with reject if M(w) = halt with reject; loop forever if M(w) = loop forever;

Utm outputs on M#w whatever M outputs on w. Utm simulates M

Creator: Malik Magdon-Ismail Unsolvable Problems: 4 / 13 PCP and HalfSum →

slide-15
SLIDE 15

Programmable Turing Machine: Universal Turing Machine

A Turing Machine M has a binary encoding M. Its input w is a binary string.

M#w can be the input to another Turing Machine Utm. Utm(M#w)

computer program program input

=

                    

halt with accept if M(w) = halt with accept; halt with reject if M(w) = halt with reject; loop forever if M(w) = loop forever;

Utm outputs on M#w whatever M outputs on w. Utm simulates M

Creator: Malik Magdon-Ismail Unsolvable Problems: 4 / 13 PCP and HalfSum →

slide-16
SLIDE 16

Programmable Turing Machine: Universal Turing Machine

A Turing Machine M has a binary encoding M. Its input w is a binary string.

M#w can be the input to another Turing Machine Utm. Utm(M#w)

computer program program input

=

                    

halt with accept if M(w) = halt with accept; halt with reject if M(w) = halt with reject; loop forever if M(w) = loop forever;

Utm outputs on M#w whatever M outputs on w. Utm simulates M

Challenge: Utm is fixed but can simulate any M, even one with a million states.

Creator: Malik Magdon-Ismail Unsolvable Problems: 4 / 13 PCP and HalfSum →

slide-17
SLIDE 17

Programmable Turing Machine: Universal Turing Machine

A Turing Machine M has a binary encoding M. Its input w is a binary string.

M#w can be the input to another Turing Machine Utm. Utm(M#w)

computer program program input

=

                    

halt with accept if M(w) = halt with accept; halt with reject if M(w) = halt with reject; loop forever if M(w) = loop forever;

Utm outputs on M#w whatever M outputs on w. Utm simulates M

Challenge: Utm is fixed but can simulate any M, even one with a million states.

*

w states instructions M #

1 1 ␣ ␣

Entire simulation is done on the tape.

Creator: Malik Magdon-Ismail Unsolvable Problems: 4 / 13 PCP and HalfSum →

slide-18
SLIDE 18

Programmable Turing Machine: Universal Turing Machine

A Turing Machine M has a binary encoding M. Its input w is a binary string.

M#w can be the input to another Turing Machine Utm. Utm(M#w)

computer program program input

=

                    

halt with accept if M(w) = halt with accept; halt with reject if M(w) = halt with reject; loop forever if M(w) = loop forever;

Utm outputs on M#w whatever M outputs on w. Utm simulates M

Challenge: Utm is fixed but can simulate any M, even one with a million states.

*

w states instructions M #

1 1 ␣ ␣

mark M’s R-W head

Entire simulation is done on the tape.

Creator: Malik Magdon-Ismail Unsolvable Problems: 4 / 13 PCP and HalfSum →

slide-19
SLIDE 19

Programmable Turing Machine: Universal Turing Machine

A Turing Machine M has a binary encoding M. Its input w is a binary string.

M#w can be the input to another Turing Machine Utm. Utm(M#w)

computer program program input

=

                    

halt with accept if M(w) = halt with accept; halt with reject if M(w) = halt with reject; loop forever if M(w) = loop forever;

Utm outputs on M#w whatever M outputs on w. Utm simulates M

Challenge: Utm is fixed but can simulate any M, even one with a million states.

*

w states instructions M #

1 1 ␣ ␣

mark M’s R-W head mark M’s state

Entire simulation is done on the tape.

Creator: Malik Magdon-Ismail Unsolvable Problems: 4 / 13 PCP and HalfSum →

slide-20
SLIDE 20

Programmable Turing Machine: Universal Turing Machine

A Turing Machine M has a binary encoding M. Its input w is a binary string.

M#w can be the input to another Turing Machine Utm. Utm(M#w)

computer program program input

=

                    

halt with accept if M(w) = halt with accept; halt with reject if M(w) = halt with reject; loop forever if M(w) = loop forever;

Utm outputs on M#w whatever M outputs on w. Utm simulates M

Challenge: Utm is fixed but can simulate any M, even one with a million states.

*

w states instructions M #

1 1 ␣ ␣

mark M’s R-W head mark M’s state mark M’s instruction

Entire simulation is done on the tape.

Creator: Malik Magdon-Ismail Unsolvable Problems: 4 / 13 PCP and HalfSum →

slide-21
SLIDE 21

Programmable Turing Machine: Universal Turing Machine

A Turing Machine M has a binary encoding M. Its input w is a binary string.

M#w can be the input to another Turing Machine Utm. Utm(M#w)

computer program program input

=

                    

halt with accept if M(w) = halt with accept; halt with reject if M(w) = halt with reject; loop forever if M(w) = loop forever;

Utm outputs on M#w whatever M outputs on w. Utm simulates M

Challenge: Utm is fixed but can simulate any M, even one with a million states.

*

w states instructions M #

1 1 ␣ ␣

Utm

mark M’s R-W head mark M’s state mark M’s instruction

Entire simulation is done on the tape.

Creator: Malik Magdon-Ismail Unsolvable Problems: 4 / 13 PCP and HalfSum →

slide-22
SLIDE 22

Post’s Correspondence Problem (PCP) and HalfSum

PCP: Consider 3 dominos:

d1 d2 d3 100 01 00 110 11

Creator: Malik Magdon-Ismail Unsolvable Problems: 5 / 13 Auto-Grade →

slide-23
SLIDE 23

Post’s Correspondence Problem (PCP) and HalfSum

PCP: Consider 3 dominos:

d1 d2 d3 100 01 00 110 11

d3d2d3d1 =

110 11 01 00 110 11 100

=

110011100 110011100

← Top and bottom strings match. That’s the goal.

Creator: Malik Magdon-Ismail Unsolvable Problems: 5 / 13 Auto-Grade →

slide-24
SLIDE 24

Post’s Correspondence Problem (PCP) and HalfSum

PCP: Consider 3 dominos:

d1 d2 d3 100 01 00 110 11

d3d2d3d1 =

110 11 01 00 110 11 100

=

110011100 110011100

← Top and bottom strings match. That’s the goal.

input: Dominos {d1, d2, . . . , dn}. For example

      

10 101 , 011 11 , 101 011

      .

task: Can one line up finitely many dominos so that the top and bottom strings match?

Creator: Malik Magdon-Ismail Unsolvable Problems: 5 / 13 Auto-Grade →

slide-25
SLIDE 25

Post’s Correspondence Problem (PCP) and HalfSum

PCP: Consider 3 dominos:

d1 d2 d3 100 01 00 110 11

d3d2d3d1 =

110 11 01 00 110 11 100

=

110011100 110011100

← Top and bottom strings match. That’s the goal.

input: Dominos {d1, d2, . . . , dn}. For example

      

10 101 , 011 11 , 101 011

      .

task: Can one line up finitely many dominos so that the top and bottom strings match? HalfSum: Consider the multiset S = {1, 1, 1, 3, 4, 4, 5, 6, 9}, and subset A = {1, 3, 4, 9}. sum(A) = 17 = 1

2 × sum(S).

Creator: Malik Magdon-Ismail Unsolvable Problems: 5 / 13 Auto-Grade →

slide-26
SLIDE 26

Post’s Correspondence Problem (PCP) and HalfSum

PCP: Consider 3 dominos:

d1 d2 d3 100 01 00 110 11

d3d2d3d1 =

110 11 01 00 110 11 100

=

110011100 110011100

← Top and bottom strings match. That’s the goal.

input: Dominos {d1, d2, . . . , dn}. For example

      

10 101 , 011 11 , 101 011

      .

task: Can one line up finitely many dominos so that the top and bottom strings match? HalfSum: Consider the multiset S = {1, 1, 1, 3, 4, 4, 5, 6, 9}, and subset A = {1, 3, 4, 9}. sum(A) = 17 = 1

2 × sum(S).

input: Multiset S = {x1, x2, . . . , xn}. For example, S = {1, 1, 1, 3, 4, 4, 5, 6, 9}. task: Is there a subset whose sum is 1

2 × sum(S) = 1 2 × (x1 + x2 + · · · + xn)?

Creator: Malik Magdon-Ismail Unsolvable Problems: 5 / 13 Auto-Grade →

slide-27
SLIDE 27

Auto-Grade

Your first CS assignment: Write a program to print “Hello World!” and halt. CS1: 700+ submissions! Naturally, we do not grade these by hand. Auto-Grade: runs each submission and determines if its correct.

←program verification

Creator: Malik Magdon-Ismail Unsolvable Problems: 6 / 13 Ultimate-Debugger →

slide-28
SLIDE 28

Auto-Grade

Your first CS assignment: Write a program to print “Hello World!” and halt. CS1: 700+ submissions! Naturally, we do not grade these by hand. Auto-Grade: runs each submission and determines if its correct.

←program verification

What does Auto-Grade say for this program:

n = 4;

while(n > 0){ if(n is not a sum of two primes){ print("Hello World!") and exit; }

n ← n + 2;

}

Creator: Malik Magdon-Ismail Unsolvable Problems: 6 / 13 Ultimate-Debugger →

slide-29
SLIDE 29

Ultimate-Debugger

Wouldn’t it be nice to have the Ultimate-Debugger.

← solves the Halting Problem

Halts

           

n = 4; while(n > 0){ if(n is not a sum of two primes){ print("Hello World!") and exit; } n ← n + 2; }

           

=

            

yes

if program halts

no

if program infinitely loops

Creator: Malik Magdon-Ismail Unsolvable Problems: 7 / 13 Ltm →

slide-30
SLIDE 30

Ultimate-Debugger

Wouldn’t it be nice to have the Ultimate-Debugger.

← solves the Halting Problem

Halts

           

n = 4; while(n > 0){ if(n is not a sum of two primes){ print("Hello World!") and exit; } n ← n + 2; }

           

=

            

yes

if program halts

no

if program infinitely loops We can grade the students program correctly. We can solve Goldbach’s conjecture. Just think what you could do with Ultimate-Debugger.

◮ No more infinite looping programs. Creator: Malik Magdon-Ismail Unsolvable Problems: 7 / 13 Ltm →

slide-31
SLIDE 31

Verification: Does A Program Successfully Terminate?

Creator: Malik Magdon-Ismail Unsolvable Problems: 8 / 13 Ltm is Undecidable →

slide-32
SLIDE 32

Verification: Does A Program Successfully Terminate?

Ltm = {M#w | M is a Turing Machine and M accepts w}.

Creator: Malik Magdon-Ismail Unsolvable Problems: 8 / 13 Ltm is Undecidable →

slide-33
SLIDE 33

Verification: Does A Program Successfully Terminate?

Ltm = {M#w | M is a Turing Machine and M accepts w}. Utm is a recognizer for Ltm.

Creator: Malik Magdon-Ismail Unsolvable Problems: 8 / 13 Ltm is Undecidable →

slide-34
SLIDE 34

Verification: Does A Program Successfully Terminate?

Ltm = {M#w | M is a Turing Machine and M accepts w}. Utm is a recognizer for Ltm.

Is there a Turing Machine Atm which decides Ltm? A decider must always halt with an answer.

Utm may loop forever if M loops forever on w.

Creator: Malik Magdon-Ismail Unsolvable Problems: 8 / 13 Ltm is Undecidable →

slide-35
SLIDE 35

Verification: Does A Program Successfully Terminate?

Ltm = {M#w | M is a Turing Machine and M accepts w}. Utm is a recognizer for Ltm.

Is there a Turing Machine Atm which decides Ltm? A decider must always halt with an answer.

Utm may loop forever if M loops forever on w.

Question: What do these mean: M(M) and Atm(M#M) ?

Creator: Malik Magdon-Ismail Unsolvable Problems: 8 / 13 Ltm is Undecidable →

slide-36
SLIDE 36

Verification: Does A Program Successfully Terminate?

Ltm = {M#w | M is a Turing Machine and M accepts w}. Utm is a recognizer for Ltm.

Is there a Turing Machine Atm which decides Ltm? A decider must always halt with an answer.

Utm may loop forever if M loops forever on w.

Question: What do these mean: M(M) and Atm(M#M) ? A diabolical Turing Machine D built from Atm:

D = “Diagonal” Turing Machine derived from Atm (the decider for Ltm) input: M where M is a Turing Machine.

slide-37
SLIDE 37

Verification: Does A Program Successfully Terminate?

Ltm = {M#w | M is a Turing Machine and M accepts w}. Utm is a recognizer for Ltm.

Is there a Turing Machine Atm which decides Ltm? A decider must always halt with an answer.

Utm may loop forever if M loops forever on w.

Question: What do these mean: M(M) and Atm(M#M) ? A diabolical Turing Machine D built from Atm:

D = “Diagonal” Turing Machine derived from Atm (the decider for Ltm) input: M where M is a Turing Machine.

1: Run Atm with input M#M.

D does the opposite of Atm. Is D a decider?

slide-38
SLIDE 38

Verification: Does A Program Successfully Terminate?

Ltm = {M#w | M is a Turing Machine and M accepts w}. Utm is a recognizer for Ltm.

Is there a Turing Machine Atm which decides Ltm? A decider must always halt with an answer.

Utm may loop forever if M loops forever on w.

Question: What do these mean: M(M) and Atm(M#M) ? A diabolical Turing Machine D built from Atm:

D = “Diagonal” Turing Machine derived from Atm (the decider for Ltm) input: M where M is a Turing Machine.

1: Run Atm with input M#M. 2: If Atm accepts then reject; otherwise (Atm rejects) accept

D does the opposite of Atm. Is D a decider?

Creator: Malik Magdon-Ismail Unsolvable Problems: 8 / 13 Ltm is Undecidable →

slide-39
SLIDE 39
  • Theorem. Atm does not exist (Ltm Cannot be Solved)

Atm exists → D exists. D exists means it will appear on the list of all Turing Machines, M1, M2, M3, M4, D, . . .

Creator: Malik Magdon-Ismail Unsolvable Problems: 9 / 13 Ultimate-Debugger and Auto-Grade →

slide-40
SLIDE 40
  • Theorem. Atm does not exist (Ltm Cannot be Solved)

Atm exists → D exists. D exists means it will appear on the list of all Turing Machines, M1, M2, M3, M4, D, . . .

Consider what happens when Mi runs on Mj, that is Atm(Mi#Mj).

Atm(Mi#Mj) M1 M2 M3 M4 D · · · M1 M2 M3 M4 D

. . .

Creator: Malik Magdon-Ismail Unsolvable Problems: 9 / 13 Ultimate-Debugger and Auto-Grade →

slide-41
SLIDE 41
  • Theorem. Atm does not exist (Ltm Cannot be Solved)

Atm exists → D exists. D exists means it will appear on the list of all Turing Machines, M1, M2, M3, M4, D, . . .

Consider what happens when Mi runs on Mj, that is Atm(Mi#Mj).

Atm(Mi#Mj) M1 M2 M3 M4 D · · · M1

accept accept reject accept accept

· · · M2 M3 M4 D

. . .

Creator: Malik Magdon-Ismail Unsolvable Problems: 9 / 13 Ultimate-Debugger and Auto-Grade →

slide-42
SLIDE 42
  • Theorem. Atm does not exist (Ltm Cannot be Solved)

Atm exists → D exists. D exists means it will appear on the list of all Turing Machines, M1, M2, M3, M4, D, . . .

Consider what happens when Mi runs on Mj, that is Atm(Mi#Mj).

Atm(Mi#Mj) M1 M2 M3 M4 D · · · M1

accept accept reject accept accept

· · · M2 M3 M4 D

reject . . .

D(Mi) does the opposite of Atm(Mi#Mi).

Creator: Malik Magdon-Ismail Unsolvable Problems: 9 / 13 Ultimate-Debugger and Auto-Grade →

slide-43
SLIDE 43
  • Theorem. Atm does not exist (Ltm Cannot be Solved)

Atm exists → D exists. D exists means it will appear on the list of all Turing Machines, M1, M2, M3, M4, D, . . .

Consider what happens when Mi runs on Mj, that is Atm(Mi#Mj).

Atm(Mi#Mj) M1 M2 M3 M4 D · · · M1

accept accept reject accept accept

· · · M2

reject reject reject accept accept

· · · M3 M4 D

reject . . .

D(Mi) does the opposite of Atm(Mi#Mi).

Creator: Malik Magdon-Ismail Unsolvable Problems: 9 / 13 Ultimate-Debugger and Auto-Grade →

slide-44
SLIDE 44
  • Theorem. Atm does not exist (Ltm Cannot be Solved)

Atm exists → D exists. D exists means it will appear on the list of all Turing Machines, M1, M2, M3, M4, D, . . .

Consider what happens when Mi runs on Mj, that is Atm(Mi#Mj).

Atm(Mi#Mj) M1 M2 M3 M4 D · · · M1

accept accept reject accept accept

· · · M2

reject reject reject accept accept

· · · M3 M4 D

reject accept . . .

D(Mi) does the opposite of Atm(Mi#Mi).

Creator: Malik Magdon-Ismail Unsolvable Problems: 9 / 13 Ultimate-Debugger and Auto-Grade →

slide-45
SLIDE 45
  • Theorem. Atm does not exist (Ltm Cannot be Solved)

Atm exists → D exists. D exists means it will appear on the list of all Turing Machines, M1, M2, M3, M4, D, . . .

Consider what happens when Mi runs on Mj, that is Atm(Mi#Mj).

Atm(Mi#Mj) M1 M2 M3 M4 D · · · M1

accept accept reject accept accept

· · · M2

reject reject reject accept accept

· · · M3

accept accept reject reject accept

· · · M4 D

reject accept . . .

D(Mi) does the opposite of Atm(Mi#Mi).

Creator: Malik Magdon-Ismail Unsolvable Problems: 9 / 13 Ultimate-Debugger and Auto-Grade →

slide-46
SLIDE 46
  • Theorem. Atm does not exist (Ltm Cannot be Solved)

Atm exists → D exists. D exists means it will appear on the list of all Turing Machines, M1, M2, M3, M4, D, . . .

Consider what happens when Mi runs on Mj, that is Atm(Mi#Mj).

Atm(Mi#Mj) M1 M2 M3 M4 D · · · M1

accept accept reject accept accept

· · · M2

reject reject reject accept accept

· · · M3

accept accept reject reject accept

· · · M4 D

reject accept accept . . .

D(Mi) does the opposite of Atm(Mi#Mi).

Creator: Malik Magdon-Ismail Unsolvable Problems: 9 / 13 Ultimate-Debugger and Auto-Grade →

slide-47
SLIDE 47
  • Theorem. Atm does not exist (Ltm Cannot be Solved)

Atm exists → D exists. D exists means it will appear on the list of all Turing Machines, M1, M2, M3, M4, D, . . .

Consider what happens when Mi runs on Mj, that is Atm(Mi#Mj).

Atm(Mi#Mj) M1 M2 M3 M4 D · · · M1

accept accept reject accept accept

· · · M2

reject reject reject accept accept

· · · M3

accept accept reject reject accept

· · · M4

accept reject reject reject accept

· · · D

reject accept accept . . .

D(Mi) does the opposite of Atm(Mi#Mi).

Creator: Malik Magdon-Ismail Unsolvable Problems: 9 / 13 Ultimate-Debugger and Auto-Grade →

slide-48
SLIDE 48
  • Theorem. Atm does not exist (Ltm Cannot be Solved)

Atm exists → D exists. D exists means it will appear on the list of all Turing Machines, M1, M2, M3, M4, D, . . .

Consider what happens when Mi runs on Mj, that is Atm(Mi#Mj).

Atm(Mi#Mj) M1 M2 M3 M4 D · · · M1

accept accept reject accept accept

· · · M2

reject reject reject accept accept

· · · M3

accept accept reject reject accept

· · · M4

accept reject reject reject accept

· · · D

reject accept accept accept . . .

D(Mi) does the opposite of Atm(Mi#Mi).

Creator: Malik Magdon-Ismail Unsolvable Problems: 9 / 13 Ultimate-Debugger and Auto-Grade →

slide-49
SLIDE 49
  • Theorem. Atm does not exist (Ltm Cannot be Solved)

Atm exists → D exists. D exists means it will appear on the list of all Turing Machines, M1, M2, M3, M4, D, . . .

Consider what happens when Mi runs on Mj, that is Atm(Mi#Mj).

Atm(Mi#Mj) M1 M2 M3 M4 D · · · M1

accept accept reject accept accept

· · · M2

reject reject reject accept accept

· · · M3

accept accept reject reject accept

· · · M4

accept reject reject reject accept

· · · D

reject accept accept accept accept? · · · . . . . . . . . . . . . . . . . . . ...

D(Mi) does the opposite of Atm(Mi#Mi).

Creator: Malik Magdon-Ismail Unsolvable Problems: 9 / 13 Ultimate-Debugger and Auto-Grade →

slide-50
SLIDE 50
  • Theorem. Atm does not exist (Ltm Cannot be Solved)

Atm exists → D exists. D exists means it will appear on the list of all Turing Machines, M1, M2, M3, M4, D, . . .

Consider what happens when Mi runs on Mj, that is Atm(Mi#Mj).

Atm(Mi#Mj) M1 M2 M3 M4 D · · · M1

accept accept reject accept accept

· · · M2

reject reject reject accept accept

· · · M3

accept accept reject reject accept

· · · M4

accept reject reject reject accept

· · · D

reject accept accept accept reject? · · · . . . . . . . . . . . . . . . . . . ...

D(Mi) does the opposite of Atm(Mi#Mi).

Creator: Malik Magdon-Ismail Unsolvable Problems: 9 / 13 Ultimate-Debugger and Auto-Grade →

slide-51
SLIDE 51
  • Theorem. Atm does not exist (Ltm Cannot be Solved)

Atm exists → D exists. D exists means it will appear on the list of all Turing Machines, M1, M2, M3, M4, D, . . .

Consider what happens when Mi runs on Mj, that is Atm(Mi#Mj).

Atm(Mi#Mj) M1 M2 M3 M4 D · · · M1

accept accept reject accept accept

· · · M2

reject reject reject accept accept

· · · M3

accept accept reject reject accept

· · · M4

accept reject reject reject accept

· · · D

reject accept accept accept accept? · · · . . . . . . . . . . . . . . . . . . ...

D(Mi) does the opposite of Atm(Mi#Mi).

Creator: Malik Magdon-Ismail Unsolvable Problems: 9 / 13 Ultimate-Debugger and Auto-Grade →

slide-52
SLIDE 52

Ultimate-Debugger and Auto-Grade Don’t Exist

No general program/algorithm to analyze any other program M and tell if M will accept or not a particular input.

Creator: Malik Magdon-Ismail Unsolvable Problems: 10 / 13 The Computing Landscape →

slide-53
SLIDE 53

Ultimate-Debugger and Auto-Grade Don’t Exist

No general program/algorithm to analyze any other program M and tell if M will accept or not a particular input. No Ultimate-Debugger to analyze

  • ther programs and tell if they halt.

Suppose Ultimate-Debugger Htm exists and decides if any other program halts. We can use Htm to construct a solver Atm for Ltm.

Creator: Malik Magdon-Ismail Unsolvable Problems: 10 / 13 The Computing Landscape →

slide-54
SLIDE 54

Ultimate-Debugger and Auto-Grade Don’t Exist

No general program/algorithm to analyze any other program M and tell if M will accept or not a particular input. No Ultimate-Debugger to analyze

  • ther programs and tell if they halt.

Suppose Ultimate-Debugger Htm exists and decides if any other program halts. We can use Htm to construct a solver Atm for Ltm.

Atm = Turing Machine derived from Htm (the decider for Lhalt) input: M#w where M is a Turing Machine and w an input to M.

Creator: Malik Magdon-Ismail Unsolvable Problems: 10 / 13 The Computing Landscape →

slide-55
SLIDE 55

Ultimate-Debugger and Auto-Grade Don’t Exist

No general program/algorithm to analyze any other program M and tell if M will accept or not a particular input. No Ultimate-Debugger to analyze

  • ther programs and tell if they halt.

Suppose Ultimate-Debugger Htm exists and decides if any other program halts. We can use Htm to construct a solver Atm for Ltm.

Atm = Turing Machine derived from Htm (the decider for Lhalt) input: M#w where M is a Turing Machine and w an input to M.

1: Run Htm on input M#w. If Htm rejects, then reject. 2: Run Utm on input M#w and output the decision Utm gives.

Creator: Malik Magdon-Ismail Unsolvable Problems: 10 / 13 The Computing Landscape →

slide-56
SLIDE 56

Ultimate-Debugger and Auto-Grade Don’t Exist

No general program/algorithm to analyze any other program M and tell if M will accept or not a particular input. No Ultimate-Debugger to analyze

  • ther programs and tell if they halt.

No Auto-Grade for CS-1 programs.

Suppose Ultimate-Debugger Htm exists and decides if any other program halts. We can use Htm to construct a solver Atm for Ltm.

Atm = Turing Machine derived from Htm (the decider for Lhalt) input: M#w where M is a Turing Machine and w an input to M.

1: Run Htm on input M#w. If Htm rejects, then reject. 2: Run Utm on input M#w and output the decision Utm gives.

  • Exercise. Show that Auto-Grade does not exist.
  • Exercise. Show that HalfSum is solvable by giving a decider.

Creator: Malik Magdon-Ismail Unsolvable Problems: 10 / 13 The Computing Landscape →

slide-57
SLIDE 57

Ultimate-Debugger and Auto-Grade Don’t Exist

No general program/algorithm to analyze any other program M and tell if M will accept or not a particular input. No Ultimate-Debugger to analyze

  • ther programs and tell if they halt.

No Auto-Grade for CS-1 programs. No solver for PCP.

Suppose Ultimate-Debugger Htm exists and decides if any other program halts. We can use Htm to construct a solver Atm for Ltm.

Atm = Turing Machine derived from Htm (the decider for Lhalt) input: M#w where M is a Turing Machine and w an input to M.

1: Run Htm on input M#w. If Htm rejects, then reject. 2: Run Utm on input M#w and output the decision Utm gives.

  • Exercise. Show that Auto-Grade does not exist.
  • Exercise. Show that HalfSum is solvable by giving a decider.

Creator: Malik Magdon-Ismail Unsolvable Problems: 10 / 13 The Computing Landscape →

slide-58
SLIDE 58

The Landscape

DFA

(no external memory)

(regular expressions) {∗01∗}, {0•3n+1}

Creator: Malik Magdon-Ismail Unsolvable Problems: 11 / 13 The Path Forward →

slide-59
SLIDE 59

The Landscape

DFA

(no external memory)

(regular expressions) {∗01∗}, {0•3n+1} CFG

(stack)

{0•n1•n}, {wwr}

Creator: Malik Magdon-Ismail Unsolvable Problems: 11 / 13 The Path Forward →

slide-60
SLIDE 60

The Landscape

DFA

(no external memory)

(regular expressions) {∗01∗}, {0•3n+1} CFG

(stack)

{0•n1•n}, {wwr} TM-Decider

(RAM)

{ww}, {02n}, {0•n1•n0•n}

HalfSum Creator: Malik Magdon-Ismail Unsolvable Problems: 11 / 13 The Path Forward →

slide-61
SLIDE 61

The Landscape

DFA

(no external memory)

(regular expressions) {∗01∗}, {0•3n+1} CFG

(stack)

{0•n1•n}, {wwr} TM-Decider

(RAM)

{ww}, {02n}, {0•n1•n0•n}

HalfSum

TM-Recognizer Ltm

Ultimate-Debugger Auto-Grade PCP Creator: Malik Magdon-Ismail Unsolvable Problems: 11 / 13 The Path Forward →

slide-62
SLIDE 62

The Landscape

DFA

(no external memory)

(regular expressions) {∗01∗}, {0•3n+1} CFG

(stack)

{0•n1•n}, {wwr} TM-Decider

(RAM)

{ww}, {02n}, {0•n1•n0•n}

HalfSum

TM-Recognizer Ltm

Ultimate-Debugger Auto-Grade PCP

Non-Recognizable Ltm, Lhalt most languages

Creator: Malik Magdon-Ismail Unsolvable Problems: 11 / 13 The Path Forward →

slide-63
SLIDE 63

The Path Forward: Focus on Decidable Problems

FOCS

Creator: Malik Magdon-Ismail Unsolvable Problems: 12 / 13 Epic Disasters →

slide-64
SLIDE 64

The Path Forward: Focus on Decidable Problems

FOCS

Theory of Computing Discrete Math

Creator: Malik Magdon-Ismail Unsolvable Problems: 12 / 13 Epic Disasters →

slide-65
SLIDE 65

The Path Forward: Focus on Decidable Problems

FOCS

Theory of Computing Discrete Math

Decider Utm = computer TM = Algorithm CFG Parsing DFA RegExp Creator: Malik Magdon-Ismail Unsolvable Problems: 12 / 13 Epic Disasters →

slide-66
SLIDE 66

The Path Forward: Focus on Decidable Problems

FOCS

Theory of Computing Discrete Math

Decider Utm = computer TM = Algorithm CFG Parsing DFA RegExp Proof, logic INDUCTION Recursion

  • Struct. Induction

Sums, Asymptotics Number theory Graphs Counting Probability Creator: Malik Magdon-Ismail Unsolvable Problems: 12 / 13 Epic Disasters →

slide-67
SLIDE 67

The Path Forward: Focus on Decidable Problems

FOCS

Theory of Computing Discrete Math

Decider Utm = computer TM = Algorithm CFG Parsing DFA RegExp Proof, logic INDUCTION Recursion

  • Struct. Induction

Sums, Asymptotics Number theory Graphs Counting Probability Multivariate Calc. Linear Algebra Probability Theory Graph theory Creator: Malik Magdon-Ismail Unsolvable Problems: 12 / 13 Epic Disasters →

slide-68
SLIDE 68

The Path Forward: Focus on Decidable Problems

FOCS

Theory of Computing Discrete Math

Decider Utm = computer TM = Algorithm CFG Parsing DFA RegExp Proof, logic INDUCTION Recursion

  • Struct. Induction

Sums, Asymptotics Number theory Graphs Counting Probability Multivariate Calc. Linear Algebra Probability Theory Graph theory FAST (P) Polynomial FAST (NP) Unbounded Parallelism SLOW Exponential Boolean Circuits efficiency

P = NP?

Chapters 28 & 29

Creator: Malik Magdon-Ismail Unsolvable Problems: 12 / 13 Epic Disasters →

slide-69
SLIDE 69

The Path Forward: Focus on Decidable Problems

FOCS

Theory of Computing Discrete Math

Decider Utm = computer TM = Algorithm CFG Parsing DFA RegExp Proof, logic INDUCTION Recursion

  • Struct. Induction

Sums, Asymptotics Number theory Graphs Counting Probability Multivariate Calc. Linear Algebra Probability Theory Graph theory FAST (P) Polynomial FAST (NP) Unbounded Parallelism SLOW Exponential Boolean Circuits efficiency

P = NP?

Chapters 28 & 29

Introduction to Algorithms Computability&Complexity Creator: Malik Magdon-Ismail Unsolvable Problems: 12 / 13 Epic Disasters →

slide-70
SLIDE 70

The Path Forward: Focus on Decidable Problems

FOCS

Theory of Computing Discrete Math

Decider Utm = computer TM = Algorithm CFG Parsing DFA RegExp Proof, logic INDUCTION Recursion

  • Struct. Induction

Sums, Asymptotics Number theory Graphs Counting Probability Multivariate Calc. Linear Algebra Probability Theory Graph theory FAST (P) Polynomial FAST (NP) Unbounded Parallelism SLOW Exponential Boolean Circuits efficiency

P = NP?

Chapters 28 & 29

Introduction to Algorithms Computability&Complexity Algorithms & DS – Approximation – Randomized – Distributed Cryptography Data – ML/AI/DM/NLP – Vision – Graphics – Comp. Finance Networks – Computers – Social – Data (e.g. www) Robotics Security Programming Languages – Compilers – Distributed Program Analysis – Testing – Verification

Theory Algorithms AI

Creator: Malik Magdon-Ismail Unsolvable Problems: 12 / 13 Epic Disasters →

slide-71
SLIDE 71

The Path Forward: Focus on Decidable Problems

FOCS

Theory of Computing Discrete Math

Decider Utm = computer TM = Algorithm CFG Parsing DFA RegExp Proof, logic INDUCTION Recursion

  • Struct. Induction

Sums, Asymptotics Number theory Graphs Counting Probability Multivariate Calc. Linear Algebra Probability Theory Graph theory FAST (P) Polynomial FAST (NP) Unbounded Parallelism SLOW Exponential Boolean Circuits efficiency

P = NP?

Chapters 28 & 29

Introduction to Algorithms Computer Organization Principles

  • f

Software Computability&Complexity Algorithms & DS – Approximation – Randomized – Distributed Cryptography Data – ML/AI/DM/NLP – Vision – Graphics – Comp. Finance Networks – Computers – Social – Data (e.g. www) Robotics Security Programming Languages – Compilers – Distributed Program Analysis – Testing – Verification DB Systems Parallel computing Operating systems Architecture

Theory Algorithms AI Software Systems

Creator: Malik Magdon-Ismail Unsolvable Problems: 12 / 13 Epic Disasters →

slide-72
SLIDE 72

. . . the high technology so celebrated today is essentially a mathematical technology.

“To err is human, but to really foul things up you need a computer.” – Paul Ehrlich

Creator: Malik Magdon-Ismail Unsolvable Problems: 13 / 13

slide-73
SLIDE 73

. . . the high technology so celebrated today is essentially a mathematical technology.

“To err is human, but to really foul things up you need a computer.” – Paul Ehrlich Mariner rocket explodes (1962). Formula into code bug resulted in no smoothing of deviations. WWWIII (1983)? Soviet EWS detects 5 US-missiles (bug detected sunlight reflections).

◮ Luckily Stanislav “funny feeling in my gut” Petrov thought: “surely they’d use more missiles?”

Therac 25 (1985). Concurrent programming bug killed patients through massive 100× radiation overdose. AT&T Lines Go Dead (1990). 75 million calls dropped (one line of buggy code in software upgrade). Patriot missile defense fails (1991). 28 soldiers dead, 100 injured (rounding error in scud-detection). Pentium floating point long-division bug (1993). Cost: $475 million – flawed division table. Ariane rocket explosion (1996). Cost: $500 million – overflow in 64-bit to 16-bit conversion. Y2K (1999). Cost: $500 billion spent because year was stored as 2 digits to save space. Mars Climate Orbiter Crash (1998). Cost: $125 million lost due to metric to imperial units bug. Tesla Self-Driving Car (2016). 1 dead. Auto-pilot didn’t “see” tractor-trailer. Financial Disasters: London Stock Exchange down due to single server bug (2009; billions of pounds of trading); Knight Capital computer glitch trigers stock sale (2012; 500 million lost and Knight’s value drops by 75%). Airline Disasters:

◮ AirFrance 447 2009, 228 dead: pitot-tube failure feeds inconsistent data to programs which then panic pilot. ◮ Spanair 5022, 2008, 154 dead: malware virus. ◮ AdamAir 574, 2007, 102 dead: navigation system errors (and pilot errors). ◮ KoreanAir 801, 1997, 228 dead: ground proximity warning system bug. ◮ AeroPerú 603, 1996, 70 dead: altimeter failures. ◮ Scottish RAF Chinook, 1994, 29 dead: faulty test program ◮ AirFrance 296, 1988, 3 dead: altimeter bug. ◮ IranAir 655, 1988, 290 dead: shot down by US Aegis combat system (misidentified as attacking military plane). ◮ KoreanAir 007, 1983, 269 dead: autopilot took plane into Soviet airspace where it got shot down. ◮ Boeing 737 Max, 2018,2019, 346 dead: attack sensor + algorithm errors.

Creator: Malik Magdon-Ismail Unsolvable Problems: 13 / 13

slide-74
SLIDE 74

. . . the high technology so celebrated today is essentially a mathematical technology.

“To err is human, but to really foul things up you need a computer.” – Paul Ehrlich Mariner rocket explodes (1962). Formula into code bug resulted in no smoothing of deviations. WWWIII (1983)? Soviet EWS detects 5 US-missiles (bug detected sunlight reflections).

◮ Luckily Stanislav “funny feeling in my gut” Petrov thought: “surely they’d use more missiles?”

Therac 25 (1985). Concurrent programming bug killed patients through massive 100× radiation overdose. AT&T Lines Go Dead (1990). 75 million calls dropped (one line of buggy code in software upgrade). Patriot missile defense fails (1991). 28 soldiers dead, 100 injured (rounding error in scud-detection). Pentium floating point long-division bug (1993). Cost: $475 million – flawed division table. Ariane rocket explosion (1996). Cost: $500 million – overflow in 64-bit to 16-bit conversion. Y2K (1999). Cost: $500 billion spent because year was stored as 2 digits to save space. Mars Climate Orbiter Crash (1998). Cost: $125 million lost due to metric to imperial units bug. Tesla Self-Driving Car (2016). 1 dead. Auto-pilot didn’t “see” tractor-trailer. Financial Disasters: London Stock Exchange down due to single server bug (2009; billions of pounds of trading); Knight Capital computer glitch trigers stock sale (2012; 500 million lost and Knight’s value drops by 75%). Airline Disasters:

◮ AirFrance 447 2009, 228 dead: pitot-tube failure feeds inconsistent data to programs which then panic pilot. ◮ Spanair 5022, 2008, 154 dead: malware virus. ◮ AdamAir 574, 2007, 102 dead: navigation system errors (and pilot errors). ◮ KoreanAir 801, 1997, 228 dead: ground proximity warning system bug. ◮ AeroPerú 603, 1996, 70 dead: altimeter failures. ◮ Scottish RAF Chinook, 1994, 29 dead: faulty test program ◮ AirFrance 296, 1988, 3 dead: altimeter bug. ◮ IranAir 655, 1988, 290 dead: shot down by US Aegis combat system (misidentified as attacking military plane). ◮ KoreanAir 007, 1983, 269 dead: autopilot took plane into Soviet airspace where it got shot down. ◮ Boeing 737 Max, 2018,2019, 346 dead: attack sensor + algorithm errors.

Software errors cost the U.S. $60 billion annually in rework, lost productivity and actual damages.

Put effort to make sure your program works fully correctly all the time.

Creator: Malik Magdon-Ismail Unsolvable Problems: 13 / 13