Hw 13

Greg Edwards
Chapter 11: Efficiency of Algorithms
Homework #13
Due: Monday May 02
4 students write seperate algorithms for the same problem. Each run at different
speeds; One at 2n^6, one at 2n!, another at n^n, and the last at 5000^n. For
large n, order the programs according to their efficiency.
The subset sum problem is as follows: given a set of integers, is there any subset that
sums exactly to zero? Explain briefly why this problem is of type NP.
How many computations are required to check whether two sets A, B are equal?
For a CPU that processes one million computations per second, how long will it
to find the most efficient path for 50 cities if the algorithm runs in exponential time
n! ?
After running his former algorithm and freezing his computer, the salesman
decides he doesn' t need the best route. He creates another algorithm for finding
a "good" route that runs in polynomial time n^3. How long will this computation
take on the same computer as problem 4?