Lecture 27: Theory of Computation Marvin Zhang 08/08/2016 - - PowerPoint PPT Presentation

lecture 27 theory of computation
SMART_READER_LITE
LIVE PREVIEW

Lecture 27: Theory of Computation Marvin Zhang 08/08/2016 - - PowerPoint PPT Presentation

Lecture 27: Theory of Computation Marvin Zhang 08/08/2016 Announcements Roadmap Introduction Functions Data Mutability Objects Interpretation Paradigms Applications Roadmap Introduction Functions This week (Applications), the


slide-1
SLIDE 1

Marvin Zhang 08/08/2016

Lecture 27: Theory of Computation

slide-2
SLIDE 2

Announcements

slide-3
SLIDE 3

Roadmap Introduction Functions Data Mutability Objects Interpretation Paradigms Applications

slide-4
SLIDE 4

Roadmap

  • This week (Applications), the

goals are:

Introduction Functions Data Mutability Objects Interpretation Paradigms Applications

slide-5
SLIDE 5

Roadmap

  • This week (Applications), the

goals are:

  • To go beyond CS 61A and see

examples of what comes next

Introduction Functions Data Mutability Objects Interpretation Paradigms Applications

slide-6
SLIDE 6

Roadmap

  • This week (Applications), the

goals are:

  • To go beyond CS 61A and see

examples of what comes next

  • To wrap up CS 61A!

Introduction Functions Data Mutability Objects Interpretation Paradigms Applications

slide-7
SLIDE 7

Theoretical Computer Science

slide-8
SLIDE 8

Theoretical Computer Science

  • The subfield of computer science that focuses on more

abstract and mathematical aspects of computing

slide-9
SLIDE 9

Theoretical Computer Science

  • The subfield of computer science that focuses on more

abstract and mathematical aspects of computing

  • A very broad and diverse subfield that interacts with

many other fields in and outside of computer science

slide-10
SLIDE 10

Theoretical Computer Science

  • The subfield of computer science that focuses on more

abstract and mathematical aspects of computing

  • A very broad and diverse subfield that interacts with

many other fields in and outside of computer science

  • A big part of this subfield is theory of computation
slide-11
SLIDE 11

Theoretical Computer Science

  • The subfield of computer science that focuses on more

abstract and mathematical aspects of computing

  • A very broad and diverse subfield that interacts with

many other fields in and outside of computer science

  • A big part of this subfield is theory of computation
  • We will look at two topics in theory of computation:
slide-12
SLIDE 12

Theoretical Computer Science

  • The subfield of computer science that focuses on more

abstract and mathematical aspects of computing

  • A very broad and diverse subfield that interacts with

many other fields in and outside of computer science

  • A big part of this subfield is theory of computation
  • We will look at two topics in theory of computation:
  • Computability theory
slide-13
SLIDE 13

Theoretical Computer Science

  • The subfield of computer science that focuses on more

abstract and mathematical aspects of computing

  • A very broad and diverse subfield that interacts with

many other fields in and outside of computer science

  • A big part of this subfield is theory of computation
  • We will look at two topics in theory of computation:
  • Computability theory
  • “Can my computer solve this problem?”
slide-14
SLIDE 14

Theoretical Computer Science

  • The subfield of computer science that focuses on more

abstract and mathematical aspects of computing

  • A very broad and diverse subfield that interacts with

many other fields in and outside of computer science

  • A big part of this subfield is theory of computation
  • We will look at two topics in theory of computation:
  • Computability theory
  • “Can my computer solve this problem?”
  • Complexity theory
slide-15
SLIDE 15

Theoretical Computer Science

  • The subfield of computer science that focuses on more

abstract and mathematical aspects of computing

  • A very broad and diverse subfield that interacts with

many other fields in and outside of computer science

  • A big part of this subfield is theory of computation
  • We will look at two topics in theory of computation:
  • Computability theory
  • “Can my computer solve this problem?”
  • Complexity theory
  • “Can my computer solve this problem efficiently?”
slide-16
SLIDE 16

Theoretical Computer Science

  • The subfield of computer science that focuses on more

abstract and mathematical aspects of computing

  • A very broad and diverse subfield that interacts with

many other fields in and outside of computer science

  • A big part of this subfield is theory of computation
  • We will look at two topics in theory of computation:
  • Computability theory
  • “Can my computer solve this problem?”
  • Complexity theory
  • “Can my computer solve this problem efficiently?”
  • If today is interesting, consider CS 170 and CS 172
slide-17
SLIDE 17

What can computers do?

Computability Theory

slide-18
SLIDE 18

The Halting Problem

slide-19
SLIDE 19

The Halting Problem

  • Can computers solve any problem we give them?
slide-20
SLIDE 20

The Halting Problem

  • Can computers solve any problem we give them?
  • If not, what can’t they do?
slide-21
SLIDE 21

The Halting Problem

  • Can computers solve any problem we give them?
  • If not, what can’t they do?
  • One useful problem we would like to solve, called the

halting problem, is to check if a function runs into an infinite loop, since we would usually like to avoid this

slide-22
SLIDE 22

The Halting Problem

  • Can computers solve any problem we give them?
  • If not, what can’t they do?
  • One useful problem we would like to solve, called the

halting problem, is to check if a function runs into an infinite loop, since we would usually like to avoid this

  • Let’s focus on functions that take in one argument
slide-23
SLIDE 23

The Halting Problem

  • Can computers solve any problem we give them?
  • If not, what can’t they do?
  • One useful problem we would like to solve, called the

halting problem, is to check if a function runs into an infinite loop, since we would usually like to avoid this

  • Let’s focus on functions that take in one argument

def whoops(x): while True: pass

slide-24
SLIDE 24

The Halting Problem

  • Can computers solve any problem we give them?
  • If not, what can’t they do?
  • One useful problem we would like to solve, called the

halting problem, is to check if a function runs into an infinite loop, since we would usually like to avoid this

  • Let’s focus on functions that take in one argument

def whoops(x): while True: pass def okay(x): return x + 1

slide-25
SLIDE 25

The Halting Problem

  • Can computers solve any problem we give them?
  • If not, what can’t they do?
  • One useful problem we would like to solve, called the

halting problem, is to check if a function runs into an infinite loop, since we would usually like to avoid this

  • Let’s focus on functions that take in one argument

def whoops(x): while True: pass def okay(x): return x + 1 def whookay(x): while x != 0: x -= 2

slide-26
SLIDE 26

The Halting Problem

  • Can computers solve any problem we give them?
  • If not, what can’t they do?
  • One useful problem we would like to solve, called the

halting problem, is to check if a function runs into an infinite loop, since we would usually like to avoid this

  • Let’s focus on functions that take in one argument
  • Can we write a function halts that takes in a function

func and an input x and returns whether or not func halts when given input x? def whoops(x): while True: pass def okay(x): return x + 1 def whookay(x): while x != 0: x -= 2

slide-27
SLIDE 27

The Halting Problem

slide-28
SLIDE 28

The Halting Problem

def halts(func, x): # ???

slide-29
SLIDE 29

The Halting Problem

  • It turns out that we cannot write halts! There is no

implementation that accomplishes what we want def halts(func, x): # ???

slide-30
SLIDE 30

The Halting Problem

  • It turns out that we cannot write halts! There is no

implementation that accomplishes what we want

  • The halting problem is called undecidable, which

basically means that we can’t solve it using a computer def halts(func, x): # ???

slide-31
SLIDE 31

The Halting Problem

  • It turns out that we cannot write halts! There is no

implementation that accomplishes what we want

  • The halting problem is called undecidable, which

basically means that we can’t solve it using a computer

  • We can prove that we cannot write halts through a proof

by contradiction: def halts(func, x): # ???

slide-32
SLIDE 32

The Halting Problem

  • It turns out that we cannot write halts! There is no

implementation that accomplishes what we want

  • The halting problem is called undecidable, which

basically means that we can’t solve it using a computer

  • We can prove that we cannot write halts through a proof

by contradiction: 1. Assume that we can write halts def halts(func, x): # ???

slide-33
SLIDE 33

The Halting Problem

  • It turns out that we cannot write halts! There is no

implementation that accomplishes what we want

  • The halting problem is called undecidable, which

basically means that we can’t solve it using a computer

  • We can prove that we cannot write halts through a proof

by contradiction: 1. Assume that we can write halts 2. Show that this leads to a logical contradiction def halts(func, x): # ???

slide-34
SLIDE 34

The Halting Problem

  • It turns out that we cannot write halts! There is no

implementation that accomplishes what we want

  • The halting problem is called undecidable, which

basically means that we can’t solve it using a computer

  • We can prove that we cannot write halts through a proof

by contradiction: 1. Assume that we can write halts 2. Show that this leads to a logical contradiction 3. Conclude that our assumption must be false def halts(func, x): # ???

slide-35
SLIDE 35

The Halting Problem

slide-36
SLIDE 36

The Halting Problem

1. Assume that we can write halts

slide-37
SLIDE 37

The Halting Problem

1. Assume that we can write halts

  • Let’s say we have an implementation of halts, that works

for every function func and every input x:

slide-38
SLIDE 38

The Halting Problem

1. Assume that we can write halts

  • Let’s say we have an implementation of halts, that works

for every function func and every input x: def halts(func, x): """Returns whether or not func ever stops
 when given x as input.
 """

slide-39
SLIDE 39

The Halting Problem

1. Assume that we can write halts

  • Let’s say we have an implementation of halts, that works

for every function func and every input x: 2. Show that this leads to a logical contradiction def halts(func, x): """Returns whether or not func ever stops
 when given x as input.
 """

slide-40
SLIDE 40

The Halting Problem

1. Assume that we can write halts

  • Let’s say we have an implementation of halts, that works

for every function func and every input x: 2. Show that this leads to a logical contradiction

  • Let’s write another function very_bad that takes in a

function func and does the following: def halts(func, x): """Returns whether or not func ever stops
 when given x as input.
 """

slide-41
SLIDE 41

The Halting Problem

1. Assume that we can write halts

  • Let’s say we have an implementation of halts, that works

for every function func and every input x: 2. Show that this leads to a logical contradiction

  • Let’s write another function very_bad that takes in a

function func and does the following: def halts(func, x): """Returns whether or not func ever stops
 when given x as input.
 """ def very_bad(func):

slide-42
SLIDE 42

The Halting Problem

1. Assume that we can write halts

  • Let’s say we have an implementation of halts, that works

for every function func and every input x: 2. Show that this leads to a logical contradiction

  • Let’s write another function very_bad that takes in a

function func and does the following: def halts(func, x): """Returns whether or not func ever stops
 when given x as input.
 """ def very_bad(func): if halts(func, func): # check if func(func) halts

slide-43
SLIDE 43

The Halting Problem

1. Assume that we can write halts

  • Let’s say we have an implementation of halts, that works

for every function func and every input x: 2. Show that this leads to a logical contradiction

  • Let’s write another function very_bad that takes in a

function func and does the following: def halts(func, x): """Returns whether or not func ever stops
 when given x as input.
 """ def very_bad(func): if halts(func, func): # check if func(func) halts while True: # loop forever pass

slide-44
SLIDE 44

The Halting Problem

1. Assume that we can write halts

  • Let’s say we have an implementation of halts, that works

for every function func and every input x: 2. Show that this leads to a logical contradiction

  • Let’s write another function very_bad that takes in a

function func and does the following: def halts(func, x): """Returns whether or not func ever stops
 when given x as input.
 """ def very_bad(func): if halts(func, func): # check if func(func) halts while True: # loop forever pass else:

slide-45
SLIDE 45

The Halting Problem

1. Assume that we can write halts

  • Let’s say we have an implementation of halts, that works

for every function func and every input x: 2. Show that this leads to a logical contradiction

  • Let’s write another function very_bad that takes in a

function func and does the following: def halts(func, x): """Returns whether or not func ever stops
 when given x as input.
 """ def very_bad(func): if halts(func, func): # check if func(func) halts while True: # loop forever pass else: return # halt

slide-46
SLIDE 46

The Halting Problem

slide-47
SLIDE 47

The Halting Problem

2. Show that this leads to a logical contradiction

slide-48
SLIDE 48

The Halting Problem

2. Show that this leads to a logical contradiction def very_bad(func): if halts(func, func): # check if func(func) halts while True: # loop forever pass else: return # halt

slide-49
SLIDE 49

The Halting Problem

2. Show that this leads to a logical contradiction

  • What happens when we call very_bad(very_bad)?

def very_bad(func): if halts(func, func): # check if func(func) halts while True: # loop forever pass else: return # halt

slide-50
SLIDE 50

The Halting Problem

2. Show that this leads to a logical contradiction

  • What happens when we call very_bad(very_bad)?
  • If very_bad(very_bad) halts, then loop forever

def very_bad(func): if halts(func, func): # check if func(func) halts while True: # loop forever pass else: return # halt

slide-51
SLIDE 51

The Halting Problem

2. Show that this leads to a logical contradiction

  • What happens when we call very_bad(very_bad)?
  • If very_bad(very_bad) halts, then loop forever
  • If very_bad(very_bad) does not halt, then halt

def very_bad(func): if halts(func, func): # check if func(func) halts while True: # loop forever pass else: return # halt

slide-52
SLIDE 52

The Halting Problem

2. Show that this leads to a logical contradiction

  • What happens when we call very_bad(very_bad)?
  • If very_bad(very_bad) halts, then loop forever
  • If very_bad(very_bad) does not halt, then halt
  • So... does very_bad(very_bad) halt or not?

def very_bad(func): if halts(func, func): # check if func(func) halts while True: # loop forever pass else: return # halt

slide-53
SLIDE 53

The Halting Problem

2. Show that this leads to a logical contradiction

  • What happens when we call very_bad(very_bad)?
  • If very_bad(very_bad) halts, then loop forever
  • If very_bad(very_bad) does not halt, then halt
  • So... does very_bad(very_bad) halt or not?
  • It must either halt or not halt, there exists no

third option def very_bad(func): if halts(func, func): # check if func(func) halts while True: # loop forever pass else: return # halt

slide-54
SLIDE 54

The Halting Problem

slide-55
SLIDE 55

The Halting Problem

2. Show that this leads to a logical contradiction

slide-56
SLIDE 56

The Halting Problem

2. Show that this leads to a logical contradiction

  • If very_bad(very_bad) halts,
slide-57
SLIDE 57

The Halting Problem

2. Show that this leads to a logical contradiction

  • If very_bad(very_bad) halts,
  • Then very_bad(very_bad) does not halt
slide-58
SLIDE 58

The Halting Problem

2. Show that this leads to a logical contradiction

  • If very_bad(very_bad) halts,
  • Then very_bad(very_bad) does not halt
  • If very_bad(very_bad) does not halt,
slide-59
SLIDE 59

The Halting Problem

2. Show that this leads to a logical contradiction

  • If very_bad(very_bad) halts,
  • Then very_bad(very_bad) does not halt
  • If very_bad(very_bad) does not halt,
  • Then very_bad(very_bad) halts
slide-60
SLIDE 60

The Halting Problem

2. Show that this leads to a logical contradiction

  • If very_bad(very_bad) halts,
  • Then very_bad(very_bad) does not halt
  • If very_bad(very_bad) does not halt,
  • Then very_bad(very_bad) halts
  • This is a contradiction! It simply isn’t possible
slide-61
SLIDE 61

The Halting Problem

2. Show that this leads to a logical contradiction

  • If very_bad(very_bad) halts,
  • Then very_bad(very_bad) does not halt
  • If very_bad(very_bad) does not halt,
  • Then very_bad(very_bad) halts
  • This is a contradiction! It simply isn’t possible

3. Conclude that our assumption must be false

slide-62
SLIDE 62

The Halting Problem

2. Show that this leads to a logical contradiction

  • If very_bad(very_bad) halts,
  • Then very_bad(very_bad) does not halt
  • If very_bad(very_bad) does not halt,
  • Then very_bad(very_bad) halts
  • This is a contradiction! It simply isn’t possible

3. Conclude that our assumption must be false

  • very_bad is valid Python, there is nothing wrong there
slide-63
SLIDE 63

The Halting Problem

2. Show that this leads to a logical contradiction

  • If very_bad(very_bad) halts,
  • Then very_bad(very_bad) does not halt
  • If very_bad(very_bad) does not halt,
  • Then very_bad(very_bad) halts
  • This is a contradiction! It simply isn’t possible

3. Conclude that our assumption must be false

  • very_bad is valid Python, there is nothing wrong there
  • So it must be the case that our assumption is wrong
slide-64
SLIDE 64

The Halting Problem

2. Show that this leads to a logical contradiction

  • If very_bad(very_bad) halts,
  • Then very_bad(very_bad) does not halt
  • If very_bad(very_bad) does not halt,
  • Then very_bad(very_bad) halts
  • This is a contradiction! It simply isn’t possible

3. Conclude that our assumption must be false

  • very_bad is valid Python, there is nothing wrong there
  • So it must be the case that our assumption is wrong
  • Therefore, there is no way to write halts, and the

halting problem must be undecidable

slide-65
SLIDE 65

Decidability

slide-66
SLIDE 66

Decidability

  • Roughly speaking, the decidability of a problem is whether a

computer can solve the particular problem

slide-67
SLIDE 67

Decidability

  • Roughly speaking, the decidability of a problem is whether a

computer can solve the particular problem

  • The halting problem is undecidable, as we have shown
slide-68
SLIDE 68

Decidability

  • Roughly speaking, the decidability of a problem is whether a

computer can solve the particular problem

  • The halting problem is undecidable, as we have shown
  • All other problems we have studied are decidable, because we

have written code for all of them!

slide-69
SLIDE 69

Decidability

  • Roughly speaking, the decidability of a problem is whether a

computer can solve the particular problem

  • The halting problem is undecidable, as we have shown
  • All other problems we have studied are decidable, because we

have written code for all of them!

  • There are other problems that are undecidable, and there are

various ways to prove their undecidability

slide-70
SLIDE 70

Decidability

  • Roughly speaking, the decidability of a problem is whether a

computer can solve the particular problem

  • The halting problem is undecidable, as we have shown
  • All other problems we have studied are decidable, because we

have written code for all of them!

  • There are other problems that are undecidable, and there are

various ways to prove their undecidability

  • One way is proof by contradiction, which we have seen
slide-71
SLIDE 71

Decidability

  • Roughly speaking, the decidability of a problem is whether a

computer can solve the particular problem

  • The halting problem is undecidable, as we have shown
  • All other problems we have studied are decidable, because we

have written code for all of them!

  • There are other problems that are undecidable, and there are

various ways to prove their undecidability

  • One way is proof by contradiction, which we have seen
  • Another way is to reduce the problem to the halting problem
slide-72
SLIDE 72

Decidability

  • Roughly speaking, the decidability of a problem is whether a

computer can solve the particular problem

  • The halting problem is undecidable, as we have shown
  • All other problems we have studied are decidable, because we

have written code for all of them!

  • There are other problems that are undecidable, and there are

various ways to prove their undecidability

  • One way is proof by contradiction, which we have seen
  • Another way is to reduce the problem to the halting problem
  • In a reduction, we find a way to solve the halting problem using

the solution to another problem

slide-73
SLIDE 73

Decidability

  • Roughly speaking, the decidability of a problem is whether a

computer can solve the particular problem

  • The halting problem is undecidable, as we have shown
  • All other problems we have studied are decidable, because we

have written code for all of them!

  • There are other problems that are undecidable, and there are

various ways to prove their undecidability

  • One way is proof by contradiction, which we have seen
  • Another way is to reduce the problem to the halting problem
  • In a reduction, we find a way to solve the halting problem using

the solution to another problem

  • “If I can solve this problem, then I can also solve the halting

problem” implies:

slide-74
SLIDE 74

Decidability

  • Roughly speaking, the decidability of a problem is whether a

computer can solve the particular problem

  • The halting problem is undecidable, as we have shown
  • All other problems we have studied are decidable, because we

have written code for all of them!

  • There are other problems that are undecidable, and there are

various ways to prove their undecidability

  • One way is proof by contradiction, which we have seen
  • Another way is to reduce the problem to the halting problem
  • In a reduction, we find a way to solve the halting problem using

the solution to another problem

  • “If I can solve this problem, then I can also solve the halting

problem” implies:

  • “I can’t solve this problem, because I can’t solve the

halting problem.”

slide-75
SLIDE 75

Decidability

slide-76
SLIDE 76

Decidability

  • As an example, we can’t write a function computes_same

that takes in two functions f1 and f2 and returns whether

  • r not f1(y) == f2(y) for all inputs y
slide-77
SLIDE 77

Decidability

  • As an example, we can’t write a function computes_same

that takes in two functions f1 and f2 and returns whether

  • r not f1(y) == f2(y) for all inputs y

def computes_same(f1, f2): # ???

slide-78
SLIDE 78

Decidability

  • As an example, we can’t write a function computes_same

that takes in two functions f1 and f2 and returns whether

  • r not f1(y) == f2(y) for all inputs y
  • “If I can solve computes_same, then I can also solve the

halting problem” def computes_same(f1, f2): # ???

slide-79
SLIDE 79

Decidability

  • As an example, we can’t write a function computes_same

that takes in two functions f1 and f2 and returns whether

  • r not f1(y) == f2(y) for all inputs y
  • “If I can solve computes_same, then I can also solve the

halting problem” def computes_same(f1, f2): # ??? def halts(func, x):

slide-80
SLIDE 80

Decidability

  • As an example, we can’t write a function computes_same

that takes in two functions f1 and f2 and returns whether

  • r not f1(y) == f2(y) for all inputs y
  • “If I can solve computes_same, then I can also solve the

halting problem” def computes_same(f1, f2): # ??? def halts(func, x): def f1(y):

slide-81
SLIDE 81

Decidability

  • As an example, we can’t write a function computes_same

that takes in two functions f1 and f2 and returns whether

  • r not f1(y) == f2(y) for all inputs y
  • “If I can solve computes_same, then I can also solve the

halting problem” def computes_same(f1, f2): # ??? def halts(func, x): def f1(y): func(x)

slide-82
SLIDE 82

Decidability

  • As an example, we can’t write a function computes_same

that takes in two functions f1 and f2 and returns whether

  • r not f1(y) == f2(y) for all inputs y
  • “If I can solve computes_same, then I can also solve the

halting problem” def computes_same(f1, f2): # ??? def halts(func, x): def f1(y): func(x) return 0

slide-83
SLIDE 83

Decidability

  • As an example, we can’t write a function computes_same

that takes in two functions f1 and f2 and returns whether

  • r not f1(y) == f2(y) for all inputs y
  • “If I can solve computes_same, then I can also solve the

halting problem” def computes_same(f1, f2): # ??? def halts(func, x): def f1(y): func(x) return 0 def f2(y):

slide-84
SLIDE 84

Decidability

  • As an example, we can’t write a function computes_same

that takes in two functions f1 and f2 and returns whether

  • r not f1(y) == f2(y) for all inputs y
  • “If I can solve computes_same, then I can also solve the

halting problem” def computes_same(f1, f2): # ??? def halts(func, x): def f1(y): func(x) return 0 def f2(y): return 0

slide-85
SLIDE 85

Decidability

  • As an example, we can’t write a function computes_same

that takes in two functions f1 and f2 and returns whether

  • r not f1(y) == f2(y) for all inputs y
  • “If I can solve computes_same, then I can also solve the

halting problem” def computes_same(f1, f2): # ??? def halts(func, x): def f1(y): func(x) return 0 def f2(y): return 0 return computes_same(f1, f2)

slide-86
SLIDE 86

Decidability

slide-87
SLIDE 87

Decidability

def halts(func, x): def f1(y): func(x) return 0 def f2(y): return 0 return computes_same(f1, f2)

slide-88
SLIDE 88

Decidability

  • If f1(y) == f2(y) for all inputs y, then f1(y) == 0 for

all inputs y def halts(func, x): def f1(y): func(x) return 0 def f2(y): return 0 return computes_same(f1, f2)

slide-89
SLIDE 89

Decidability

  • If f1(y) == f2(y) for all inputs y, then f1(y) == 0 for

all inputs y

  • This implies that func(x) halts, because otherwise

f1(y) is undefined for all inputs y def halts(func, x): def f1(y): func(x) return 0 def f2(y): return 0 return computes_same(f1, f2)

slide-90
SLIDE 90

Decidability

  • If f1(y) == f2(y) for all inputs y, then f1(y) == 0 for

all inputs y

  • This implies that func(x) halts, because otherwise

f1(y) is undefined for all inputs y

  • So this successfully solves the halting problem!

def halts(func, x): def f1(y): func(x) return 0 def f2(y): return 0 return computes_same(f1, f2)

slide-91
SLIDE 91

Decidability

  • If f1(y) == f2(y) for all inputs y, then f1(y) == 0 for

all inputs y

  • This implies that func(x) halts, because otherwise

f1(y) is undefined for all inputs y

  • So this successfully solves the halting problem!
  • “I can’t solve computes_same, because I can’t solve the

halting problem.” def halts(func, x): def f1(y): func(x) return 0 def f2(y): return 0 return computes_same(f1, f2)

slide-92
SLIDE 92

What can computers do efficiently?

Complexity Theory

slide-93
SLIDE 93

Complexity

slide-94
SLIDE 94

Complexity

  • So, there are some problems that computers can’t solve
slide-95
SLIDE 95

Complexity

  • So, there are some problems that computers can’t solve
  • For all the problems that can be solved, can we solve

them efficiently? This is a much more practical concern

slide-96
SLIDE 96

Complexity

  • So, there are some problems that computers can’t solve
  • For all the problems that can be solved, can we solve

them efficiently? This is a much more practical concern def fib(n): if n == 1: return 0 elif n == 2: return 1 return fib(n-1) + fib(n-2)

slide-97
SLIDE 97

Complexity

  • So, there are some problems that computers can’t solve
  • For all the problems that can be solved, can we solve

them efficiently? This is a much more practical concern def fib(n): if n == 1: return 0 elif n == 2: return 1 return fib(n-1) + fib(n-2)

ϴ(𝜚n)

slide-98
SLIDE 98

Complexity

  • So, there are some problems that computers can’t solve
  • For all the problems that can be solved, can we solve

them efficiently? This is a much more practical concern def fib(n): if n == 1: return 0 elif n == 2: return 1 return fib(n-1) + fib(n-2)

ϴ(𝜚n)

exponential runtime

slide-99
SLIDE 99

Complexity

  • So, there are some problems that computers can’t solve
  • For all the problems that can be solved, can we solve

them efficiently? This is a much more practical concern def fib(n): if n == 1: return 0 elif n == 2: return 1 return fib(n-1) + fib(n-2)

ϴ(𝜚n)

exponential runtime (very bad!)

slide-100
SLIDE 100

Complexity

  • So, there are some problems that computers can’t solve
  • For all the problems that can be solved, can we solve

them efficiently? This is a much more practical concern def fib(n): if n == 1: return 0 elif n == 2: return 1 return fib(n-1) + fib(n-2) def fib(n): curr, next = 0, 1 while n > 0: curr, next = next, curr + next n -= 1 return curr

ϴ(𝜚n)

exponential runtime (very bad!)

slide-101
SLIDE 101

Complexity

  • So, there are some problems that computers can’t solve
  • For all the problems that can be solved, can we solve

them efficiently? This is a much more practical concern def fib(n): if n == 1: return 0 elif n == 2: return 1 return fib(n-1) + fib(n-2) def fib(n): curr, next = 0, 1 while n > 0: curr, next = next, curr + next n -= 1 return curr

ϴ(𝜚n)

exponential runtime (very bad!)

ϴ(n)

slide-102
SLIDE 102

Complexity

  • So, there are some problems that computers can’t solve
  • For all the problems that can be solved, can we solve

them efficiently? This is a much more practical concern def fib(n): if n == 1: return 0 elif n == 2: return 1 return fib(n-1) + fib(n-2) def fib(n): curr, next = 0, 1 while n > 0: curr, next = next, curr + next n -= 1 return curr

ϴ(𝜚n)

exponential runtime (very bad!)

ϴ(n)

linear runtime

slide-103
SLIDE 103

Complexity

  • So, there are some problems that computers can’t solve
  • For all the problems that can be solved, can we solve

them efficiently? This is a much more practical concern def fib(n): if n == 1: return 0 elif n == 2: return 1 return fib(n-1) + fib(n-2) def fib(n): curr, next = 0, 1 while n > 0: curr, next = next, curr + next n -= 1 return curr

ϴ(𝜚n)

exponential runtime (very bad!)

ϴ(n)

linear runtime (much better!)

slide-104
SLIDE 104

Orders of Growth

slide-105
SLIDE 105

Orders of Growth

slide-106
SLIDE 106

Orders of Growth ϴ(1)

slide-107
SLIDE 107

Orders of Growth ϴ(logn) ϴ(1)

slide-108
SLIDE 108

Orders of Growth ϴ(n) ϴ(logn) ϴ(1)

slide-109
SLIDE 109

Orders of Growth ϴ(n2) ϴ(n) ϴ(logn) ϴ(1)

slide-110
SLIDE 110

Orders of Growth ϴ(n2) ϴ(n) ϴ(logn) ϴ(1) ϴ(n3) …

slide-111
SLIDE 111

Orders of Growth ϴ(n2) ϴ(n) ϴ(logn) ϴ(1) ϴ(n3) … ϴ(1.1n)

slide-112
SLIDE 112

Orders of Growth ϴ(n2) ϴ(n) ϴ(logn) ϴ(1) ϴ(n3) … ϴ(1.1n) ϴ(𝜚n)

slide-113
SLIDE 113

Orders of Growth ϴ(n2) ϴ(n) ϴ(logn) ϴ(1) ϴ(n3) … ϴ(1.1n) ϴ(𝜚n) ϴ(2n) …

slide-114
SLIDE 114

Orders of Growth ϴ(n2) ϴ(n) ϴ(logn) ϴ(1) ϴ(n3) … ϴ(1.1n) ϴ(𝜚n) ϴ(2n) …

iterative Fibonacci

slide-115
SLIDE 115

Orders of Growth ϴ(n2) ϴ(n) ϴ(logn) ϴ(1) ϴ(n3) … ϴ(1.1n) ϴ(𝜚n) ϴ(2n) …

iterative Fibonacci recursive Fibonacci

slide-116
SLIDE 116

Orders of Growth ϴ(n2) ϴ(n) ϴ(logn) ϴ(1) ϴ(n3) … ϴ(1.1n) ϴ(𝜚n) ϴ(2n) …

iterative Fibonacci recursive Fibonacci

Polynomial runtime

slide-117
SLIDE 117

Orders of Growth ϴ(n2) ϴ(n) ϴ(logn) ϴ(1) ϴ(n3) … ϴ(1.1n) ϴ(𝜚n) ϴ(2n) …

iterative Fibonacci recursive Fibonacci

Polynomial runtime Generally pretty fast

slide-118
SLIDE 118

Orders of Growth ϴ(n2) ϴ(n) ϴ(logn) ϴ(1) ϴ(n3) … ϴ(1.1n) ϴ(𝜚n) ϴ(2n) …

iterative Fibonacci recursive Fibonacci

Polynomial runtime Generally pretty fast Considered good

slide-119
SLIDE 119

Orders of Growth ϴ(n2) ϴ(n) ϴ(logn) ϴ(1) ϴ(n3) … ϴ(1.1n) ϴ(𝜚n) ϴ(2n) …

iterative Fibonacci recursive Fibonacci

Polynomial runtime Generally pretty fast Considered good Exponential runtime or worse

slide-120
SLIDE 120

Orders of Growth ϴ(n2) ϴ(n) ϴ(logn) ϴ(1) ϴ(n3) … ϴ(1.1n) ϴ(𝜚n) ϴ(2n) …

iterative Fibonacci recursive Fibonacci

Polynomial runtime Generally pretty fast Considered good Exponential runtime or worse Gets slow quickly as n grows

slide-121
SLIDE 121

Orders of Growth ϴ(n2) ϴ(n) ϴ(logn) ϴ(1) ϴ(n3) … ϴ(1.1n) ϴ(𝜚n) ϴ(2n) …

iterative Fibonacci recursive Fibonacci

Polynomial runtime Generally pretty fast Considered good Exponential runtime or worse Gets slow quickly as n grows Intractable

slide-122
SLIDE 122

Complexity Classes

slide-123
SLIDE 123

Complexity Classes

  • We often make the distinction between polynomial runtime

and exponential runtime, and ignore the differences between different polynomials or different exponentials

slide-124
SLIDE 124

Complexity Classes

  • We often make the distinction between polynomial runtime

and exponential runtime, and ignore the differences between different polynomials or different exponentials

  • Roughly speaking, solutions with polynomial runtime are

usually “good enough”, whereas exponential runtime is usually too bad to be useful

slide-125
SLIDE 125

Complexity Classes

  • We often make the distinction between polynomial runtime

and exponential runtime, and ignore the differences between different polynomials or different exponentials

  • Roughly speaking, solutions with polynomial runtime are

usually “good enough”, whereas exponential runtime is usually too bad to be useful

  • Practically, there is certainly a difference between

solutions with, e.g., ϴ(n) runtime and ϴ(n3) runtime

slide-126
SLIDE 126

Complexity Classes

  • We often make the distinction between polynomial runtime

and exponential runtime, and ignore the differences between different polynomials or different exponentials

  • Roughly speaking, solutions with polynomial runtime are

usually “good enough”, whereas exponential runtime is usually too bad to be useful

  • Practically, there is certainly a difference between

solutions with, e.g., ϴ(n) runtime and ϴ(n3) runtime

  • But this is a smaller difference than solutions with,

e.g., ϴ(n3) runtime and ϴ(2n) runtime

slide-127
SLIDE 127

Complexity Classes

  • We often make the distinction between polynomial runtime

and exponential runtime, and ignore the differences between different polynomials or different exponentials

  • Roughly speaking, solutions with polynomial runtime are

usually “good enough”, whereas exponential runtime is usually too bad to be useful

  • Practically, there is certainly a difference between

solutions with, e.g., ϴ(n) runtime and ϴ(n3) runtime

  • But this is a smaller difference than solutions with,

e.g., ϴ(n3) runtime and ϴ(2n) runtime

  • It is also generally easier to reduce polynomials than

to reduce exponential runtime to polynomial runtime

slide-128
SLIDE 128

Complexity Classes

  • We often make the distinction between polynomial runtime

and exponential runtime, and ignore the differences between different polynomials or different exponentials

  • Roughly speaking, solutions with polynomial runtime are

usually “good enough”, whereas exponential runtime is usually too bad to be useful

  • Practically, there is certainly a difference between

solutions with, e.g., ϴ(n) runtime and ϴ(n3) runtime

  • But this is a smaller difference than solutions with,

e.g., ϴ(n3) runtime and ϴ(2n) runtime

  • It is also generally easier to reduce polynomials than

to reduce exponential runtime to polynomial runtime

  • Ignoring the smaller differences allows us to develop

more rigorous theory involving complexity classes

slide-129
SLIDE 129

Disclaimer

slide-130
SLIDE 130

Disclaimer

  • The rest of this lecture is less formal, because we have

to skip some of the more complicated details

slide-131
SLIDE 131

Disclaimer

  • The rest of this lecture is less formal, because we have

to skip some of the more complicated details

  • So, don’t quote what I say or write, because I will get

in trouble

slide-132
SLIDE 132

Disclaimer

  • The rest of this lecture is less formal, because we have

to skip some of the more complicated details

  • So, don’t quote what I say or write, because I will get

in trouble

  • Instead, just try to understand the main ideas
slide-133
SLIDE 133

Disclaimer

  • The rest of this lecture is less formal, because we have

to skip some of the more complicated details

  • So, don’t quote what I say or write, because I will get

in trouble

  • Instead, just try to understand the main ideas
  • If you want all of the details, I refer you to:
slide-134
SLIDE 134

Disclaimer

  • The rest of this lecture is less formal, because we have

to skip some of the more complicated details

  • So, don’t quote what I say or write, because I will get

in trouble

  • Instead, just try to understand the main ideas
  • If you want all of the details, I refer you to:
  • CS 170 (Efficient Algorithms and Intractable Problems)
slide-135
SLIDE 135

Disclaimer

  • The rest of this lecture is less formal, because we have

to skip some of the more complicated details

  • So, don’t quote what I say or write, because I will get

in trouble

  • Instead, just try to understand the main ideas
  • If you want all of the details, I refer you to:
  • CS 170 (Efficient Algorithms and Intractable Problems)
  • CS 172 (Computability and Complexity)
slide-136
SLIDE 136

Disclaimer

  • The rest of this lecture is less formal, because we have

to skip some of the more complicated details

  • So, don’t quote what I say or write, because I will get

in trouble

  • Instead, just try to understand the main ideas
  • If you want all of the details, I refer you to:
  • CS 170 (Efficient Algorithms and Intractable Problems)
  • CS 172 (Computability and Complexity)
  • Or the equivalent courses at other institutions
slide-137
SLIDE 137

Complexity Classes

slide-138
SLIDE 138

Complexity Classes

  • The two most famous complexity classes are called P and NP
slide-139
SLIDE 139

Complexity Classes

  • The two most famous complexity classes are called P and NP
  • The class P contains problems that have solutions with

polynomial runtime

slide-140
SLIDE 140

Complexity Classes

  • The two most famous complexity classes are called P and NP
  • The class P contains problems that have solutions with

polynomial runtime

  • Fibonacci is in this class, since the iterative

solution has linear runtime

slide-141
SLIDE 141

Complexity Classes

  • The two most famous complexity classes are called P and NP
  • The class P contains problems that have solutions with

polynomial runtime

  • Fibonacci is in this class, since the iterative

solution has linear runtime

  • Most problems we have seen so far are in P
slide-142
SLIDE 142

Complexity Classes

  • The two most famous complexity classes are called P and NP
  • The class P contains problems that have solutions with

polynomial runtime

  • Fibonacci is in this class, since the iterative

solution has linear runtime

  • Most problems we have seen so far are in P
  • The class NP contains problems where the answer can be

verified in polynomial time

slide-143
SLIDE 143

Complexity Classes

  • The two most famous complexity classes are called P and NP
  • The class P contains problems that have solutions with

polynomial runtime

  • Fibonacci is in this class, since the iterative

solution has linear runtime

  • Most problems we have seen so far are in P
  • The class NP contains problems where the answer can be

verified in polynomial time

  • If I tell you: “The nth Fibonacci number is k”
slide-144
SLIDE 144

Complexity Classes

  • The two most famous complexity classes are called P and NP
  • The class P contains problems that have solutions with

polynomial runtime

  • Fibonacci is in this class, since the iterative

solution has linear runtime

  • Most problems we have seen so far are in P
  • The class NP contains problems where the answer can be

verified in polynomial time

  • If I tell you: “The nth Fibonacci number is k”
  • Can you verify that this is correct in polynomial time?
slide-145
SLIDE 145

Complexity Classes

  • The two most famous complexity classes are called P and NP
  • The class P contains problems that have solutions with

polynomial runtime

  • Fibonacci is in this class, since the iterative

solution has linear runtime

  • Most problems we have seen so far are in P
  • The class NP contains problems where the answer can be

verified in polynomial time

  • If I tell you: “The nth Fibonacci number is k”
  • Can you verify that this is correct in polynomial time?
  • In this example, the answer is yes, because you can just

run the iterative solution to check, so Fibonacci is also in NP

slide-146
SLIDE 146

Example: Hamiltonian Path

slide-147
SLIDE 147

Example: Hamiltonian Path

  • Given a graph, is there a path through the graph that

visits each vertex exactly once?

slide-148
SLIDE 148

Example: Hamiltonian Path

  • Given a graph, is there a path through the graph that

visits each vertex exactly once?

slide-149
SLIDE 149

Example: Hamiltonian Path

  • Given a graph, is there a path through the graph that

visits each vertex exactly once?

(demo)

slide-150
SLIDE 150

Example: Hamiltonian Path

  • Given a graph, is there a path through the graph that

visits each vertex exactly once?

  • Is this problem in NP? Yes!

(demo)

slide-151
SLIDE 151

Example: Hamiltonian Path

  • Given a graph, is there a path through the graph that

visits each vertex exactly once?

  • Is this problem in NP? Yes!
  • If I am given a graph and a proposed


Hamiltonian path, I can easily verify
 whether or not the path is correct

(demo)

slide-152
SLIDE 152

Example: Hamiltonian Path

  • Given a graph, is there a path through the graph that

visits each vertex exactly once?

  • Is this problem in NP? Yes!
  • If I am given a graph and a proposed


Hamiltonian path, I can easily verify
 whether or not the path is correct

  • I just have to trace the path through


the graph and make sure it visits every vertex

(demo)

slide-153
SLIDE 153

Example: Hamiltonian Path

  • Given a graph, is there a path through the graph that

visits each vertex exactly once?

  • Is this problem in NP? Yes!
  • If I am given a graph and a proposed


Hamiltonian path, I can easily verify
 whether or not the path is correct

  • I just have to trace the path through


the graph and make sure it visits every vertex

  • Is this problem in P? We don’t know

(demo)

slide-154
SLIDE 154

Example: Hamiltonian Path

  • Given a graph, is there a path through the graph that

visits each vertex exactly once?

  • Is this problem in NP? Yes!
  • If I am given a graph and a proposed


Hamiltonian path, I can easily verify
 whether or not the path is correct

  • I just have to trace the path through


the graph and make sure it visits every vertex

  • Is this problem in P? We don’t know
  • We have seen two exponential runtime solutions for this

problem, one in Logic and a similar one in Python

(demo)

slide-155
SLIDE 155

Example: Hamiltonian Path

  • Given a graph, is there a path through the graph that

visits each vertex exactly once?

  • Is this problem in NP? Yes!
  • If I am given a graph and a proposed


Hamiltonian path, I can easily verify
 whether or not the path is correct

  • I just have to trace the path through


the graph and make sure it visits every vertex

  • Is this problem in P? We don’t know
  • We have seen two exponential runtime solutions for this

problem, one in Logic and a similar one in Python

  • But there could be another solution with polynomial

runtime, we can’t be sure

(demo)

slide-156
SLIDE 156

P and NP

slide-157
SLIDE 157

P and NP

  • Is every problem in P also in NP? Yes!
slide-158
SLIDE 158

P and NP

  • Is every problem in P also in NP? Yes!
  • If a problem is in P, then it has a solution with

polynomial runtime

slide-159
SLIDE 159

P and NP

  • Is every problem in P also in NP? Yes!
  • If a problem is in P, then it has a solution with

polynomial runtime

  • So if I want to verify an answer for an instance of the

problem, I can just run the solution and compare

slide-160
SLIDE 160

P and NP

  • Is every problem in P also in NP? Yes!
  • If a problem is in P, then it has a solution with

polynomial runtime

  • So if I want to verify an answer for an instance of the

problem, I can just run the solution and compare

  • This takes polynomial time, so the problem is in NP
slide-161
SLIDE 161

P and NP

  • Is every problem in P also in NP? Yes!
  • If a problem is in P, then it has a solution with

polynomial runtime

  • So if I want to verify an answer for an instance of the

problem, I can just run the solution and compare

  • This takes polynomial time, so the problem is in NP
  • Is every problem in NP also in P?
slide-162
SLIDE 162

P and NP

  • Is every problem in P also in NP? Yes!
  • If a problem is in P, then it has a solution with

polynomial runtime

  • So if I want to verify an answer for an instance of the

problem, I can just run the solution and compare

  • This takes polynomial time, so the problem is in NP
  • Is every problem in NP also in P?
  • In other words, if I can verify an answer for a problem

in polynomial time, can I also compute that answer myself in polynomial time?

slide-163
SLIDE 163

P and NP

  • Is every problem in P also in NP? Yes!
  • If a problem is in P, then it has a solution with

polynomial runtime

  • So if I want to verify an answer for an instance of the

problem, I can just run the solution and compare

  • This takes polynomial time, so the problem is in NP
  • Is every problem in NP also in P?
  • In other words, if I can verify an answer for a problem

in polynomial time, can I also compute that answer myself in polynomial time?

  • No one knows
slide-164
SLIDE 164

P and NP

  • Is every problem in P also in NP? Yes!
  • If a problem is in P, then it has a solution with

polynomial runtime

  • So if I want to verify an answer for an instance of the

problem, I can just run the solution and compare

  • This takes polynomial time, so the problem is in NP
  • Is every problem in NP also in P?
  • In other words, if I can verify an answer for a problem

in polynomial time, can I also compute that answer myself in polynomial time?

  • No one knows
  • But most people think it’s unlikely
slide-165
SLIDE 165

P = NP (?)

slide-166
SLIDE 166

P = NP (?)

  • So, we know that P is a subset of NP, but we still don’t

know whether or not they are equal

slide-167
SLIDE 167

P = NP (?)

  • So, we know that P is a subset of NP, but we still don’t

know whether or not they are equal

  • Most people think they’re not equal, because you could do a

lot of crazy things if they are

slide-168
SLIDE 168

P = NP (?)

  • So, we know that P is a subset of NP, but we still don’t

know whether or not they are equal

  • Most people think they’re not equal, because you could do a

lot of crazy things if they are

  • Automatically generate mathematical proofs
slide-169
SLIDE 169

P = NP (?)

  • So, we know that P is a subset of NP, but we still don’t

know whether or not they are equal

  • Most people think they’re not equal, because you could do a

lot of crazy things if they are

  • Automatically generate mathematical proofs
  • Optimally play Candy Crush, Pokémon, and Super Mario Bros
slide-170
SLIDE 170

P = NP (?)

  • So, we know that P is a subset of NP, but we still don’t

know whether or not they are equal

  • Most people think they’re not equal, because you could do a

lot of crazy things if they are

  • Automatically generate mathematical proofs
  • Optimally play Candy Crush, Pokémon, and Super Mario Bros
  • Break many types of security encryption
slide-171
SLIDE 171

P = NP (?)

  • So, we know that P is a subset of NP, but we still don’t

know whether or not they are equal

  • Most people think they’re not equal, because you could do a

lot of crazy things if they are

  • Automatically generate mathematical proofs
  • Optimally play Candy Crush, Pokémon, and Super Mario Bros
  • Break many types of security encryption
  • Verifying a password is very easy, just type it in and

see if it works

slide-172
SLIDE 172

P = NP (?)

  • So, we know that P is a subset of NP, but we still don’t

know whether or not they are equal

  • Most people think they’re not equal, because you could do a

lot of crazy things if they are

  • Automatically generate mathematical proofs
  • Optimally play Candy Crush, Pokémon, and Super Mario Bros
  • Break many types of security encryption
  • Verifying a password is very easy, just type it in and

see if it works

  • Imagine if figuring out a password was just as easy
slide-173
SLIDE 173

P = NP (?)

  • So, we know that P is a subset of NP, but we still don’t

know whether or not they are equal

  • Most people think they’re not equal, because you could do a

lot of crazy things if they are

  • Automatically generate mathematical proofs
  • Optimally play Candy Crush, Pokémon, and Super Mario Bros
  • Break many types of security encryption
  • Verifying a password is very easy, just type it in and

see if it works

  • Imagine if figuring out a password was just as easy
  • The P = NP problem is one of the seven Millennium prizes
slide-174
SLIDE 174

P = NP (?)

  • So, we know that P is a subset of NP, but we still don’t

know whether or not they are equal

  • Most people think they’re not equal, because you could do a

lot of crazy things if they are

  • Automatically generate mathematical proofs
  • Optimally play Candy Crush, Pokémon, and Super Mario Bros
  • Break many types of security encryption
  • Verifying a password is very easy, just type it in and

see if it works

  • Imagine if figuring out a password was just as easy
  • The P = NP problem is one of the seven Millennium prizes
  • If I just proved that P = NP, how do I take over the world?
slide-175
SLIDE 175

Summary

slide-176
SLIDE 176

Summary

  • Computability theory studies what problems computers can

and cannot solve

slide-177
SLIDE 177

Summary

  • Computability theory studies what problems computers can

and cannot solve

  • The halting problem cannot be solved by a computer
slide-178
SLIDE 178

Summary

  • Computability theory studies what problems computers can

and cannot solve

  • The halting problem cannot be solved by a computer
  • Reducing other problems to the halting problem shows

that they cannot be solved either

slide-179
SLIDE 179

Summary

  • Computability theory studies what problems computers can

and cannot solve

  • The halting problem cannot be solved by a computer
  • Reducing other problems to the halting problem shows

that they cannot be solved either

  • This is not really a practical concern for most people
slide-180
SLIDE 180

Summary

  • Computability theory studies what problems computers can

and cannot solve

  • The halting problem cannot be solved by a computer
  • Reducing other problems to the halting problem shows

that they cannot be solved either

  • This is not really a practical concern for most people
  • Complexity theory studies what problems computers can and

cannot solve efficiently

slide-181
SLIDE 181

Summary

  • Computability theory studies what problems computers can

and cannot solve

  • The halting problem cannot be solved by a computer
  • Reducing other problems to the halting problem shows

that they cannot be solved either

  • This is not really a practical concern for most people
  • Complexity theory studies what problems computers can and

cannot solve efficiently

  • This is a practical concern for basically everyone
slide-182
SLIDE 182

Summary

  • Computability theory studies what problems computers can

and cannot solve

  • The halting problem cannot be solved by a computer
  • Reducing other problems to the halting problem shows

that they cannot be solved either

  • This is not really a practical concern for most people
  • Complexity theory studies what problems computers can and

cannot solve efficiently

  • This is a practical concern for basically everyone
  • There are still many unanswered questions, for example,

whether or not P = NP

slide-183
SLIDE 183

Summary

  • Computability theory studies what problems computers can

and cannot solve

  • The halting problem cannot be solved by a computer
  • Reducing other problems to the halting problem shows

that they cannot be solved either

  • This is not really a practical concern for most people
  • Complexity theory studies what problems computers can and

cannot solve efficiently

  • This is a practical concern for basically everyone
  • There are still many unanswered questions, for example,

whether or not P = NP

  • CS 170 and CS 172 go into more detail on this material