Chapter 8: Q35E (page 536)
Give a big- \(O\) estimate for the function\(f\)in Exercise\(34\)if\(f\)is an increasing function.
Short Answer
The required result is\(f(n) = O\left( {{n^{{{\log }_4}5}}} \right)\).
Chapter 8: Q35E (page 536)
Give a big- \(O\) estimate for the function\(f\)in Exercise\(34\)if\(f\)is an increasing function.
The required result is\(f(n) = O\left( {{n^{{{\log }_4}5}}} \right)\).
All the tools & learning materials you need for study success - in one app.
Get started for freea) Show that is the generating function for the number of ways that the sum n can be obtained when a die is rolled repeatedly and the order of the roll matters.
b) Use part (a) to find the number of ways to roll a total of 8 when a die is rolled repeatedly, and the order of the roll matters.
Use generating functions (and a computer algebra package, if available) to find the number of ways to make change for 1 using pennies, nickels, dimes, and quarters with
a) no more than 10 pennies.
b) no more than 10 pennies and no more than 10 nickels.
c) no more than 10 coins
(a) Define a derangement.
(b) Why is counting the number of ways a hatcheck person can return hats topeople, so that no one receives the correct hat, the same as counting the number of derangements ofobjects?
(c) Explain how to count the number of derangements ofobjects.
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.
Solve the recurrence relation if and . (See the hint for Exercise 9.)
What do you think about this solution?
We value your feedback to improve our textbook solutions.