Question on recurrence relations of the form $~f(n) = af(n/b) + g(n)~$

77 Views Asked by At

From Rosen's Discrete Mathematics and Its Applications, $3$rd, chapter $8.3$ p. $529$:

an

Can someone explain to me how you can go from line $1$ of $f(n)$ to line $2$ and so on? I am at a loss here. It feels like the answer just comes out of nowhere. TIA!

1

There are 1 best solutions below

0
On BEST ANSWER

$f(n) = af(n/b) + g(n)$

$~~~~~~~=a~ [af(n/b^2) + g(n/b)]+g(n)~,~~~~$ as $~~f(n/b) = af(n/b^2) + g(n/b)~$

$~~~~~~~=a^2f(n/b^2)+ag(n/b)+g(n)$

$~~~~~~~=a^2~[af(n/b^3) + g(n/b^2)]+ag(n/b)+g(n)~,~~~~$ as $~~f(n/b^2) = af(n/b^3) + g(n/b^2)~$

$~~~~~~~=a^3f(n/b^3)+a^2 g(n/b^2)+ag(n/b)+g(n)$

$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\vdots$

$~~~~~~~=a^kf(n/b^k) + \sum_{j=0}^{k-1}a^jg(n/b^j)$