25
Lecture 40 CSE 331 Dec 11, 2009

Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

  • View
    222

  • Download
    6

Embed Size (px)

Citation preview

Page 1: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

Lecture 40

CSE 331Dec 11, 2009

Page 2: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

Announcements

Solutions to HW 10 and graded HW 9 at end of the lecture

Review session on Monday: see blog for details

Blog post on finals is up

Turn in your HW 10 by 1:10PM

Page 3: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

Finals

Noon – 2:30

NSC 210

Wed, Dec 16

Page 4: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

Longest vs Shortest Paths

Page 5: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

Two sides of the “same” coin

Shortest Path problem

Can be solved by a polynomial time algorithm

Is there a longest path of length n-1?

Given a path can verify in polynomial time if the answer is yes

Page 6: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

Poly time algo for longest path?

Page 7: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

P vs NP question

P: problems that can be solved by poly time algorithms

NP: problems that have polynomial time verifiable witness to optimal solution

Is P=NP?Is P=NP?

Alternate NP definition: Guess witness and verify!Alternate NP definition: Guess witness and verify!

Page 8: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

Proving P ≠ NP

Pick any one problem in NP and show it cannot be solved in poly time

Pretty much all known proof techniques

provably will not work

Pretty much all known proof techniques

provably will not work

Page 9: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

Proving P = NP

Will make cryptography collapse

Compute the encryption key!

Compute the encryption key!

Prove that all problems in NP can be solved by polynomial time algorithms

NP

NP-complete problems

NP-complete problems

Solving any ONE problem in here in

poly time will prove P=NP!

Solving any ONE problem in here in

poly time will prove P=NP!

Page 10: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

If you are curious for more

CSE431: Algorithms

CSE 396: Theory of Computation

Page 11: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

High level view of CSE 331Problem StatementProblem Statement

AlgorithmAlgorithm

Problem DefinitionProblem Definition

“Implementation”“Implementation”

AnalysisAnalysis Correctness+Runtime Analysis

Data Structures

Three general techniques

Three general techniques

Page 12: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

Now relax…

Page 13: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

13

Coding Theory

Page 14: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

14

The setupC(x)

x

y = C(x)+error

x Give up

Mapping C Error-correcting code or just code Encoding: x C(x) Decoding: y X C(x) is a codeword

Page 15: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

15

Different Channels and Codes• Internet

– Checksum used in multiple layers of TCP/IP stack

• Cell phones• Satellite broadcast

– TV• Deep space

telecommunications– Mars Rover

Page 16: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

16

“Unusual” Channels

• Data Storage– CDs and DVDs– RAID– ECC memory

• Paper bar codes– UPS (MaxiCode)

Codes are all around us

Page 17: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

17

Redundancy vs. Error-correction

• Repetition code: Repeat every bit say 100 times– Good error correcting properties– Too much redundancy

• Parity code: Add a parity bit– Minimum amount of redundancy– Bad error correcting properties• Two errors go completely undetected

• Neither of these codes are satisfactory

1 1 1 0 0 1

1 0 0 0 0 1

Page 18: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

18

Two main challenges in coding theory

• Problem with parity example– Messages mapped to codewords which do not

differ in many places• Need to pick a lot of codewords that differ a

lot from each other

• Efficient decoding– Naive algorithm: check received word with all

codewords

Page 19: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

19

The fundamental tradeoff

• Correct as many errors as possible with as little redundancy as possible

Can one achieve the “optimal” tradeoff with efficient encoding and decoding ?

Page 20: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

20

Datastream Algorithms

Page 21: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

21

Data Streams (one application)

• Databases are huge– Fully reside in disk memory

• Main memory– Fast, not much of it

• Disk memory– Slow, lots of it– Random access is expensive– Sequential scan is reasonably

cheap

Main memory

Disk Memory

Page 22: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

22

Data Streams (one application)• Given a restriction on number

of random accesses to disk memory

• How much main memory is required ?

• For computations such as join of tables

Main memory

Disk memory

Page 23: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

Whatever your impression of the 331

IT WASIT WAS

Page 24: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

Hopefully it was fun!

Page 25: Lecture 40 CSE 331 Dec 11, 2009. Announcements Solutions to HW 10 and graded HW 9 at end of the lecture Review session on Monday: see blog for details

Thanks!