• No results found

Foundations of Computer Science Lecture 28 Efficiency: The Class P, NPand NP-Completeness

N/A
N/A
Protected

Academic year: 2022

Share "Foundations of Computer Science Lecture 28 Efficiency: The Class P, NPand NP-Completeness"

Copied!
20
0
0

Loading.... (view fulltext now)

Full text

(1)

Foundations of Computer Science Lecture 28

Efficiency: The Class P, NPand NP-Completeness

Running Time

Efficiently Solvable Problems

Boundary Between Efficient and Inefficient

(2)

Last Time

1

Computer: Universal Turing Machine U

tm

2

Program and Input: hM i # w . U

tm

simulates M on w .

3

No Program Verifier, no Ultimate-Debugger, no PCP-Solver.

4

No means No.

(3)

The Path Forward: Focus on Decidable Problems

FOCS

(4)

The Path Forward: Focus on Decidable Problems

FOCS

T h e o r y o f C o m p u t in g c r e t e M a t h

(5)

The Path Forward: Focus on Decidable Problems

FOCS

T h e o r y o f C o m p u t in g D is c r e t e M a t h

Decider Utm=computer TM = Algorithm

CFG Parsing

DFA RegExp

(6)

The Path Forward: Focus on Decidable Problems

FOCS

T h e o r y o f C o m p u t in g c r e t e M a t h

Decider Utm=computer TM = Algorithm

CFG Parsing

DFA RegExp

Proof, logic INDUCTION

Recursion Struct. Induction

Sums, Asymptotics

Number theory

(7)

The Path Forward: Focus on Decidable Problems

FOCS

T h e o r y o f C o m p u t in g D is c r e t e M a t h

Decider Utm=computer TM = Algorithm

CFG Parsing

DFA RegExp

Proof, logic INDUCTION

Recursion Struct. Induction

Sums, Asymptotics

Number theory

Graphs

Counting

Probability Multivariate Calc.

Linear Algebra Probability Theory Graph theory

(8)

The Path Forward: Focus on Decidable Problems

FOCS

T h e o r y o f C o m p u t in g c r e t e M a t h

Decider Utm=computer TM = Algorithm

CFG Parsing

DFA RegExp

Proof, logic INDUCTION

Recursion Struct. Induction

Sums, Asymptotics

Number theory Multivariate Calc.

Linear Algebra Probability Theory Graph theory

FAST (P) Polynomial FAST (NP) Unbounded Parallelism SLOW Exponential Boolean Circuits efficiency

P = NP ?

Chapters 28 & 29

(9)

The Path Forward: Focus on Decidable Problems

FOCS

T h e o r y o f C o m p u t in g D is c r e t e M a t h

Decider Utm=computer TM = Algorithm

CFG Parsing

DFA RegExp

Proof, logic INDUCTION

Recursion Struct. Induction

Sums, Asymptotics

Number theory

Graphs

Counting

Probability Multivariate Calc.

Linear Algebra Probability Theory Graph theory

FAST (P) Polynomial FAST (NP) Unbounded Parallelism SLOW Exponential Boolean Circuits efficiency

P = NP ?

Chapters 28 & 29

Introduction to Algorithms Computability&Complexity

(10)

The Path Forward: Focus on Decidable Problems

FOCS

T h e o r y o f C o m p u t in g c r e t e M a t h

Decider Utm=computer TM = Algorithm

CFG Parsing

DFA RegExp

Proof, logic INDUCTION

Recursion Struct. Induction

Sums, Asymptotics

Number theory Multivariate Calc.

Linear Algebra Probability Theory Graph theory

FAST (P) Polynomial FAST (NP) Unbounded Parallelism SLOW Exponential Boolean Circuits efficiency

P = NP ?

Chapters 28 & 29

Introduction to Algorithms Computability&Complexity

Algorithms & DS – Approximation – Randomized – Distributed

Cryptography Data

– ML/AI/DM/NLP – Vision

– Graphics – Comp. Finance

Networks – Computers – Social

– Data (e.g. www) Robotics

Security

Programming Languages – Compilers

– Distributed Program Analysis – Testing

– Verification

Theory Algorithms

AI

(11)

The Path Forward: Focus on Decidable Problems

FOCS

T h e o r y o f C o m p u t in g D is c r e t e M a t h

Decider Utm=computer TM = Algorithm

CFG Parsing

DFA RegExp

Proof, logic INDUCTION

Recursion Struct. Induction

Sums, Asymptotics

Number theory

Graphs

Counting

Probability Multivariate Calc.

Linear Algebra Probability Theory Graph theory

FAST (P) Polynomial FAST (NP) Unbounded Parallelism SLOW Exponential Boolean Circuits efficiency

P = NP ?

Chapters 28 & 29

Introduction to Algorithms

Computer Organization

Principles of Software Computability&Complexity

Algorithms & DS – Approximation – Randomized – Distributed

Cryptography Data

– ML/AI/DM/NLP – Vision

– Graphics – Comp. Finance

Networks – Computers – Social

– Data (e.g. www) Robotics

Security

Programming Languages – Compilers

– Distributed Program Analysis – Testing

– Verification DB Systems Parallel computing Operating systems

Architecture

Theory Algorithms

AI

Software Systems

(12)

Today: Efficiency: The Class P, NPand NP-Completeness

1

Time complexity: Asymptotic worst-case analysis.

2

The class P: Efficiently solvable problems.

3

Polynomial on one architecture means polynomial on pretty much any architecture.

(13)

Running Time

(14)

Time Complexity

(15)

Two Tapes vs. One Tape

(16)

Decidable But Non -Polynomial

(17)

Boundary Between Efficient and Inefficient

(18)

. . . the high technology so celebrated today is essentially a mathematical technology.

“To err is human, but to really foul things up you need a computer.” – Paul Ehrlich

(19)

. . . the high technology so celebrated today is essentially a mathematical technology.

“To err is human, but to really foul things up you need a computer.” – Paul Ehrlich

Mariner rocket explodes (1962). Formula into code bug resulted in no smoothing of deviations.

WWWIII (1983)? Soviet EWS detects 5 US-missiles (bug detected sunlight reflections).

Luckily Stanislav “funny feeling in my gut” Petrov thought: “surely they’d use more missiles?”

Therac 25 (1985). Concurrent programming bug killed patients through massive 100× radiation overdose.

AT&T Lines Go Dead (1990). 75 million calls dropped (one line of buggy code in software upgrade).

Patriot missile defense fails (1991). 28 soldiers dead, 100 injured (rounding error in scud-detection).

Pentium floating point long-division bug (1993). Cost: $475 million – flawed division table.

Ariane rocket explosion (1996). Cost: $500 million – overflow in 64-bit to 16-bit conversion.

Y2K (1999). Cost: $500 billion spent because year was stored as 2 digits to save space.

Mars Climate Orbiter Crash (1998). Cost: $125 million lost due to metric to imperial units bug.

Tesla Self-Driving Car (2016). 1 dead. Auto-pilot didn’t “see” tractor-trailer.

Financial Disasters: London Stock Exchange down due to single server bug (2009; billions of pounds of trading);

Knight Capital computer glitch trigers stock sale (2012; 500 million lost and Knight’s value drops by 75%).

Airline Disasters:

AirFrance 447 2009, 228 dead: pitot-tube failure feeds inconsistent data to programs which then panic pilot.

Spanair 5022, 2008, 154 dead: malware virus.

AdamAir 574, 2007, 102 dead: navigation system errors (and pilot errors).

KoreanAir 801, 1997, 228 dead: ground proximity warning system bug.

AeroPerú 603, 1996, 70 dead: altimeter failures.

Scottish RAF Chinook, 1994, 29 dead: faulty test program

AirFrance 296, 1988, 3 dead: altimeter bug.

IranAir 655, 1988, 290 dead: shot down by US Aegis combat system (misidentified as attacking military plane).

KoreanAir 007, 1983, 269 dead: autopilot took plane into Soviet airspace where it got shot down.

Boeing 737 Max, 2018,2019, 346 dead: attack sensor + algorithm errors.

(20)

. . . the high technology so celebrated today is essentially a mathematical technology.

“To err is human, but to really foul things up you need a computer.” – Paul Ehrlich

Mariner rocket explodes (1962). Formula into code bug resulted in no smoothing of deviations.

WWWIII (1983)? Soviet EWS detects 5 US-missiles (bug detected sunlight reflections).

Luckily Stanislav “funny feeling in my gut” Petrov thought: “surely they’d use more missiles?”

Therac 25 (1985). Concurrent programming bug killed patients through massive 100× radiation overdose.

AT&T Lines Go Dead (1990). 75 million calls dropped (one line of buggy code in software upgrade).

Patriot missile defense fails (1991). 28 soldiers dead, 100 injured (rounding error in scud-detection).

Pentium floating point long-division bug (1993). Cost: $475 million – flawed division table.

Ariane rocket explosion (1996). Cost: $500 million – overflow in 64-bit to 16-bit conversion.

Y2K (1999). Cost: $500 billion spent because year was stored as 2 digits to save space.

Mars Climate Orbiter Crash (1998). Cost: $125 million lost due to metric to imperial units bug.

Tesla Self-Driving Car (2016). 1 dead. Auto-pilot didn’t “see” tractor-trailer.

Financial Disasters: London Stock Exchange down due to single server bug (2009; billions of pounds of trading);

Knight Capital computer glitch trigers stock sale (2012; 500 million lost and Knight’s value drops by 75%).

Airline Disasters:

AirFrance 447 2009, 228 dead: pitot-tube failure feeds inconsistent data to programs which then panic pilot.

Spanair 5022, 2008, 154 dead: malware virus.

AdamAir 574, 2007, 102 dead: navigation system errors (and pilot errors).

KoreanAir 801, 1997, 228 dead: ground proximity warning system bug.

AeroPerú 603, 1996, 70 dead: altimeter failures.

Scottish RAF Chinook, 1994, 29 dead: faulty test program

References

Related documents

The promising compounds to be further developed as anticancer agents against each cancer cell line are summarized in Table  5 , obviously, meta - triazoles 8N , 1P and 8Q for

In other words within polynomial time it returns YES∨NO if a path of length less than or equal to k from vertex s to vertex t.. Since the graph is connected we know there is a path

Source: http://en wikipedia org/wiki/Traveling salesman problem

Alex Angelopoulos (NTUA) FoCS: Reductions & NP-completeness-• Traveling Salesman Problem (TSP)

Near-Term Actions Potential pilot Long-Term Strategy With Triggers B1 B2 C A B Preferred Alternatives P-1 P-2 P-3 P-4 P-5 P-6 P-7 P-8 NP-2 NP-3 NP-5 Portfolios of Preferred

Decision problem polynomial-time (Karp) reduces to decision problem if given any instance of , we can construct an instance of in polynomial time s.t if and only

For end users, when the mobile broadband device is connected, Windows 8 automatically installs the Metro style device app for mobile broadband and associated service metadata,

To maintain the calibration point for an extended working range, you will need to continuously power the actuator, for example by an UPS (Uninterrupted Power Supply). Please