CS 150: Computing - From Ada to the Web

Slides:



Advertisements
Similar presentations
CS6800 Advanced Theory of Computation
Advertisements

JAYASRI JETTI CHINMAYA KRISHNA SURYADEVARA
1 The Limits of Computation Intractable and Non-computable functions.
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.
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.
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.
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.
Matt Schierholtz. Method for solving problems with finite steps Algorithm example: Error Check for problem Solve problem Must terminate.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
CSC 413/513: Intro to Algorithms NP Completeness.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 What can a computer be commanded to do?
Cliff Shaffer Computer Science Computational Complexity.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
Beauty and Joy of Computing Limits of Computing Ivona Bezáková CS10: UC Berkeley, April 14, 2014 (Slides inspired by Dan Garcia’s slides.)
NP-complete Problems Prof. Sin-Min Lee Department of Computer Science.
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.
Module #7: Algorithmic Complexity Rosen 5 th ed., §2.3.
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.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Computer Science: An Overview Eleventh Edition by J. Glenn Brookshear Chapter.
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.
Lecture. Today Problem set 9 out (due next Thursday) Topics: –Complexity Theory –Optimization versus Decision Problems –P and NP –Efficient Verification.
Copyright © 2014 Curt Hill Algorithm Analysis How Do We Determine the Complexity of Algorithms.
1 Computability Tractable, Intractable and Non-computable functions.
Intro to Data Structures Concepts ● We've been working with classes and structures to form linked lists – a linked list is an example of something known.
Modeling Arithmetic, Computation, and Languages Mathematical Structures for Computer Science Chapter 8 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesTuring.
Recursion You may have seen mathematical functions defined using recursion Factorial(x) = 1 if x
NP-Complete Problems.
Intractable Problems Time-Bounded Turing Machines Classes P and NP
Recursion Topic 5.
Chapter 12: Theory of Computation
Francisco Antonio Doria
1.5 Intractable problems.
Hard Problems Introduction to NP
Unsolvable Problems December 4, 2017.
Ch. 11 Theory of Computation
HIERARCHY THEOREMS Hu Rui Prof. Takahashi laboratory
Types of Algorithms.
Q Jeff Kinne.
Efficiency (Chapter 2).
Analysis and design of algorithm
Chapter 1: Introduction
Intractable Problems Time-Bounded Turing Machines Classes P and NP
CSCE 411 Design and Analysis of Algorithms
Algorithm An algorithm is a finite set of steps required to solve a problem. An algorithm must have following properties: Input: An algorithm must have.
Fundamentals of Programming
Types of Algorithms.
How Hard Can It Be?.
Module #7: Algorithmic Complexity
Intractable Problems Time-Bounded Turing Machines Classes P and NP
Approximation Algorithms
CLASSES P AND NP.
Halting Problem.
RECURSION Annie Calpe
Module #7: Algorithmic Complexity
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
Types of Algorithms.
Programming with data Lecture 3
CSC 380: Design and Analysis of Algorithms
Algorithms CSCI 235, Spring 2019 Lecture 36 P vs
RAIK 283 Data Structures & Algorithms
The Do’s & Don’ts of Effective Research
What is Computer Science at Duke?
Announcements Jack group member by Thursday!! Quiz-8? HW10
Week 11 - Wednesday CS221.
Complexity Theory: Foundations
Presentation transcript:

CS 150: Computing - From Ada to the Web Complexity and Computability Professor Greg Humphreys

Think back… What sort of things have we programmed so far? We’ve generated poetry (and other things) from grammars We’ve recursively solved numeric problems We’ve generated Mandelbrot and Julia fractal We’ve tested some aspects of the web Now you’re building a web application that links together PHP, MySQL, and Google Maps Surely there is nothing that a computer cannot do!

Well, hold on there… That can’t be right. There must be some limits. What type of limits are we referring to though? We’ve already discussed complexity limits a little bit. How long did it take to run your Mandelbrot program? How “bad” was the recursive Fibonacci algorithm?

Complexity Limits Computers are not infinite Limited memory Limited disk space Limited time to run the program We can define algorithms for many, many different problems… … however sometimes our algorithms just aren’t good enough. Would you like to use the recursive Fibonacci algorithm to calculate Fib(945493)?

P P: Polynomial algorithms Includes the algorithms we've seen so far Mergesort Binary search Mandelbrot generation Anything with running times on the order of nlgn and n^2. Running times like n^3 and n^4, though considerably slower, are also polynomial time.

Intractable Problems Problems that are solvable in theory, but cannot be solved in practice, are called intractable. In general, anything that is more complex than polynomial time (O(n^x)) would be considered intractable. What algorithms have we seen so far that qualify? What characterizes an algorithm that is intractable? What might we see in the algorithm itself?

Intractable Problems Another term you’ll here for intractable problems is NP-Complete NP stands for “non-deterministic polynomial time” One of the greatest challenges in computer science is to determine whether NP-Complete problems can (or definitely cannot) be solved in polynomial time

Classic NP-Complete Problems The Knapsack Problem Given a set of items, each with a cost and a value, determine the number of each item to include in a collection so that the total cost is less than a given limit and the total value is as large as possible. Thanks to Wikipedia for the image

The Knapsack Problem How would you solve it? What is your algorithm? What is the critical section? What are you “counting?” What do you think the complexity would be? Talk to the people around you and figure out what you would do here.

Classic NP-Complete Problems Given a number of cities and the costs of traveling from any city to any other city, what is the least-cost round-trip route that visits each city exactly once and then returns to the starting city? Technically, this problem is NP-Hard, but it’s still intractable… Thanks to Wikipedia for the image!

The Traveling Salesman Problem How would you solve it? What is your algorithm? What is the critical section? What are you “counting?” What do you think the complexity would be? Talk to the people around you and figure out what you would do here.

Technically, though… Even though we call these problems intractable, they are still technically solvable (Even if the time to take to solve it takes longer than it would take for the sun to stop burning…) There is another level of problems that we can’t solve

Computability Definition: The property of being computable by purely mechanical means You’ve had practice writing algorithms A key aspect of all your algorithms is that at some point it will stop what it’s doing and give you an answer. So, what happens if it doesn’t?

Computability Is there an algorithm that solves a particular problem? Computable (decidable) problems: There is an algorithm that solves the problem. Make a fractal, sorting, winning chess (it doesn’t mean we know the algorithm, but there is one) Uncomputable (undecidable) problems: There is no algorithm that solves the problem. There might be a procedure, but it doesn’t always terminate.

Computability Your challenge for Wednesday: What problem can you not solve with a computer? What problem could be considered undecidable? Consider this: If I tell you that I will always tell you the truth and then the next phrase I say is “this is a lie,” what would that make you do?