Chapter 8: Q12E (page 535)
4. 12. Find \(f(n)\) when\(n = {3^k}\), where \(f\) satisfies the recurrence relation \(f(n) = 2f(n/3) + 4\) with\(f(1) = 1\).
Short Answer
Thus, the result is:
\(f(n) = 5{n^{{{\log }_3}2}} - 4\)
Chapter 8: Q12E (page 535)
4. 12. Find \(f(n)\) when\(n = {3^k}\), where \(f\) satisfies the recurrence relation \(f(n) = 2f(n/3) + 4\) with\(f(1) = 1\).
Thus, the result is:
\(f(n) = 5{n^{{{\log }_3}2}} - 4\)
All the tools & learning materials you need for study success - in one app.
Get started for free47. A new employee at an exciting new software company starts with a salary of550,000and is promised that at the end of each year her salary will be double her salary of the previous year, with an extra increment of$ 10,000 for each year she has been with the company.
a) Construct a recurrence relation for her salary for hern th year of employment.
b) Solve this recurrence relation to find her salary for hern th year of employment.
Some linear recurrence relations that do not have constant coefficients can be systematically solved. This is the case for recurrence relations of the form \(f(n){a_n} = g(n){a_{n - 1}} + h(n)\)Exercises 48-50 illustrate this.
Letbe the sequence of Catalan numbers, that is, the solution to the recurrence relationwith.
(a)Show that ifis the generating function for the sequence of Catalan numbers, then. Conclude (using the initial conditions) that.
(b) Use Exercise 40 to conclude that so that
(c) Show thatfor all positive integers.
Suppose that when is a positive integer divisible by 5 , and . Find
Use generating functions to find the number of ways to make change for \(100 using
a) \)10, \(20, and \)50 bills.
b) \(5, \)10, \(20, and \)50 bills.
c) \(5, \)10, \(20, and \)50 bills if at least one bill of each denomination is used.
d) \(5, \)10, and $20 bills if at least one and no more than four of each denomination is used.
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.