Lecture # 38 Algorithms & Problem Solving: How Hard Can it Get?

Slides:



Advertisements
Similar presentations
Tower of Hanoi Tower of Hanoi is a mathematical puzzle invented by a French Mathematician Edouard Lucas in The game starts by having few discs stacked.
Advertisements

Complexity. P=NP? Who knows? Who cares? Lets revisit some questions from last time – How many pairwise comparisons do I need to do to check if a sequence.
NP-Complete Problems CIT 596, Spring Problems that Cross the Line What if a problem has: o An exponential upper bound o A polynomial lower bound.
Time Complexity P vs NP.
What is Intractable? Some problems seem too hard to solve efficiently. Question 1: Does an efficient algorithm exist?  An O(a ) algorithm, where a > 1,
December 3, Algorithms and Data Structures Lecture XV Simonas Šaltenis Nykredit Center for Database Research Aalborg University
November 7, Algorithms and Data Structures Lecture XV Simonas Šaltenis Nykredit Center for Database Research Aalborg University
1 The Limits of Computation Intractable and Non-computable functions.
CPE702 Complexity Classes Pruet Boonma Department of Computer Engineering Chiang Mai University Based on Material by Jenny Walter.
CS420 lecture one Problems, algorithms, decidability, tractability.
Computational problems, algorithms, runtime, hardness
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 21 Instructor: Paul Beame.
P, NP and more.
Analysis of Algorithms CS 477/677
Fall 2004COMP 3351 Time Complexity We use a multitape Turing machine We count the number of steps until a string is accepted We use the O(k) notation.
Ref: Pfleeger96, Ch.31 NP-Complete Problems Reference: Pfleeger, Charles P., Security in Computing, 2nd Edition, Prentice Hall, 1996.
Lecture 5 Overview Does DES Work? Differential Cryptanalysis Idea – Use two plaintext that barely differ – Study the difference in the corresponding.
CSc /6 Week nine 1 CSc142 Algorithms and efficiency Week 9 Pete Bagnall Elizabeth Phillips
CSCE350 Algorithms and Data Structure
Computational Complexity Polynomial time O(n k ) input size n, k constant Tractable problems solvable in polynomial time(Opposite Intractable) Ex: sorting,
Chapter 7 Inefficiency and Intractability CS 345 Spring Quarter, 2014.
Matt Schierholtz. Method for solving problems with finite steps Algorithm example: Error Check for problem Solve problem Must terminate.
Advanced Algorithm Design and Analysis (Lecture 13) SW5 fall 2004 Simonas Šaltenis E1-215b
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 4.
RESOURCES, TRADE-OFFS, AND LIMITATIONS Group 5 8/27/2014.
Problems you shouldn’t tackle. Problem Complexity.
Cs3102: Theory of Computation Class 24: NP-Completeness Spring 2010 University of Virginia David Evans.
Complexity A decidable problem is computationally solvable. But what resources are needed to solve the problem? –How much time will it require? –How much.
CSE 3813 Introduction to Formal Languages and Automata Chapter 14 An Introduction to Computational Complexity These class notes are based on material from.
Computation, Complexity, and Algorithm IST 501 Fall 2014 Dongwon Lee, Ph.D.
Cliff Shaffer Computer Science Computational Complexity.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
3.3 Complexity of Algorithms
Time Complexity of Algorithms
Lecture 12 P and NP Introduction to intractability Class P and NP Class NPC (NP-complete)
Graham Kendall +44 (0) G5AIAI Introduction to AI Graham Kendall Combinatorial Explosion.
Lecture # 39 What Can’t Be Computed?. Computability Tractable problems (P): Can be solved by a a computer is some deterministic (reasonable) polynomial.
22C:19 Discrete Math Advanced Counting Fall 2010 Sukumar Ghosh.
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.
Computability Heap exercise. The class P. The class NP. Verifiers. Homework: Review RELPRIME proof. Find examples of problems in NP.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 15: Intractable Problems (Smiley.
CPS Computational problems, algorithms, runtime, hardness (a ridiculously brief introduction to theoretical computer science) Vincent Conitzer.
Design and Analysis of Algorithms NP-Completeness Haidong Xue Summer 2012, at GSU.
David Evans Class 15: P vs. NP (Smiley Puzzles and Curing Cancer) CS150: Computer Science University of Virginia Computer.
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.
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
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.
1 In this puzzle, the player begins with n disks of decreasing diameter placed one on top of the other on one of three pegs of the game board. The player.
Tower of Hanoi problem: Move the pile of rings from one peg to another
NP-Complete Problems.
8.1 Determine whether the following statements are correct or not
1.5 Intractable problems.
Recursive Thinking Chapter 9 introduces the technique of recursive programming. As you have seen, recursive programming involves spotting smaller occurrences.
Recursive Thinking Chapter 9 introduces the technique of recursive programming. As you have seen, recursive programming involves spotting smaller occurrences.
Copyright © Cengage Learning. All rights reserved.
Class 14: Intractable Problems CS150: Computer Science
Introduction to Data Structures
Java Coding 6-extra David Davenport Computer Eng. Dept.,
Section 14.3 Complexity Classes
Tower of Hanoi problem: Move the pile of rings from one peg to another
CS 583 Fall 2006 Analysis of Algorithms
The Hanoi Tower Problem
NP-Complete Problems.
Algorithms and Data Structures Lecture XV
CSC 380: Design and Analysis of Algorithms
Tower of Hanoi problem: Move the pile of rings from one peg to another
Algorithms CSCI 235, Spring 2019 Lecture 36 P vs
Presentation transcript:

Lecture # 38 Algorithms & Problem Solving: How Hard Can it Get?

Computability Tractable problems (P): Can be solved by a a computer is some deterministic (reasonable) polynomial time –What is a ”reasonable” running time? Intractable problems (NP): 1. Guess the solution 2. Answer must be verifiable in polynomial time

Goal: transfer all n disks from peg 1 to peg 3 Rules: –move one disk at a time –never place a larger disk on top of a smaller one Example: Towers of Hanoi Simonas Šaltenis, Aalborg University, 1 2 3

DEMO ( Towers of Hanoi

How Long? 64 disks Move 1 disk per second 585 billion years Is that tractable/reasonable? Towers of Hanoi

Monkey Puzzle Nine square cards with imprinted “monkey halves” Goal: arrange the cards in 3x3 square with matching halves... Simonas Šaltenis, Aalborg University,

More Monkeying around How long to match the monkey cards for a 3x3 square? Trying all possibilities, if you could try 1/per second, you could do it in about 4 days How long to match the monkey cards for a 5x5 square? Trying all possibilities, if you could try 1,000,000/per second, it would take 490 billion years to verify whether a solution exists Simonas Šaltenis, Aalborg University,

Monkey Business cont. Can we improve the Brute Force algorithm? A smart algorithm would still take thousands of years, worst case Easier way to find solutions? MAYBE! But nobody has found them, yet! (room for smart students...) Simonas Šaltenis, Aalborg University,

Reasonable vs. Unreasonable function/ n n2n2 1/10,000 second 1/2,500 second 1/400 second 1/100 second 9/100 second n5n5 1/10 second 3.2 seconds 5.2 minutes 2.8 hours 28.1 days 2n2n 1/1000 second 1 second 35.7 years 400 trillion centuries a 75 digit- number of centuries n 2.8 hours 3.3 trillion years a 70 digit- number of centuries a 185 digit- number of centuries a 728 digit- number of centuries Exponential Polynomial Simonas Šaltenis, Aalborg University, How Hard can a Problem Be?:

Reasonable vs. Unreasonable ”Good”, reasonable algorithms –algorithms bound by a polynomial function n k –Tractable problems ”Bad”, unreasonable algorithms –algorithms whose running time is above n k –Intractable problems intractable problems tractable problems Problems with no reasonable algorithms/solutions Problems with reasonable (polynomial-time) algorithms/solutions Simonas Šaltenis, Aalborg University,

So What?! Computers get faster every year –But that is an insignificant speed-up (a constant) compared to exponential running time Maybe the Monkey puzzle is just one specific problem, we could simply ignore –the monkey puzzle falls into a category of problems called NPC (NP complete) problems (~1000 problems) –all have unreasonable solutions –not known to admit reasonable ones… Simonas Šaltenis, Aalborg University,