Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 What can a computer be commanded to do?

Slides:



Advertisements
Similar presentations
22C:19 Discrete Math Algorithms and Complexity
Advertisements

CS211 Problems: unsolvable, unfeasible and unsolved Topic 3: P and NP.
1 The Limits of Computation Intractable and Non-computable functions.
CSE115/ENGR160 Discrete Mathematics 02/28/12
CompSci Recursion & Minimax Playing Against the Computer Recursion & the Minimax Algorithm Key to Acing Computer Science If you understand everything,
CSE332: Data Abstractions Lecture 27: A Few Words on NP Dan Grossman Spring 2010.
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.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Analysis of Algorithms CS 477/677
Complexity (Running Time)
Chapter 11: Limitations of Algorithmic Power
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 22 Instructor: Paul Beame.
Complexity Issues Mark Allen Weiss: Data Structures and Algorithm Analysis in Java Lydia Sinapova, Simpson College.
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.
NP-complete and NP-hard problems. Decision problems vs. optimization problems The problems we are trying to solve are basically of two kinds. In decision.
Halting Problem. Background - Halting Problem Common error: Program goes into an infinite loop. Wouldn’t it be nice to have a tool that would warn us.
1.1 Chapter 1: Introduction What is the course all about? Problems, instances and algorithms Running time v.s. computational complexity General description.
1 Complexity Lecture Ref. Handout p
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:
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.
1 Growth of Functions CS 202 Epp, section ??? Aaron Bloomfield.
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.
Analysis of Algorithms
Welcome – You’ve found CSE120 OR Computer Science Principles OR UWIT…  Announcements are usually listed here and displayed before the start of class 
MIT and James Orlin1 NP-completeness in 2005.
22C:19 Discrete Structures Algorithms and Complexity Fall 2014 Sukumar Ghosh.
Unsolvability and Infeasibility. Computability (Solvable) A problem is computable if it is possible to write a computer program to solve it. Can all problems.
CSC 413/513: Intro to Algorithms NP Completeness.
Complexity Non-determinism. NP complete problems. Does P=NP? Origami. Homework: continue on postings.
Cliff Shaffer Computer Science Computational Complexity.
Halting Problem Introduction to Computing Science and Programming I.
CSE373: Data Structures & Algorithms Lecture 22: The P vs. NP question, NP-Completeness Lauren Milne Summer 2015.
Erdal Kose CC30.10 These slides are based of Prof. N. Yanofsky Lecture notes.
Georgia Institute of Technology Speed part 6 Barb Ericson Georgia Institute of Technology May 2006.
CS106X – Programming Abstractions in C++ Cynthia Bailey Lee CS2 in C++ Peer Instruction Materials by Cynthia Bailey Lee is licensed under a Creative Commons.
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.
CS 206 Introduction to Computer Science II 01 / 30 / 2009 Instructor: Michael Eckmann.
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 2430 Day 30. Announcements Quiz #5: 4/19 Agenda Big O Searching –Linear search.
Complexity © 2014 Project Lead The Way, Inc.Computer Science and Software Engineering.
Chapter VI What should I know about the sizes and speeds of computers?
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
CS216: Program and Data Representation University of Virginia Computer Science Spring 2006 David Evans Lecture 8: Crash Course in Computational Complexity.
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.
CompSci Recursion & Minimax Recursion & the Minimax Algorithm Key to Acing Computer Science If you understand everything, ace your computer science.
Copyright © 2014 Curt Hill Algorithm Analysis How Do We Determine the Complexity of Algorithms.
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.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
Introduction to Computing Science and Programming I
Unsolvable Problems December 4, 2017.
CS 2210 Discrete Structures Algorithms and Complexity
ASU 101: The ASU Experience Computer Science Perspective
Analysis and design of algorithm
Complexity Computer Science and Software Engineering
CS 2210 Discrete Structures Algorithms and Complexity
Chapter 11 Limitations of Algorithm Power
CS 150: Computing - From Ada to the Web
Algorithms CSCI 235, Spring 2019 Lecture 36 P vs
Announcements Jack group member by Thursday!! Quiz-8? HW10
CS 2210 Discrete Structures Algorithms and Complexity
Presentation transcript:

Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 What can a computer be commanded to do?

 Are computers fast or slow? 10/29/2015© 2010 Larry Snyder, CSE2

 How much time does it take to clean a stack of dirty dishes?  How much time does it take to mow alawn?  How much time does it take to read a bunch of s?  How much time does it take to sum a bunch of numbers?  CS folks say that problems whose work is proportional to n are n-time or linear time 10/29/2015© 2010 Larry Snyder, CSE3

 How much time does it take to sort stuff? Algorithm? 1. Selection sort 2. Insertion sort 3. Bubble sort Better algorithms? 10/29/2015© 2010 Larry Snyder, CSE4

 Other computations have running time  proportional to n3 – matrix multiplication  proportional to n4  …  All of them are lumped together as “polynomial time computations”  Considered to be realistic … a person can wait  Polynomial, but not linear … get a computer person to help develop your solution 10/29/2015© 2010 Larry Snyder, CSE5

There are more complex computations … Traveling Salesman: find the cheapest route between 10 cities, never revisit a city. Brute force: try all possible routes. How many do you have to try? This seems very dumb … isn’t their a better way? 10/29/2015© 2010 Larry Snyder, CSE6

 Actually, no one knows a way to solve this problem significantly faster than checking all routes and picking the cheapest …  This is an NP-Complete problem  Many many related problems … the best solution is “generate and check” ▪ Best way to pack a container ship ▪ Most efficient scheduling for high school students’ classes ▪ Least fuel to deliver UPS packages in Washington ▪ Fewest public alert broadcast stations for US 10/29/2015© 2010 Larry Snyder, CSE7

 Although there are thousands of NP-Hard Problems, meaning they’re basically “generate and check” …  NP-Complete computations (like traveling salesman) have the property that if any one of them can be done fast (n x -time, say) then EVERYONE of the related problems can be too!  Is Traveling Salesman solvable in n x time is one of the great open questions in computer science 10/29/2015© 2010 Larry Snyder, CSE8 Be Famous … Answer This Question

 Some problems are too big – combinatorial explosive – like checking each chess game to see if there is a guaranteed win for White  Too many items to check  Doable in principle, however 10/29/2015© 2010 Larry Snyder, CSE9

 Some problems just can’t be solved no matter what!  This seems pretty easy … though running it won’t work because it might not stop … but maybe analysis could find any errors 10/29/2015© 2010 Larry Snyder, CSE10 Halting Problem Decide, given a program P and input Q whether P(Q), that is, P run on input Q, will eventually stop running and give an answer

 The halting problem cannot be solved  Here’s why …  Suppose (for purposes of contradiction) that some program H(P, Q) answers the halting problem (will it halt and give an answer) for program P on data Q  Notice the question is not, does it give the RIGHT answer … just will it give any answer 10/29/2015© 2010 Larry Snyder, CSE11

 We have analyzed the complexity of computations, and learned …  Many computations have time proportional to n  Many, like sort, have running time proportional to n 2  Others have running time proportional to n 3, n 4, …  Some computations are computable in principle but not in practice: NP-complete  Some things cannot be computed at all, such as the Halting Problem 10/29/2015© 2010 Larry Snyder, CSE12