the big pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · the big...

113
The Big Picture

Upload: others

Post on 19-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

The Big Picture

Page 2: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Announcements

● Problem Set 9 due right now. We'll release solutions right after lecture.

– Congratulations – you're done with CS103 problem sets!

● Please evaluate this course on Axess! Your feedback really does make a difference.

● There's a fun and completely optional handout “Timeline of CS103 Results” up on the CS103 website. It details the history of all the results from this course.

Page 3: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Final Exam Logistics

● Final exam is Wednesday, December 9 from 3:30PM – 6:30PM in Cemex Auditorium.

● There's a practice exam up online. Solutions are now available in hardcopy in Gates.

● Please feel free to ask us questions on Piazza over the next couple of days. We want you to understand this material!

Page 4: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

The Big Picture

Page 5: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

The Big Picture

Page 6: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Cantor's Theorem: |S| < | (℘ S)|

Corollary: Unsolvable problems exist.

Page 7: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

What problems canbe solved by computers?

Page 8: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

First, we need to learn how to proveresults with certainty.

Otherwise, how can we know forsure that we're right about anything?

Page 9: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

We also should be sure we have somerules about reasoning itself.

Let's add some logic into the mix.

Page 10: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Let's study a few common discrete structures.

That way, we know how to model connected structures and relationships.

Page 11: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

We also need to prove things about processes that proceed step-by-step.

So let's learn induction.

Page 12: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Okay! So now we're ready to go!

What problems are unsolvable?

Page 13: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Well, first we need adefinition of a computer!

Page 14: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

q0

q1

q2

q3

0

1

0

1

0

1 1

0

start

q2

Page 15: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Cool! Now we have a model of a computer!

Page 16: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

We're not quite sure what we can solve atthis point, but that's okay for now.

Let's call the languages we can capturethis way the regular languages.

Page 17: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

I wonder what othermachines we can make?

Page 18: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

q1

q0

startq

2

q3

0 1

ε

q4

0 q5

0 q5

q2

0

1

Page 19: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Wow! Those new machines areway cooler than our old ones!

Page 20: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

I wonder if they're more powerful?

Page 21: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

q1

q0

startq

2

q3

0 1

ε

q4

0 q5

0 q5

q2

0

1

q03

startq

14

0

q

1

q5

0

q2

1

q2

q5

q1

0

1 0

q3

1

01

q4 0

10 1

0, 1

Page 22: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Wow! I guess not. That's surprising!

So now we have a new way of modelingcomputers with finite memory!

Page 23: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

I wonder how we can combinethese machines together?

Page 24: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

start

ε

ε

ε

start

Page 25: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Cool! Since we can gluemachines together, we can glue

languages together as well.

Page 26: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

How are we going to do that?

Page 27: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

a+(.a+)*@a+(.a+)+

Page 28: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Wow! We've got a new wayof describing languages.

Page 29: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

So what sorts of languagescan we describe this way?

Page 30: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

qs

qf

qf

q1

q2

R12

R21

R11

R22

start ε ε

ε R11

* R12

Page 31: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Awesome! We got back theexact same class of languages.

Page 32: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

It seems like all our models give us thesame power! Did we get every language?

Page 33: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

xw ∈ Lyw ∉ L

Page 34: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Wow, I guess not.

Page 35: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

But we did learn something cool:

We have just explored what problems can be solved with finite memory.

Page 36: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

So what else is out there?

Page 37: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Can we describe languages another way?

Page 38: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

S → aXX → b | CC → Cc | ε

Page 39: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Awesome!

Page 40: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

So, did we get every language yet?

Page 41: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

|Σ*| < | (℘ Σ*)|

Page 42: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Hmmm... guess not.

Page 43: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

So what if we make ourmemory a little better?

Page 44: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Clear a1

Clear a1

Go toend

Checkfor 0

Go toend

Checkfor 0

Go tostartGo tostart

start

0 → , R☐ 0 → 0, R 1 → 1, R

→ ☐ ☐, L

1 → , L☐0 → 0, L 1 → 1, L

→ ☐ ☐, R

qacc

qacc

→ ☐ ☐, R

qacc

qrej

1 → , R☐

→ ☐ ☐, R0 → 0, R

Page 45: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Cool! Can we make thesemore powerful?

Page 46: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Wow! Looks like we can'tget any more powerful.

(The Church-Turing thesis saysthat this is not a coincidence!)

Page 47: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

So why is that?

Page 48: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

UTM = “On input ⟨M, w⟩, where M is a TM and w ∈ Σ*: Set up the initial configuration of M running on w. while (true) { If M accepted w, then UTM accepts ⟨M, w⟩. If M rejected w, then UTM rejects ⟨M, w⟩. Otherwise, simulate one more step of M on w. }”

UTM = “On input ⟨M, w⟩, where M is a TM and w ∈ Σ*: Set up the initial configuration of M running on w. while (true) { If M accepted w, then UTM accepts ⟨M, w⟩. If M rejected w, then UTM rejects ⟨M, w⟩. Otherwise, simulate one more step of M on w. }”

Page 49: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Wow! Our machines cansimulate one another!

This is a theoretical justificationfor why all these models areequivalent to one another.

Page 50: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

So... can we solve everything yet?

Page 51: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

#include <iostream>#include <string>#include <vector>using namespace std;

const vector<string> kToPrint = { /* … */};

void printProgramInQuotes() { for (string line: kToPrint) { cout << " \""; for (char ch: line) { if (ch == '\"') cout << "\\\""; else if (ch == '\\') cout << "\\\\"; else cout << ch; } cout << "\"," << endl; }}

int main() { for (string line: kToPrint) { if (line == "@") printProgramInQuotes(); else cout << line << endl; }}

Page 52: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Weird! Programs can gain accessto their own source code!

Page 53: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Why does that matter?

Page 54: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

int main() {string me = mySource();string input = getInput();

if (willAccept(me, input)) {reject();

} else {accept();

}}

int main() {string me = mySource();string input = getInput();

if (willAccept(me, input)) {reject();

} else {accept();

}}

Page 55: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Crazy! The power of self-reference immediately limits what TMs can do!

Page 56: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

What if we think about solvingproblems in a different way?

Page 57: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

int main() {string me = mySource();string input = getInput();

for (each string c) {if (imConvincedWillLoop(me, input, c) {

accept();}

}}

int main() {string me = mySource();string input = getInput();

for (each string c) {if (imConvincedWillLoop(me, input, c) {

accept();}

}}

Page 58: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

No No Acc Acc No …

Acc Acc Acc Acc Acc …

Acc Acc Acc Acc Acc …

No Acc Acc Acc Acc …

Acc No Acc No No …

No No Acc Acc No …

… … … … … …

No No No Acc No Acc …

M1

M2

M0

M3

M4

M5

w0

w1

w2

w3

w4

w5 …

Acc

Acc

Acc

No

Acc

No

⟨M0⟩ ⟨M

1⟩ ⟨M

2⟩ ⟨M

3⟩ ⟨M

4⟩ ⟨M

5⟩ …

Page 59: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Oh great. Some problemsare impossible to solve.

Page 60: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

But look what we learned along the way!

Page 61: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

R

CFL

REG

RE

Page 62: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Wow. That's pretty deep.

Page 63: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

So... what can we do efficiently?

Page 64: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

PP

Page 65: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

NPN P

Page 66: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

So... how are you two related again?

Page 67: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

No clue.

Page 68: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

But what do we know about them?

Page 69: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

P

NP NP-HardNPC

Page 70: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

We've gone to the absolute limits of computing.

Page 71: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

We've probed the limits of efficient computation.

Page 72: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Congratulations on making it this far!

Page 73: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

What's next in CS theory?

Page 74: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

What problems canbe solved by computers?

Regular languagesContext-Free Languages

R and REP and NP

DFAsNFAs

Regular ExpressionsContext-Free Grammars

RecognizersDecidersVerifiers

Poly-time TMs/Verifiers

Formal languages

Page 75: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

What problems canbe solved by computers?

Interactive proof systems (CS254)Approximation algorithms (CS261/369A)

Average-case efficiency (CS264)Randomized algorithms (CS265/254)Parameterized complexity (CS266)

Communication complexity (CS369E)

Nondeterministic TMs (CS154)Enumerators (CS154)

Oracle machines (CS154)Space-Bounded TMs (CS154/254)

Machines with Advice (CS254/354)Streaming algorithms (CS263)μ-Recursive functions (CS258)Quantum computers (CS259Q)

Circuit complexity (CS354)

Function problems (CS254)Counting problems (CS254)

Page 76: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

How do we actually get the computer to effectively solve problems?

DFA design intuitionsGuess-and-check

Massive parallelismMyhill-Nerode lower bounds

VerificationPolynomial-time reductions

Page 77: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

How do we actually get the computer to effectively solve problems?

Algorithm design (CS161)Efficient data structures (CS166)

Modern algorithmic techniques (CS168)Approximation algorithms (CS261/CS369A)Average-case efficient algorithms (CS264)

Randomized algorithms (CS265)Parameterized algorithms (CS266)

Geometric algorithms (CS268)Game-theoretic algorithms (CS364A/B)

Page 78: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

What mathematical structuresarise in computer science?

SetsPropositional and First-Order Logic

Equivalence RelationsStrict Orders

FunctionsInjections, Surjections, Bijections

GraphsPlanar and Bipartite GraphsPolynomial-Time Reductions

Page 79: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

What mathematical structuresarise in computer science?

Groups, Rings, and Fields (Math 120, CS255)Trees (Math 108, CS161)

Hash Functions (CS109, CS161, CS255)Permutations (Math 120, CS255)

Monoids (CS149)Lattices and Semilattices (CS143)

Control-Flow Graphs (CS143)Vectors and Matrices (Math 113, CS205A)

Markov Decision Processes (CS221, CS229)Modal Logic (Phil 154, CS224M)

Mapping Reductions (CS154)

Page 80: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Where does CS theorymeet CS practice?

Finite state machinesRegular expressions

CFGs and programming languagesPassword-checking

Autograding“This program is not responding”

Polynomial-time reducibilityNP-hardness and NP-completeness

Page 81: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Where does CS theorymeet CS practice?

Compilers (CS143)Computational logic (CS157)

Program optimization (CS243)Data mining (CS246)

Cryptography (CS255)Programming languages (CS258)

Network protocol analysis (CS259)Techniques in big data (CS263)

Graph algorithms (CS267)Computational geometry (CS268)Algorithmic game theory (CS364)

Page 82: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

A Whole World of Theory Awaits!

Page 83: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

What's being done here at Stanford?

Page 84: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Hardness results for easy problems(Virginia Williams)

Page 85: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Algorithms ∩ Game theory(Tim Roughgarden)

Page 86: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Learning patterns in randomness(Greg Valiant)

Page 87: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Approximating NP-Hard Problems(Moses Charikar)

Page 88: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Optimizing programs... randomly(Alex Aiken)

Page 89: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Computing on encrypted data(Dan Boneh)

Page 90: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Interpreting structure from shape(Leonidas Guibas)

Page 91: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Lower bounds from upper bounds(Ryan Williams)

Page 92: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

So many options – what to do next?

Page 93: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Really enjoyed this class?Give CS154 a try!

Page 94: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Interested in trying out CS?Continue on to CS109!

Page 95: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Want to see this material come to life?Check out CS143!

Page 96: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Want to tame infinity?Dive into Math 161!

Page 97: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Like discrete structures?Try Math 108!

Page 98: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Want to just go write code?Take CS107!

Page 99: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Keep on exploring! There'sso much more to learn!

Page 100: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

A Final “Your Questions”

Page 101: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

“Hi Keith! We've been talking a lot about this million dollar question of whether or not P = NP and I was wondering if you

ever took a shot at trying to solve this. If so how did you approach it?”

I did! I had the idea that you could give a TM a black box that has exactly one unlock code and that you

could use that to show that there's a problem in NP that isn't in P. Turns out that doesn't work – there's no way to express a “black box” as input to a TM – but it did introduce me to the idea of “promise problems,”

which are an active area of research!

I did! I had the idea that you could give a TM a black box that has exactly one unlock code and that you

could use that to show that there's a problem in NP that isn't in P. Turns out that doesn't work – there's no way to express a “black box” as input to a TM – but it did introduce me to the idea of “promise problems,”

which are an active area of research!

Page 102: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

“What will be your New Year's resolution?”

Work less. Stress less. Worry less. Do more.

Work less. Stress less. Worry less. Do more.

Page 103: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

“What's your favorite topic from 103? Why?”

For me, it's the interplay between undecidability,

unrecognizability, and the nature of mathematical truth.

For me, it's the interplay between undecidability,

unrecognizability, and the nature of mathematical truth.

Page 104: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

“Are you a one-boxer or a two-boxer for Newcomb's problem?”

So let's talk about Newcomb's paradox.

So let's talk about Newcomb's paradox.

Page 105: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Box A Box B

Box A always has $1,000 in it.

You need to decide whether to take the contents of box A, or thecontents of box A and box B.

If the Predictor guesses that you'll take just box B, then she puts$1,000,000 into box B before the game begins.

If the Predictor guesses that you'll take just box B, then she putsnothing into box B before the game begins.

Question: Do you choose to take both boxes, or just box B?

Page 106: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Anything else?

Page 107: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography
Page 108: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Final Thoughts

Page 109: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

There are more problems tosolve than there are programs

capable of solving them.

Page 110: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

There is so much more to explore and so many big questions to ask – many of

which haven't been asked yet!

Page 111: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

Theory

Practice

Page 112: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

You now know what problems we can solve, what problems we can't solve, and what

problems we believe we can't solve efficiently.

Page 113: The Big Pictureweb.stanford.edu/class/archive/cs/cs103/cs103.1164/fall1516/lectur… · The Big Picture. The Big Picture . Cantor's Theorem: |S ... Data mining (CS246) Cryptography

My questions to you:

What problems will you choose to solve?Why do those problems matter to you?And how are you going to solve them?