Feasibility and Infeasibility - PowerPoint PPT Presentation

About This Presentation
Title:

Feasibility and Infeasibility

Description:

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 ... – PowerPoint PPT presentation

Number of Views:31
Avg rating:3.0/5.0
Slides: 13
Provided by: Authori91
Category:

less

Transcript and Presenter's Notes

Title: Feasibility and Infeasibility


1
Feasibility and Infeasibility
  • Are all problems easy to solve?

2
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.

3
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?

4
Growth of pennies in 30 days
Note the exponential rate of growth 2days
5
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.

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

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

n n!
3 6
4 24
5 120
6 720
7 5,040
8 40,320
8
Algorithm 2 - Selection sort
  • Find the largest of the n data points
  • Find the largest of the remaining n-1 data points
    (loop)
  • 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)
    ... 3 2 1 n(n1)/2

n n(n1)/2
3 6
4 10
5 15
6 21
7 28
8 36
9
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.

10
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. 

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

12
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 wont that
    take a long time? Is that infeasible? Explain.
Write a Comment
User Comments (0)
About PowerShow.com