Understanding Computation 1 Mathematics & Computation - - PowerPoint PPT Presentation

understanding computation
SMART_READER_LITE
LIVE PREVIEW

Understanding Computation 1 Mathematics & Computation - - PowerPoint PPT Presentation

Understanding Computation 1 Mathematics & Computation Machines have helped with calculations for a long time Can we use machines to reason too? CS 374 2 Mathematics & Computation Machines have helped with calculations for a long


slide-1
SLIDE 1

Understanding Computation

1

slide-2
SLIDE 2

CS 374

Mathematics & Computation

Machines have helped with calculations for a long time

2

Can we use machines to reason too?

slide-3
SLIDE 3

CS 374

Mathematics & Computation

Machines have helped with calculations for a long time

2

Can we use machines to reason too?

slide-4
SLIDE 4

CS 374

Mathematics & Computation

Machines have helped with calculations for a long time

2

Can we use machines to reason too?

Calculemus!

slide-5
SLIDE 5

CS 374

Mathematics & Computation

Machines have helped with calculations for a long time

2

Can we use machines to reason too?

Calculemus!

Formal Logic: Reasoning made into a calculation

slide-6
SLIDE 6

CS 374

Mathematics & Computation

3

slide-7
SLIDE 7

CS 374

Mathematics & Computation

Formal systems based on axioms and logic: for machines & modern mathematicians

3

slide-8
SLIDE 8

CS 374

Mathematics & Computation

Formal systems based on axioms and logic: for machines & modern mathematicians

Foundational problem: How to choose one’s axioms?

3

slide-9
SLIDE 9

CS 374

Mathematics & Computation

Formal systems based on axioms and logic: for machines & modern mathematicians

Foundational problem: How to choose one’s axioms? They should not give rise to contradictions!

3

slide-10
SLIDE 10

CS 374

Mathematics & Computation

Formal systems based on axioms and logic: for machines & modern mathematicians

Foundational problem: How to choose one’s axioms? They should not give rise to contradictions!

Early 1900s: Crisis in mathematical foundations

3

slide-11
SLIDE 11

CS 374

Mathematics & Computation

Formal systems based on axioms and logic: for machines & modern mathematicians

Foundational problem: How to choose one’s axioms? They should not give rise to contradictions!

Early 1900s: Crisis in mathematical foundations

Contradictions discovered while attempting to formalize notions involving infinite sets

3

slide-12
SLIDE 12

CS 374

David Hilbert

  • 1928, Hilbert’s Program:

“Mechanize” mathematics

4

slide-13
SLIDE 13

CS 374

David Hilbert

  • 1928, Hilbert’s Program:

“Mechanize” mathematics

  • Finite set of axioms and inference

  • rules. An algorithm to determine the

truth of any statement

Need to find a consistent & complete 
 set of axioms

4

slide-14
SLIDE 14

CS 374

David Hilbert

  • 1928, Hilbert’s Program:

“Mechanize” mathematics

  • Finite set of axioms and inference

  • rules. An algorithm to determine the

truth of any statement

Need to find a consistent & complete 
 set of axioms

4

  • The system should also afford a proof of its own

consistency

  • Based on “safe” axioms — i.e., axioms involving only

finite objects — preferably

slide-15
SLIDE 15

CS 374

Mathematics & Computation

Mechanized math Beyond just philosophical interest! Can resolve stubborn open problems Replace mathematicians with mathe-machines!

5

slide-16
SLIDE 16

CS 374

Every even number > 2 is
 the sum of two primes

Goldbach’s Conjecture

6

Letter from Goldbach to Euler dated 7 June 1742

slide-17
SLIDE 17

CS 374

Program Collatz (n:integer) while n > 1 { if Even(n) then n ≔ n/2 else n ≔ 3n+1 }

Collatz Conjecture

7

slide-18
SLIDE 18

CS 374

Program Collatz (n:integer) while n > 1 { if Even(n) then n ≔ n/2 else n ≔ 3n+1 }

Collatz Conjecture

7

slide-19
SLIDE 19

CS 374

Program Collatz (n:integer) while n > 1 { if Even(n) then n ≔ n/2 else n ≔ 3n+1 }

Collatz Conjecture

  • Conjecture: Collatz(n) halts for every n > 0

7

slide-20
SLIDE 20

CS 374

Kurt Gödel

8

  • German logician, at age 25 (1931) proved:

“No matter what (consistent) set of axioms are used, a rich system will have true statements that can’t be proved”

slide-21
SLIDE 21

CS 374

Kurt Gödel

8

“This statement can’t be proved”

  • German logician, at age 25 (1931) proved:

“No matter what (consistent) set of axioms are used, a rich system will have true statements that can’t be proved”

slide-22
SLIDE 22

CS 374

Kurt Gödel

8

“This statement can’t be proved” “The axioms are consistent”

  • German logician, at age 25 (1931) proved:

“No matter what (consistent) set of axioms are used, a rich system will have true statements that can’t be proved”

slide-23
SLIDE 23

CS 374

Kurt Gödel

8

“This statement can’t be proved” “The axioms are consistent”

  • German logician, at age 25 (1931) proved:

“No matter what (consistent) set of axioms are used, a rich system will have true statements that can’t be proved”

  • Hilbert’s Program can’t work!
slide-24
SLIDE 24

CS 374

Kurt Gödel

8

“This statement can’t be proved” “The axioms are consistent”

  • German logician, at age 25 (1931) proved:

“No matter what (consistent) set of axioms are used, a rich system will have true statements that can’t be proved”

  • Hilbert’s Program can’t work!
  • Shook the foundations of

– mathematics – philosophy – science – everything

slide-25
SLIDE 25

CS 374

Alan Turing

  • British mathematician

– cryptanalysis during WWII – arguably, father of AI, CS Theory – several books, movies

9

slide-26
SLIDE 26

CS 374

Alan Turing

  • British mathematician

– cryptanalysis during WWII – arguably, father of AI, CS Theory – several books, movies

  • Mathematically defined computation

– and proved (1936) that The Halting Problem has no general algorithm

9

slide-27
SLIDE 27

CS 374

Halting Problem

  • Given program P, input w:

10

w

P

slide-28
SLIDE 28

CS 374

Halting Problem

  • Given program P, input w:

10

Will P(w) halt?

w

P

slide-29
SLIDE 29

CS 374

  • Suppose halting problem had an algorithm...

Why would we care about 
 the Halting Problem?

11

slide-30
SLIDE 30

CS 374

  • Suppose halting problem had an algorithm...

Program P() n ≔ 4 forever: if found-two-primes-that-sum-to(n) then n ≔ n + 2 else halt

Why would we care about 
 the Halting Problem?

11

slide-31
SLIDE 31

CS 374

  • Suppose halting problem had an algorithm...

Program P() n ≔ 4 forever: if found-two-primes-that-sum-to(n) then n ≔ n + 2 else halt

Why would we care about 
 the Halting Problem?

11

Does P halt ?

slide-32
SLIDE 32

CS 374

  • Suppose halting problem had an algorithm...

Program P() n ≔ 4 forever: if found-two-primes-that-sum-to(n) then n ≔ n + 2 else halt

Why would we care about 
 the Halting Problem?

11

Does P halt ? ← Solves Goldbach conjecture!

slide-33
SLIDE 33

CS 374

Why would we care about 
 the Halting Problem?

Does Find-proof halt on w? ≡ Is w a provable theorem?

12

Program Find-proof(w)

  • p ≔ empty-string

forever p ≔ successor(p) if Verify-proof(w,p) then halt

w

slide-34
SLIDE 34

CS 374

Alas!

13

slide-35
SLIDE 35

CS 374

Alas!

There is no program that solves the Halting Problem!


No use trying to find one!

13

slide-36
SLIDE 36

CS 374

Alas!

There is no program that solves the Halting Problem!


No use trying to find one!

How can there be problems that can’t be solved?

13

slide-37
SLIDE 37

CS 374

Alas!

There is no program that solves the Halting Problem!


No use trying to find one!

How can there be problems that can’t be solved? What is a problem? What is a program?

13

slide-38
SLIDE 38

CS 374

Computation

14

P solves F if for every x, P(x) outputs F(x) and halts Problem:
 To compute a function F that maps each input (a string) to an output bit Program:
 A finitely described process taking a string as input, and

  • utputting a bit (or not halting)
slide-39
SLIDE 39

CS 374

Computation

Too restrictive?

14

P solves F if for every x, P(x) outputs F(x) and halts Problem:
 To compute a function F that maps each input (a string) to an output bit Program:
 A finitely described process taking a string as input, and

  • utputting a bit (or not halting)
slide-40
SLIDE 40

CS 374

Computation

Too restrictive? Enough to compute functions with longer outputs too: 
 P(x,i) outputs the ith bit of F(x)

14

P solves F if for every x, P(x) outputs F(x) and halts Problem:
 To compute a function F that maps each input (a string) to an output bit Program:
 A finitely described process taking a string as input, and

  • utputting a bit (or not halting)
slide-41
SLIDE 41

CS 374

Computation

Too restrictive? Enough to compute functions with longer outputs too: 
 P(x,i) outputs the ith bit of F(x) Enough to model interactive computation too:
 P*(x,state) outputs (y,new_state)

14

P solves F if for every x, P(x) outputs F(x) and halts Problem:
 To compute a function F that maps each input (a string) to an output bit Program:
 A finitely described process taking a string as input, and

  • utputting a bit (or not halting)
slide-42
SLIDE 42

CS 374

15

  • A program is a finite bit string

Computation

Problem:
 To compute a function F that maps each input (a string) to an output bit Program:
 A finitely described process taking a string as input, and

  • utputting a bit (or not halting)

P solves F if for every x, P(x) outputs F(x) and halts

slide-43
SLIDE 43

CS 374

15

  • A program is a finite bit string
  • Programs can be enumerated — listed

sequentially — (say, lexicographically) so that every program appears somewhere in the list

1 ε 2 3 1 4 00 5 01 6 10 7 11 8 000 9 001 10 010 11 011 12 100

Computation

Problem:
 To compute a function F that maps each input (a string) to an output bit Program:
 A finitely described process taking a string as input, and

  • utputting a bit (or not halting)

P solves F if for every x, P(x) outputs F(x) and halts

slide-44
SLIDE 44

CS 374

15

  • A program is a finite bit string
  • Programs can be enumerated — listed

sequentially — (say, lexicographically) so that every program appears somewhere in the list

  • The set of all programs is countable.

1 ε 2 3 1 4 00 5 01 6 10 7 11 8 000 9 001 10 010 11 011 12 100

Computation

Problem:
 To compute a function F that maps each input (a string) to an output bit Program:
 A finitely described process taking a string as input, and

  • utputting a bit (or not halting)

P solves F if for every x, P(x) outputs F(x) and halts

slide-45
SLIDE 45

CS 374

16

  • A function assigns a bit to each finite string

1 ε 2 3 1 1 4 00 5 01 1 6 10 1 7 11 8 000 9 001 1 10 010 1 11 011 12 100 1

Computation

Problem:
 To compute a function F that maps each input (a string) to an output bit Program:
 A finitely described process taking a string as input, and

  • utputting a bit (or not halting)

P solves F if for every x, P(x) outputs F(x) and halts

slide-46
SLIDE 46

CS 374

16

  • A function assigns a bit to each finite string
  • Corresponds to an infinite bit string

1 ε 2 3 1 1 4 00 5 01 1 6 10 1 7 11 8 000 9 001 1 10 010 1 11 011 12 100 1

Computation

Problem:
 To compute a function F that maps each input (a string) to an output bit Program:
 A finitely described process taking a string as input, and

  • utputting a bit (or not halting)

P solves F if for every x, P(x) outputs F(x) and halts

slide-47
SLIDE 47

CS 374

16

  • A function assigns a bit to each finite string
  • Corresponds to an infinite bit string
  • The set of all functions is uncountable!
  • As numerous as, say, real numbers


in [0,1]

1 ε 2 3 1 1 4 00 5 01 1 6 10 1 7 11 8 000 9 001 1 10 010 1 11 011 12 100 1

Computation

Problem:
 To compute a function F that maps each input (a string) to an output bit Program:
 A finitely described process taking a string as input, and

  • utputting a bit (or not halting)

P solves F if for every x, P(x) outputs F(x) and halts

slide-48
SLIDE 48

CS 374

17

There are uncountably many functions! But only countably many programs Almost every function is uncomputable!

Computation

Problem:
 To compute a function F that maps each input (a string) to an output bit Program:
 A finitely described process taking a string as input, and

  • utputting a bit (or not halting)

P solves F if for every x, P(x) outputs F(x) and halts

slide-49
SLIDE 49

CS 374

Uncomputable Problems

18

slide-50
SLIDE 50

CS 374

Uncomputable Problems

But that doesn’t tell us why some 
 interesting problems are uncomputable

18

slide-51
SLIDE 51

CS 374

Uncomputable Problems

But that doesn’t tell us why some 
 interesting problems are uncomputable

If interesting ≡ has a finite description in English, then 


  • nly countably many interesting problems!

18

slide-52
SLIDE 52

CS 374

Uncomputable Problems

But that doesn’t tell us why some 
 interesting problems are uncomputable

If interesting ≡ has a finite description in English, then 


  • nly countably many interesting problems!

Proving that there are uncountably many real numbers: “Diagonalization” argument by Cantor

18

slide-53
SLIDE 53

CS 374

Uncomputable Problems

But that doesn’t tell us why some 
 interesting problems are uncomputable

If interesting ≡ has a finite description in English, then 


  • nly countably many interesting problems!

Proving that there are uncountably many real numbers: “Diagonalization” argument by Cantor Showing Halting Problem to be uncomputable: 


a similar argument (later)

18

slide-54
SLIDE 54

CS 374

Uncomputable Problems

19

slide-55
SLIDE 55

CS 374

Uncomputable Problems

Once we know one interesting problem is uncomputable, show more using reductions:

19

slide-56
SLIDE 56

CS 374

Uncomputable Problems

Once we know one interesting problem is uncomputable, show more using reductions: Reducing F* to F:
 Use any program P that solves F 
 to build a program P* that solves F*

19

slide-57
SLIDE 57

CS 374

Uncomputable Problems

Once we know one interesting problem is uncomputable, show more using reductions: Reducing F* to F:
 Use any program P that solves F 
 to build a program P* that solves F* If the Halting Problem can be reduced to F
 then F must be uncomputable!

19

slide-58
SLIDE 58

CS 374

Post Correspondence Problem

20

Theorem [Post’46]: Halting Problem (formulated for “Turing Machines”) reduces to PostCP — a “combinatorial” problem

slide-59
SLIDE 59

CS 374

Post Correspondence Problem

Given: Dominoes, each with a top-word and a bottom-word
 Can one arrange them (using any number of copies of each type) so that the top and bottom strings are identical?

20

abb a ba bbb a ab abb baa b bbb abb a ba bbb abb a a ab abb baa b bbb

Theorem [Post’46]: Halting Problem (formulated for “Turing Machines”) reduces to PostCP — a “combinatorial” problem

slide-60
SLIDE 60

CS 374

Post Correspondence Problem

Given: Dominoes, each with a top-word and a bottom-word
 Can one arrange them (using any number of copies of each type) so that the top and bottom strings are identical?

20

abb a ba bbb a ab abb baa b bbb abb a ba bbb abb a a ab abb baa b bbb

Theorem [Post’46]: Halting Problem (formulated for “Turing Machines”) reduces to PostCP — a “combinatorial” problem PostCP is uncomputable.

slide-61
SLIDE 61

CS 374

Post Correspondence Problem

21

PostCP is uncomputable.

slide-62
SLIDE 62

CS 374

Post Correspondence Problem

If PostCP can be reduced to F then F is uncomputable

21

PostCP is uncomputable.

slide-63
SLIDE 63

CS 374

Post Correspondence Problem

If PostCP can be reduced to F then F is uncomputable Typically, easier than reducing Halting Problem directly to F

21

PostCP is uncomputable.

slide-64
SLIDE 64

CS 374

Post Correspondence Problem

If PostCP can be reduced to F then F is uncomputable Typically, easier than reducing Halting Problem directly to F Many more interesting problems:
 http://en.wikipedia.org/wiki/List_of_undecidable_problems

21

PostCP is uncomputable.

slide-65
SLIDE 65

Induction

22

slide-66
SLIDE 66

CS 374

Inductive Proofs

23

  • Example: How many “moves” to assemble a jigsaw puzzle?

– move = join two clumps – clump = connected pieces – only successful moves count

  • Theorem: It takes exactly n-1 moves to assemble an n-piece

jigsaw puzzle (irrespective of which moves)

slide-67
SLIDE 67

CS 374

Inductive Proofs

24

slide-68
SLIDE 68

CS 374

Inductive Proofs

  • Theorem: It takes exactly n-1 moves to assemble an n-

piece jigsaw puzzle (irrespective of which moves)

24

slide-69
SLIDE 69

CS 374

Inductive Proofs

  • Theorem: It takes exactly n-1 moves to assemble an n-

piece jigsaw puzzle (irrespective of which moves) Proof by Induction:

24

slide-70
SLIDE 70

CS 374

Inductive Proofs

  • Theorem: It takes exactly n-1 moves to assemble an n-

piece jigsaw puzzle (irrespective of which moves) Proof by Induction: Base case: 1-piece puzzle takes 0 moves. ✅

24

slide-71
SLIDE 71

CS 374

Inductive Proofs

  • Theorem: It takes exactly n-1 moves to assemble an n-

piece jigsaw puzzle (irrespective of which moves) Proof by Induction: Base case: 1-piece puzzle takes 0 moves. ✅ Inductive step: Consider any n > 1 Assume any (n-1)-piece puzzle requires n-2 moves Consider any n-piece puzzle: n-2 moves for all but last One more move for last total = (n-2)+1 = n-1

24

slide-72
SLIDE 72

CS 374

Inductive Proofs

  • Theorem: It takes exactly n-1 moves to assemble an n-

piece jigsaw puzzle (irrespective of which moves) Proof by Induction: Base case: 1-piece puzzle takes 0 moves. ✅ Inductive step: Consider any n > 1 Assume any (n-1)-piece puzzle requires n-2 moves Consider any n-piece puzzle: n-2 moves for all but last One more move for last total = (n-2)+1 = n-1

24

slide-73
SLIDE 73

CS 374

Inductive Proofs

  • Theorem: It takes exactly n-1 moves to assemble an n-

piece jigsaw puzzle (irrespective of which moves) Proof by Induction: Base case: 1-piece puzzle takes 0 moves. ✅ Inductive step: Consider any n > 1 Assume any (n-1)-piece puzzle requires n-2 moves Consider any n-piece puzzle: n-2 moves for all but last One more move for last total = (n-2)+1 = n-1

24

slide-74
SLIDE 74

CS 374

Inductive Proofs

  • Theorem: It takes exactly n-1 moves to assemble an n-

piece jigsaw puzzle (irrespective of which moves) Proof by Induction: Base case: 1-piece puzzle takes 0 moves. ✅ Inductive step: Consider any n > 1 Assume any (n-1)-piece puzzle requires n-2 moves Consider any n-piece puzzle: n-2 moves for all but last One more move for last total = (n-2)+1 = n-1

24

slide-75
SLIDE 75

CS 374

  • Theorem: It takes exactly n-1 moves to assemble an n-

piece jigsaw puzzle (irrespective of which moves) Proof by Induction: Base case: 1-piece puzzle takes 0 moves. ✅ Inductive step: Consider any n > 1 Assume any (n-1)-piece puzzle requires n-2 moves Consider any n-piece puzzle: n-2 moves for all but last One more move for last total = (n-2)+1 = n-1

Inductive Proofs

25

U N P R O O F !

slide-76
SLIDE 76

CS 374

  • Theorem: It takes exactly n-1 moves to assemble an n-

piece jigsaw puzzle (irrespective of which moves) Proof by Induction: Base case: 1-piece puzzle takes 0 moves. ✅ Inductive step: Consider any n > 1 Assume any (n-1)-piece puzzle requires n-2 moves Consider any n-piece puzzle: n-2 moves for all but last One more move for last total = (n-2)+1 = n-1

Inductive Proofs

25

U N P R O O F !

slide-77
SLIDE 77

CS 374

Inductive Proofs

26

Why must last move look like this?

slide-78
SLIDE 78

CS 374

Inductive Proofs

26

Why must last move look like this? Last move could join two large clumps

slide-79
SLIDE 79

CS 374

Inductive Proofs

26

Why must last move look like this? Last move could join two large clumps

The argument presented implicitly assumes puzzle is built piece-by-piece

slide-80
SLIDE 80

CS 374

Induction Template

27

  • Base Case: Let n = ⟨some small values⟩. 


Then ⟨show claim holds for n⟩

  • Induction Step: Consider any arbitrary integer n ⟨greater

than base-case values⟩.
 
 Induction hypothesis: Assume that for all integers k < n (and k ≥ ⟨smallest value⟩), ⟨claim holds for k⟩
 
 ⟨Prove that claim holds for n⟩

slide-81
SLIDE 81

CS 374

Induction Template

27

  • Base Case: Let n = ⟨some small values⟩. 


Then ⟨show claim holds for n⟩

  • Induction Step: Consider any arbitrary integer n ⟨greater

than base-case values⟩.
 
 Induction hypothesis: Assume that for all integers k < n (and k ≥ ⟨smallest value⟩), ⟨claim holds for k⟩
 
 ⟨Prove that claim holds for n⟩

May need a stronger claim than originally asked to prove

slide-82
SLIDE 82

CS 374

Induction Template

27

  • Base Case: Let n = ⟨some small values⟩. 


Then ⟨show claim holds for n⟩

  • Induction Step: Consider any arbitrary integer n ⟨greater

than base-case values⟩.
 
 Induction hypothesis: Assume that for all integers k < n (and k ≥ ⟨smallest value⟩), ⟨claim holds for k⟩
 
 ⟨Prove that claim holds for n⟩

Convention in this class: n here (not n+1) May need a stronger claim than originally asked to prove

slide-83
SLIDE 83

CS 374

Induction Template

27

  • Base Case: Let n = ⟨some small values⟩. 


Then ⟨show claim holds for n⟩

  • Induction Step: Consider any arbitrary integer n ⟨greater

than base-case values⟩.
 
 Induction hypothesis: Assume that for all integers k < n (and k ≥ ⟨smallest value⟩), ⟨claim holds for k⟩
 
 ⟨Prove that claim holds for n⟩

Always use strong induction! Convention in this class: you lose all points for using weak induction when strong needed Convention in this class: n here (not n+1) May need a stronger claim than originally asked to prove

slide-84
SLIDE 84

CS 374

Induction Template

27

  • Base Case: Let n = ⟨some small values⟩. 


Then ⟨show claim holds for n⟩

  • Induction Step: Consider any arbitrary integer n ⟨greater

than base-case values⟩.
 
 Induction hypothesis: Assume that for all integers k < n (and k ≥ ⟨smallest value⟩), ⟨claim holds for k⟩
 
 ⟨Prove that claim holds for n⟩

Always use strong induction! Convention in this class: you lose all points for using weak induction when strong needed The clever stuff. Be careful to consider arbitrary instance of size n. Relate it to one

  • r more instances for which IH is assumed.

Convention in this class: n here (not n+1) May need a stronger claim than originally asked to prove

slide-85
SLIDE 85

CS 374

Example

28

  • Base Case: Let n = 1. 


Then, any clump with n pieces is just a single piece, and it needs 0 = n-1 moves to assemble

  • Induction Step: Consider any arbitrary integer n > 1.



 Induction hypothesis: Assume that for all integers k < n (and k ≥ 1), any clump with k pieces needs k-1 moves to assemble

Stronger Claim: Any clump with n pieces takes exactly n-1 moves to assemble

⟨Prove that claim holds for n⟩

slide-86
SLIDE 86

CS 374

Example

29

  • Base Case: Let n = 1. 


Then, any clump with n pieces is just a single piece, and it needs 0 = n-1 moves to assemble

  • Induction Step: Consider any arbitrary integer n > 1.



 Induction hypothesis: Assume that for all integers k < n (and k ≥ 1), any clump with k pieces needs k-1 moves to assemble Consider an arbitrary clump with n pieces, and an arbitrary sequence of moves to assemble it. 
 ◘ Last move joins 2 clumps of size k and n-k, where 1 ≤ k < n. 
 ◘ By IH, the two clumps took k-1 and n-k-1 moves each. 
 ◘ Overall (k-1) + (n-k-1) + 1 = n-1 moves. ✅

Stronger Claim: Any clump with n pieces takes exactly n-1 moves to assemble

slide-87
SLIDE 87

CS 374

Simple non-inductive proof

30

slide-88
SLIDE 88

CS 374

Simple non-inductive proof

  • Sometimes non-inductive proofs work, like in this example!

30

slide-89
SLIDE 89

CS 374

Simple non-inductive proof

  • Sometimes non-inductive proofs work, like in this example!
  • A single move reduces number of clumps by exactly 1.

30

slide-90
SLIDE 90

CS 374

Simple non-inductive proof

  • Sometimes non-inductive proofs work, like in this example!
  • A single move reduces number of clumps by exactly 1.
  • m moves reduce it by m

30

slide-91
SLIDE 91

CS 374

Simple non-inductive proof

  • Sometimes non-inductive proofs work, like in this example!
  • A single move reduces number of clumps by exactly 1.
  • m moves reduce it by m
  • Initially, n clumps (each of one piece)
  • At the end, 1 clump (of all pieces)

30

slide-92
SLIDE 92

CS 374

Simple non-inductive proof

  • Sometimes non-inductive proofs work, like in this example!
  • A single move reduces number of clumps by exactly 1.
  • m moves reduce it by m
  • Initially, n clumps (each of one piece)
  • At the end, 1 clump (of all pieces)
  • Therefore, if m moves overall, 1 = n - m.

30

slide-93
SLIDE 93

CS 374

Simple non-inductive proof

  • Sometimes non-inductive proofs work, like in this example!
  • A single move reduces number of clumps by exactly 1.
  • m moves reduce it by m
  • Initially, n clumps (each of one piece)
  • At the end, 1 clump (of all pieces)
  • Therefore, if m moves overall, 1 = n - m.
  • Hence m = n - 1

30

slide-94
SLIDE 94

CS 374

If you came in late:

  • https://courses.engr.illinois.edu/cs374/
  • Immediately join Piazza
  • Immediately check access to Moodle
  • Links to Piazza and Moodle are on course home page

31