Chapter 8: Q21SE (page 526)
Give a big-O estimate for the size of f in Exercise \(1{20}\) if f is an increasing function.
Short Answer
We have then shown that is \(O\left( {{n^4}} \right)\).
Chapter 8: Q21SE (page 526)
Give a big-O estimate for the size of f in Exercise \(1{20}\) if f is an increasing function.
We have then shown that is \(O\left( {{n^4}} \right)\).
All the tools & learning materials you need for study success - in one app.
Get started for freeUse Exercise 31 to show that if , thenis.
Suppose that when is a positive integer divisible by 3, and . Find:
a).
b).
c)localid="1668607414775" .
Use generating functions to find the number of ways to choose a dozen bagels from three varietiesโegg, salty, and plainโif at least two bagels of each kind but no more than three salty bagels are chosen.
What is the generating function for the sequence , where represents the number of ways to make change for pesos using bills worth 10 pesos, 20 pesos, 50 pesos, and 100 pesos?
In this exercise we construct a dynamic programming algorithm for solving the problem of finding a subset S of items chosen from a set of n items where item i has a weight , which is a positive integer, so that the total weight of the items in S is a maximum but does no exceed a fixed weight limit W. Let denote the maximum total weight of the items in a subset of the first j items such that this total weight does not exceed w. This problem is known as the knapsack problem.
a) Show that if, then
b) Show that if , then.
c) Use (a) and (b) to construct a dynamic programming algorithm for determining the maximum total weight of items so that this total weight does not exceed W. In your algorithm store the values as they are found.
d) Explain how you can use the values computed by the algorithm in part (c) to find a subset of items with maximum total weight not exceeding W.
What do you think about this solution?
We value your feedback to improve our textbook solutions.