Complexity © 2014 Project Lead The Way, Inc.Computer Science and Software Engineering.

Slides:



Advertisements
Similar presentations
CS211 Problems: unsolvable, unfeasible and unsolved Topic 3: P and NP.
Advertisements

1 The Limits of Computation Intractable and Non-computable functions.
The Theory of NP-Completeness
CPE702 Complexity Classes Pruet Boonma Department of Computer Engineering Chiang Mai University Based on Material by Jenny Walter.
Theory of Computing Lecture 16 MAS 714 Hartmut Klauck.
CSE373: Data Structures & Algorithms Lecture 24: The P vs. NP question, NP-Completeness Nicki Dell Spring 2014 CSE 373 Algorithms and Data Structures 1.
Complexity Theory CSE 331 Section 2 James Daly. Reminders Project 4 is out Due Friday Dynamic programming project Homework 6 is out Due next week (on.
Tractable and intractable problems for parallel computers
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 Graphs.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 21 Instructor: Paul Beame.
The Theory of NP-Completeness
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
P versus NP and Cryptography Wabash College Mathematics and Computer Science Colloquium Nov 16, 2010 Jeff Kinne, Indiana State University (Theoretical)
Analysis of Algorithms CS 477/677
CS10 The Beauty and Joy of Computing Lecture #23 : Limits of Computing Thanks to the success of the Kinect, researchers all over the world believe.
1 Section 2.3 Complexity of Algorithms. 2 Computational Complexity Measure of algorithm efficiency in terms of: –Time: how long it takes computer to solve.
Chapter 12 Cryptography Explained. Search Problems Specified by an algorithm C Two inputs ◦ I is the instance. ◦ S is the solution. ◦ Must complete in.
Programming & Data Structures
Chapter 11 Limitations of Algorithm Power. Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples:
Computational Complexity Polynomial time O(n k ) input size n, k constant Tractable problems solvable in polynomial time(Opposite Intractable) Ex: sorting,
Scott Perryman Jordan Williams.  NP-completeness is a class of unsolved decision problems in Computer Science.  A decision problem is a YES or NO answer.
Complexity Classes (Ch. 34) The class P: class of problems that can be solved in time that is polynomial in the size of the input, n. if input size is.
1 Ethics of Computing MONT 113G, Spring 2012 Session 13 Limits of Computer Science.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
MIT and James Orlin1 NP-completeness in 2005.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
What is Computer Science About? Part 2: Algorithms.
CSCI 2670 Introduction to Theory of Computing December 1, 2004.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
Complexity Non-determinism. NP complete problems. Does P=NP? Origami. Homework: continue on postings.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 What can a computer be commanded to do?
Cliff Shaffer Computer Science Computational Complexity.
CSE373: Data Structures & Algorithms Lecture 22: The P vs. NP question, NP-Completeness Lauren Milne Summer 2015.
Georgia Institute of Technology Speed part 6 Barb Ericson Georgia Institute of Technology May 2006.
3.3 Complexity of Algorithms
Beauty and Joy of Computing Limits of Computing Ivona Bezáková CS10: UC Berkeley, April 14, 2014 (Slides inspired by Dan Garcia’s slides.)
SNU OOPSLA Lab. 1 Great Ideas of CS with Java Part 1 WWW & Computer programming in the language Java Ch 1: The World Wide Web Ch 2: Watch out: Here comes.
CS10: The Beauty and Joy of Computing Lecture #22 Limits of Computing Warning sign posted at Stern Hall. Also, Apple releases new operating.
Limits to Computation How do you analyze a new algorithm? –Put it in the form of existing algorithms that you know the analysis. –For example, given 2.
CS 206 Introduction to Computer Science II 09 / 18 / 2009 Instructor: Michael Eckmann.
Optimization Problems
04/04/13 Algorithms and NP Discrete Structures (CS 173) Derek Hoiem, University of Illinois 1.
CS 206 Introduction to Computer Science II 01 / 30 / 2009 Instructor: Michael Eckmann.
Complexity & Computability. Limitations of computer science  Major reasons useful calculations cannot be done:  execution time of program is too long.
Week 13 - Monday.  What did we talk about last time?  B-trees  Hamiltonian tour  Traveling Salesman Problem.
CPS Computational problems, algorithms, runtime, hardness (a ridiculously brief introduction to theoretical computer science) Vincent Conitzer.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
The Beauty and Joy of Computing Lecture #23 Limits of Computing Researchers at Facebook and the University of Milan found that the avg # of “friends” separating.
CS 150: Analysis of Algorithms. Goals for this Unit Begin a focus on data structures and algorithms Understand the nature of the performance of algorithms.
Chapter VI What should I know about the sizes and speeds of computers?
CS216: Program and Data Representation University of Virginia Computer Science Spring 2006 David Evans Lecture 8: Crash Course in Computational Complexity.
Young CS 331 D&A of Algo. NP-Completeness1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and.
Introduction to NP-Completeness Tahir Azim. The Downside of Computers Many problems can be solved in linear time or polynomial time But there are also.
Optimization/Decision Problems Optimization Problems – An optimization problem is one which asks, “What is the optimal solution to problem X?” – Examples:
1 Computability Tractable, Intractable and Non-computable functions.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 23: Intractable Problems (Smiley Puzzles.
1 P and NP. 2 Introduction The Traveling Salesperson problem and thousands of other problems are equally hard in the sense that if we had an efficient.
Algorithm Complexity By: Ashish Patel and Alex Golebiewski.
Hard Problems Some problems are hard to solve.  No polynomial time algorithm is known.  E.g., NP-hard problems such as machine scheduling, bin packing,
CS10: The Beauty and Joy of Computing Lecture #21 Limits of Computing Instructor: Sean Morris UCB announces The Turing Test Tournament.
Chapter 10 NP-Complete Problems.
University of British Columbia
Week 10 - Monday CS 113.
Lecture 22 Complexity and Reductions
Unsolvable Problems December 4, 2017.
Complexity Computer Science and Software Engineering
Discrete Mathematics CS 2610
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
What is Computer Science About? Part 2: Algorithms
Algorithms CSCI 235, Spring 2019 Lecture 36 P vs
Presentation transcript:

Complexity © 2014 Project Lead The Way, Inc.Computer Science and Software Engineering

Constraints: –Limited time to execute –Limited bandwidth –Limited memory to store the program –Limited memory for input/output data These constraints trade off against each other Often readability is more important than any of these Computers Have Finite Resources

Time efficiency: How much time does a program take to run? Time complexity of a solution: How much more time will a program take to run if given more bytes as input? How Fast Is a Solution?

Time complexity described by the type of curve showing time vs. input bytes Brute force, an algorithm in which you try all possibilities, takes exponentially longer with longer passwords How Fast Is a Solution?

Consider passwords with a-z,A-Z,0-9 which allows =62 characters Why Is Brute Force Exponential? bytespasswords to try n62 n

Exponential growth will outpace any other kind of growth Make brute force impractical by using long passwords Exponential Curve Gets Ahead of Others

Time complexity of a problem is the time complexity of its best solution The algorithm might be quick with special input even if it is long. We describe difficulty using the worst-case input. How Hard Is a Problem?

Some problems are so hard the program might never finish. Computable problems can be solved by a computer Analyzing programs is often uncomputable –Halting Theorem: "Will this program ever finish?" is sometimes uncomputable –Security analysis: "Does any input crash this program?" is often uncomputable Computability

One-way functions are more time- consuming to undo than to do RSA encryption keys (used for HTTPS) are hard to crack because multiplying is faster than factoring Multiplying big prime numbers is a one- way function Encryption and Time Complexity

Linear time complexity: Twice as much input takes twice as much time Time Complexity

Quadratic time complexity: –Double the input  4x the time –Triple the input  9x the time Time Complexity

Factoring takes longer than quadratic time. So prime numbers can keep our secrets safe... maybe. Encryption Keys Broken by Factoring

Feel free to appreciate the beauty without getting into details An Adventure to the Edge of Math

One of seven six unsolved Millennium Problems ("Million Dollar Questions") If proved (or disproved), these problems would tell us a lot about what computers can or cannot do –We don't know "how hard" some problems are –Are the hardest "NP problems" (pictured below) solvable in polynomial time? Does P=NP?

Time to solve a P problem grows like n some number Time to check an NP problem grows like some number n Does P=NP? The Details

If a problem can be checked in reasonable time, can it be solved in reasonable time? NP-Complete problems are the hard ones. They've been shown to be equivalent to each other. Three famous NP-Complete problems with many applications –Travelling Salesperson –Knapsack Problem –3-Color a Graph Does P=NP? We Don't Know!

What is the shortest route visiting all these cities? NP-Complete Problems: Travelling Salesperson Problem

NP-Complete Problems: Knapsack Problem Choice of items that have weight and value Maximize value without exceeding maximum weight 10 lbs $ lbs $220 3 lbs $40 3 lbs $40 5 lbs $70 3 lbs $40 3 lbs $40 5 lbs $70 5 lbs $70 5 lbs $70

Color all nodes using 3 colors total Adjacent nodes must not share color NP-Complete: 3-Color a Graph

Another 3-Coloring Problem

Can You 3-Color It?