Feasibility and Infeasibility Are all problems easy to solve?

Slides:



Advertisements
Similar presentations
Chapter 3 Brute Force Brute force is a straightforward approach to solving a problem, usually directly based on the problem’s statement and definitions.
Advertisements

Types of Algorithms.
8 Algorithms Foundations of Computer Science ã Cengage Learning.
The Design and Analysis of Algorithms
Lecture 8 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
CS 206 Introduction to Computer Science II 09 / 10 / 2008 Instructor: Michael Eckmann.
Linear vs. exponential growth Linear vs. exponential growth: t = 0 A = 1x(1+1) 0 = 1 A = 1x0 + 1 = 1.
Text Chapters 1, 2. Sorting ä Sorting Problem: ä Input: A sequence of n numbers ä Output: A permutation (reordering) of the input sequence such that:
Algorithms. Problems, Algorithms, Programs Problem - a well defined task. –Sort a list of numbers. –Find a particular item in a list. –Find a winning.
1 Algorithm Efficiency, Big O Notation, and Role of Data Structures/ADTs Algorithm Efficiency Big O Notation Role of Data Structures Abstract Data Types.
CS503: First Lecture, Fall 2008 Michael Barnathan.
Concept of Basic Time Complexity Problem size (Input size) Time complexity analysis.
CS 206 Introduction to Computer Science II 01 / 28 / 2009 Instructor: Michael Eckmann.
Algorithms. Problems, Algorithms, Programs Problem - a well defined task. –Sort a list of numbers. –Find a particular item in a list. –Find a winning.
Counting the Cost Recall linear search & binary search Number of items Worst CaseExpected Case Number of probes (comparisons) LinearBinary Linear Binary.
Algorithms Friday 7th Week. Algorithms What is an Algorithm? –A series of precise steps, known to stop eventually, to solve a problem –NOT necessarily.
Data Structures Mohamed Mustaq Ahmed Chapter 2- Algorithms.
How difficult is it to solve a problem?. Computability and Feasibility  Can a specific problem be solved by computation?  If so, can a suitably efficient.
1 Chapter 24 Developing Efficient Algorithms. 2 Executing Time Suppose two algorithms perform the same task such as search (linear search vs. binary search)
ITEC 2620A Introduction to Data Structures Instructor: Prof. Z. Yang Course Website: 2620a.htm Office: TEL 3049.
CS 2430 Day 28. Announcements We will have class in ULR 111 on Monday Exam 2 next Friday (sample exam will be distributed next week)
Chapter 3 Sec 3.3 With Question/Answer Animations 1.
Merge Sort. What Is Sorting? To arrange a collection of items in some specified order. Numerical order Lexicographical order Input: sequence of numbers.
2-1 2 Algorithms Principles. Efficiency. Complexity. O-notation. Recursion. © 2001, D.A. Watt and D.F. Brown.
Unsolvability and Infeasibility. Computability (Solvable) A problem is computable if it is possible to write a computer program to solve it. Can all problems.
Problems you shouldn’t tackle. Problem Complexity.
Public key ciphers 2 Session 6.
Complexity Non-determinism. NP complete problems. Does P=NP? Origami. Homework: continue on postings.
CSE332: Data Abstractions Lecture 24.5: Interlude on Intractability Dan Grossman Spring 2012.
Cliff Shaffer Computer Science Computational Complexity.
Design and Analysis of Algorithms (DAA) (6 cp) Pasi Fränti
Fundamentals of Algorithms MCS - 2 Lecture # 15. Bubble Sort.
Chapter Algorithms 3.2 The Growth of Functions 3.3 Complexity of Algorithms 3.4 The Integers and Division 3.5 Primes and Greatest Common Divisors.
CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis Lauren Milne Summer 2015.
Erdal Kose CC30.10 These slides are based of Prof. N. Yanofsky Lecture notes.
3.3 Complexity of Algorithms
Today we will understand that fractions have equivalents Equivalent=the same or equal.
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.
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.
Types of Algorithms. 2 Algorithm classification Algorithms that use a similar problem-solving approach can be grouped together We’ll talk about a classification.
CS 206 Introduction to Computer Science II 01 / 30 / 2009 Instructor: Michael Eckmann.
Complexity © 2014 Project Lead The Way, Inc.Computer Science and Software Engineering.
Computer Theory Michael J. Watts
Computer Science/Ch. Algorithmic Foundation of CS 4-1 Chapter 4 Chapter 4 Algorithmic Foundation of Computer Science.
COMP108 Algorithmic Foundations Polynomial & Exponential Algorithms
8.1 8 Algorithms Foundations of Computer Science  Cengage Learning.
Chapter VI What should I know about the sizes and speeds of computers?
Can you put these children’s TV shows in date order - earliest to latest?
Copyright © 2014 Curt Hill Algorithms From the Mathematical Perspective.
Copyright © 2014 Curt Hill Algorithm Analysis How Do We Determine the Complexity of Algorithms.
MA/CSSE 473 Day 12 Amortization (growable Array) Knuth interview Brute Force Examples.
A greedy algorithm is an algorithm that follows the problem solving heuristic of making the locally optimal choice at each stage with the hope of finding.
Introduction to Algorithms: Brute-Force Algorithms.
Excursions in Modern Mathematics Sixth Edition
The Limits of Computation
COMP108 Algorithmic Foundations Polynomial & Exponential Algorithms
Penny vs. Million Payday
Enough Mathematical Appetizers!
CS 2210 Discrete Structures Algorithms and Complexity
A Balanced Introduction to Computer Science David Reed, Creighton University ©2005 Pearson Prentice Hall ISBN X Chapter 13 (Reed) - Conditional.
CS 2210 Discrete Structures Algorithms and Complexity
Applied Discrete Mathematics Week 6: Computation
Design and Analysis of Algorithms (DAA) (6 cp)
Discrete Mathematics CS 2610
Time Complexity Lecture 14 Sec 10.4 Thu, Feb 22, 2007.
Time Complexity Lecture 15 Mon, Feb 27, 2006.
A Balanced Introduction to Computer Science David Reed, Creighton University ©2005 Pearson Prentice Hall ISBN X Chapter 13 (Reed) - Conditional.
CS 2210 Discrete Structures Algorithms and Complexity
Presentation transcript:

Feasibility and Infeasibility Are all problems easy to solve?

Not Computable vs. Not Feasible Last week we spoke about problems that are not computable such as the halting problem. This week we speak about problems that can be computed but they are difficult to solve. These problems are called Infeasible.

A growing penny vs. $1M If I were to offer you one penny today, 2 cents tomorrow, 4 cents the next day, and so on, each day doubling it for 30 days - or I would offer to you 1 million dollars which would you take?

Growth of pennies in 30 days Note the exponential rate of growth: 2 days

Rate of Growth The idea is to look at the rate of growth of time or steps to solve the problem in relation to the input. In other words how quickly does the workload increase for a one unit increase of the input? Exponential and factorial growths are infeasible.

Example: Sorting Problem: Sort a set of n numbers. Example sort: 5, 8, 2, 16, 7 How would you solve that?

Algorithm 1 - Exhaustive listing 1.List all permutations (orderings) of the data 2.Pick the one that is sorted. 5, 8, 2, 16, 7 not sorted try again… 8, 5, 2, 16, 7not sorted try again… … How much work does it take? The number of permutations is n*(n-1)*(n-2)*...*3*2*1 = n! nn! , ,320

Algorithm 2 - Selection sort 1.Find the largest of the n data points 2.Find the largest of the remaining n-1 data points (loop) 3.Find the largest of the remaining n-2 data points (loop) … until only the smallest data point is remaining How much work does this take? n + (n-1) + (n-2) = n*(n+1)/2 nn*(n+1)/

Compare algorithm 1 and algorithm 2 Note that if n = 5 The exhaustive listing and search takes 5! = 120 units of work The selection sort takes 15 units of work Algorithm 1 is infeasible whereas algorithm 2 is feasible.

Infeasible Problem vs. Infeasible Algorithm Sorting is a feasible problem because there exists a feasible algorithm (algorithm 2 selection sort and others). Just make sure not to use Algorithm 1 - an infeasible algorithm. Sometimes there are infeasible problems- people have not found a feasible algorithm for it.

Two examples of infeasible problems 1.Traveling salesman problem 2.Chess

Questions What does infeasible mean? What is the difference between an unsolvable problem and an infeasible problem? If I have 1 million numbers to sort – won’t that take a long time? Is that infeasible? Explain.