Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

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

Expert verified

Thus, the result is:

\(f(n) = 5{n^{{{\log }_3}2}} - 4\)

Step by step solution

01

Theorem 1 definition

When\(n = {b^k}\)and\(a \ne 1\), where\(k\) is a positive integer,

\(f(n) = {C_1}{n^{{{\log }_b}a}} + {C_2},\)Where\({C_1} = f(1) + c/(a - 1)\) and\({C_2} = - c/(a - 1)\).

02

Apply Theorem 1

We have\(f(n) = 2f(n/3) + 4,f(1) = 1\)

Use the notation of the book, we have,\(a = 2,b = 3,c = 4\)

Use Theorem 1 of the chapter we have:

\(\begin{array}{*{20}{l}}\begin{array}{l}f(n) = {C_1}{n^{{{\log }_b}a}} + {C_2}\\f(n) = {C_1}{n^{{{\log }_3}2}} + {C_2}\end{array}&{}\\\begin{array}{c}{C_1} = f(1) + \frac{c}{{a - 1}}\\ = 1 + \frac{4}{{2 - 1}}\\ = 5\\{C_2} = \frac{{ - c}}{{a - 1}}\\ = \frac{{ - 4}}{{2 - 1}}\\ = - 4\end{array}&{}\\{}&{}\end{array}\)

Thus, the result is:

\(f(n) = 5{n^{{{\log }_3}2}} - 4\)

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

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

LetG(x)be 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, thenxG(x)2-G(x)+1=0. Conclude (using the initial conditions) thatG(x)=(1-1-4x)/(2x).

(b) Use Exercise 40 to conclude that G(x)=โˆ‘n=0โˆž1n+1(2nn)xn,so thatCn=1n+1(2nn).

(c) Show thatCnโฉพ2n-1for all positive integersn.

Suppose that f(n)=f(n/5)+3n2whenn is a positive integer divisible by 5 , and f(1)=4. 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 M(j,w)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 ifwj>w, thenM(j,w)=M(j-1,w).
b) Show that if wjโ‰คw, thenM(j,w)=max(M(j-1,w),wj+Mj-1,w-wj).
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 valuesM(j,w) as they are found.
d) Explain how you can use the values M(j,w)computed by the algorithm in part (c) to find a subset of items with maximum total weight not exceeding W.

See all solutions

Recommended explanations on Math Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free