CS 301 Lecture 26 Conclusion Stephen Checkoway May 2, 2018 1 / 9 - - PowerPoint PPT Presentation

cs 301
SMART_READER_LITE
LIVE PREVIEW

CS 301 Lecture 26 Conclusion Stephen Checkoway May 2, 2018 1 / 9 - - PowerPoint PPT Presentation

CS 301 Lecture 26 Conclusion Stephen Checkoway May 2, 2018 1 / 9 Whats this class good for anyway? Thinking logically will help any time you want to make an argument 2 / 9 Whats this class good for anyway? Thinking logically


slide-1
SLIDE 1

CS 301

Lecture 26 – Conclusion Stephen Checkoway May 2, 2018

1 / 9

slide-2
SLIDE 2

What’s this class good for anyway?

  • Thinking logically will help any time you want to make an argument

2 / 9

slide-3
SLIDE 3

What’s this class good for anyway?

  • Thinking logically will help any time you want to make an argument
  • Regular expressions are incredibly useful; learn to use them in your favorite

programming language (and when not to use them)

2 / 9

slide-4
SLIDE 4

What’s this class good for anyway?

  • Thinking logically will help any time you want to make an argument
  • Regular expressions are incredibly useful; learn to use them in your favorite

programming language (and when not to use them)

  • Context-free grammars are important for programming languages and compilers

2 / 9

slide-5
SLIDE 5

What’s this class good for anyway?

  • Thinking logically will help any time you want to make an argument
  • Regular expressions are incredibly useful; learn to use them in your favorite

programming language (and when not to use them)

  • Context-free grammars are important for programming languages and compilers
  • Decidability helps you think about what problems you cannot solve with computers

2 / 9

slide-6
SLIDE 6

What’s this class good for anyway?

  • Thinking logically will help any time you want to make an argument
  • Regular expressions are incredibly useful; learn to use them in your favorite

programming language (and when not to use them)

  • Context-free grammars are important for programming languages and compilers
  • Decidability helps you think about what problems you cannot solve with computers
  • Complexity helps you think about what problems you can solve or verify quickly

2 / 9

slide-7
SLIDE 7

So what’s next?

  • Algorithms! It turns out models of computation really do matter; computers

aren’t Turing machines; O(n log n) is great, O(n2) can be too slow to use

3 / 9

slide-8
SLIDE 8

So what’s next?

  • Algorithms! It turns out models of computation really do matter; computers

aren’t Turing machines; O(n log n) is great, O(n2) can be too slow to use

  • Sometimes, O(n2) works great and an equivalent O(n log n) algorithm takes

longer (small inputs)

3 / 9

slide-9
SLIDE 9

So what’s next?

  • Algorithms! It turns out models of computation really do matter; computers

aren’t Turing machines; O(n log n) is great, O(n2) can be too slow to use

  • Sometimes, O(n2) works great and an equivalent O(n log n) algorithm takes

longer (small inputs)

  • More computability!

3 / 9

slide-10
SLIDE 10

So what’s next?

  • Algorithms! It turns out models of computation really do matter; computers

aren’t Turing machines; O(n log n) is great, O(n2) can be too slow to use

  • Sometimes, O(n2) works great and an equivalent O(n log n) algorithm takes

longer (small inputs)

  • More computability!
  • More complexity! We’ve only scratched the surface

3 / 9

slide-11
SLIDE 11

More computability and complexity?

  • What if we give our TM access to an “oracle” that in a single step can decide a

language like ATM, what languages can you decide with this new capability?

4 / 9

slide-12
SLIDE 12

More computability and complexity?

  • What if we give our TM access to an “oracle” that in a single step can decide a

language like ATM, what languages can you decide with this new capability?

  • Time bounds aren’t the only option, we can consider space constraints too

4 / 9

slide-13
SLIDE 13

More computability and complexity?

  • What if we give our TM access to an “oracle” that in a single step can decide a

language like ATM, what languages can you decide with this new capability?

  • Time bounds aren’t the only option, we can consider space constraints too
  • What languages can you decide if you use a polynomial amount of space?

PSPACE

4 / 9

slide-14
SLIDE 14

More computability and complexity?

  • What if we give our TM access to an “oracle” that in a single step can decide a

language like ATM, what languages can you decide with this new capability?

  • Time bounds aren’t the only option, we can consider space constraints too
  • What languages can you decide if you use a polynomial amount of space?

PSPACE

  • What languages can you decide with a nondeterministic TM in a polynomial

amount of space? NSPACE(f(n)) ⊆ SPACE(f2(n)) (Savitch’s theorem); compare to time where there’s an exponential blow up

4 / 9

slide-15
SLIDE 15

More computability and complexity?

  • What if we give our TM access to an “oracle” that in a single step can decide a

language like ATM, what languages can you decide with this new capability?

  • Time bounds aren’t the only option, we can consider space constraints too
  • What languages can you decide if you use a polynomial amount of space?

PSPACE

  • What languages can you decide with a nondeterministic TM in a polynomial

amount of space? NSPACE(f(n)) ⊆ SPACE(f2(n)) (Savitch’s theorem); compare to time where there’s an exponential blow up

  • What if you have a read-only input and a logarithmic amount of space to work

with? (Effectively, you have a constant number of pointers) L

4 / 9

slide-16
SLIDE 16

More computability and complexity?

  • What if we give our TM access to an “oracle” that in a single step can decide a

language like ATM, what languages can you decide with this new capability?

  • Time bounds aren’t the only option, we can consider space constraints too
  • What languages can you decide if you use a polynomial amount of space?

PSPACE

  • What languages can you decide with a nondeterministic TM in a polynomial

amount of space? NSPACE(f(n)) ⊆ SPACE(f2(n)) (Savitch’s theorem); compare to time where there’s an exponential blow up

  • What if you have a read-only input and a logarithmic amount of space to work

with? (Effectively, you have a constant number of pointers) L

  • Same thing but with nondeterminism. NL = co-NL (bizarre!)

4 / 9

slide-17
SLIDE 17

More computability and complexity?

  • What if we give our TM access to an “oracle” that in a single step can decide a

language like ATM, what languages can you decide with this new capability?

  • Time bounds aren’t the only option, we can consider space constraints too
  • What languages can you decide if you use a polynomial amount of space?

PSPACE

  • What languages can you decide with a nondeterministic TM in a polynomial

amount of space? NSPACE(f(n)) ⊆ SPACE(f2(n)) (Savitch’s theorem); compare to time where there’s an exponential blow up

  • What if you have a read-only input and a logarithmic amount of space to work

with? (Effectively, you have a constant number of pointers) L

  • Same thing but with nondeterminism. NL = co-NL (bizarre!)
  • What if you give the TM access to randomness and allow the TM to be wrong

sometimes?

4 / 9

slide-18
SLIDE 18

More computability and complexity?

  • What if we give our TM access to an “oracle” that in a single step can decide a

language like ATM, what languages can you decide with this new capability?

  • Time bounds aren’t the only option, we can consider space constraints too
  • What languages can you decide if you use a polynomial amount of space?

PSPACE

  • What languages can you decide with a nondeterministic TM in a polynomial

amount of space? NSPACE(f(n)) ⊆ SPACE(f2(n)) (Savitch’s theorem); compare to time where there’s an exponential blow up

  • What if you have a read-only input and a logarithmic amount of space to work

with? (Effectively, you have a constant number of pointers) L

  • Same thing but with nondeterminism. NL = co-NL (bizarre!)
  • What if you give the TM access to randomness and allow the TM to be wrong

sometimes?

  • What if you require it give the right answer and “on average” takes polynomial

time but on some inputs can take more?

4 / 9

slide-19
SLIDE 19

More computability and complexity?

  • What if we give our TM access to an “oracle” that in a single step can decide a

language like ATM, what languages can you decide with this new capability?

  • Time bounds aren’t the only option, we can consider space constraints too
  • What languages can you decide if you use a polynomial amount of space?

PSPACE

  • What languages can you decide with a nondeterministic TM in a polynomial

amount of space? NSPACE(f(n)) ⊆ SPACE(f2(n)) (Savitch’s theorem); compare to time where there’s an exponential blow up

  • What if you have a read-only input and a logarithmic amount of space to work

with? (Effectively, you have a constant number of pointers) L

  • Same thing but with nondeterminism. NL = co-NL (bizarre!)
  • What if you give the TM access to randomness and allow the TM to be wrong

sometimes?

  • What if you require it give the right answer and “on average” takes polynomial

time but on some inputs can take more?

  • What if instead of TMs, you have circuits?

4 / 9

slide-20
SLIDE 20

Complexity “zoo”

L

5 / 9

slide-21
SLIDE 21

Complexity “zoo”

NL = co-NL L

5 / 9

slide-22
SLIDE 22

Complexity “zoo”

P NL = co-NL L

5 / 9

slide-23
SLIDE 23

Complexity “zoo”

RP P NL = co-NL L

5 / 9

slide-24
SLIDE 24

Complexity “zoo”

co-RP RP P NL = co-NL L

5 / 9

slide-25
SLIDE 25

Complexity “zoo”

ZPP co-RP RP P NL = co-NL L

5 / 9

slide-26
SLIDE 26

Complexity “zoo”

BPP ZPP co-RP RP P NL = co-NL L

5 / 9

slide-27
SLIDE 27

Complexity “zoo”

NP BPP ZPP co-RP RP P NL = co-NL L

5 / 9

slide-28
SLIDE 28

Complexity “zoo”

co-NP NP BPP ZPP co-RP RP P NL = co-NL L

5 / 9

slide-29
SLIDE 29

Complexity “zoo”

PSPACE = NPSPACE co-NP NP BPP ZPP co-RP RP P NL = co-NL L

5 / 9

slide-30
SLIDE 30

Complexity “zoo”

EXPTIME PSPACE = NPSPACE co-NP NP BPP ZPP co-RP RP P NL = co-NL L

5 / 9

slide-31
SLIDE 31

Exam topics

Broadly speaking: Everything through today

  • Regular languages, context-free languages
  • DFAs, NFAs, regular expressions, CFGs, PDAs, TMs
  • Conversions between the various machines, grammars, and expressions (where

doable).

  • Converting a CFG to CNF
  • Closure properties of regular, context-free, decidable, and Turing-recognizable

languages

  • Decision problems from language theory (e.g., ADFA, EQTM, ALLCFG)
  • Mapping reductions
  • Polynomial time mapping reductions
  • P, NP, EXPTIME
  • What it means for a language to be NP-complete

6 / 9

slide-32
SLIDE 32

Types of exam questions

The questions from the exam fall into these types

  • True/false questions with explanation
  • Constructions
  • Proofs
  • One extra credit problem

7 / 9

slide-33
SLIDE 33

Exam question break down (probably; the exam is still being written)

  • Five true/false questions (4 points each)
  • Two constructions (20 points each)
  • Four proofs (20 points, 15 points, 15 points, 20 points)
  • Extra credit (20 points, no partial credit)

Things that won’t be on the exam

  • Pumping lemma for context-free languages questions
  • Proving that a particular language is NP-complete (you may be asked to prove

that under some assumptions, some language is NP-complete, but you won’t be asked to give a polynomial time reduction )

8 / 9

slide-34
SLIDE 34

Examples

1 Regular languages are closed under perfect shuffle

{a1b1a2b2⋯anbn ∣ each ai, bi ∈ Σ, a1a2⋯an ∈ A and b1b2⋯bn ∈ B}

2 Turing-recognizable languages are closed under intersection 3 Prove that if A ≤p B and B ≤p C, then A ≤p C 4 Convert a CFG to a PDA 5 Composites = {⟨n⟩ ∣ n > 0 is a composite integer} ∈ NP 6 Any others you want me to do

9 / 9