0

Find the closed form of the following recurrence relation:

$$T(n)=\begin{cases}c&\text{ if }n=1\\2T\left(\frac n2\right)+\log n&\text{ otherwise.}\end{cases}$$

Can someone give me a step by step method on how to find the closed form of this specific relation? I have tried following other posts but can't see how they relate to this equation.

FFjet
  • 5,041
Tyler
  • 35
  • you can have a look at https://math.stackexchange.com/a/2533708/399263 and https://math.stackexchange.com/a/3002925/399263 and https://math.stackexchange.com/a/3110685/399263, I explain how to start with such recurrences, and solved a few real cases with details. – zwim Mar 29 '19 at 20:43
  • 1
    a variant is to look at $n=2^p$ and $U(p)=T(n)$ You get a linear recurrence $U(p)-2U(p-1)$ solve for $U$ then substitute back to find $T$. – zwim Mar 29 '19 at 20:54
  • Looks like a duplicate of https://math.stackexchange.com/questions/538463 – R. J. Mathar Oct 02 '20 at 19:58

1 Answers1

0

$$ T(2^{\log_2 n})=2T(2^{\log_2\frac n2})+\ln n $$

now calling $T'(u) = T(2^u)$ with $u = \log_2 n$ we have the linear recurrence

$$ T'(u)=2T'(u-1) + u\ln 2 $$

which can be solved as

$$ T'(u) = T'_h(u)+T'_p(u) $$

with

$$ T'_h(u)-2T'(u-1)=0\\ T'_p(u)-2T'_p(u-1) = u\ln 2 $$

The homogeneous solution is direct

$$ T'_h(u) = C 2^{u-1} $$

now making $T'_p(u) = C(u)2^{u-1}$ and substituting into the particular we have a recurrence for $C(n)$

$$ C(n)-C(n-1) = 2^{-u}u\ln 4 $$

and solving for $C(n)$ we get

$$ C(n) = \left(2-2^{-u}(u+2)\right)\ln 4 $$

and finally

$$ T'(u) = C 2^{u-1} + \left(2-2^{-u}(u+2)\right)\ln 4 2^{u-1} = C 2^{u-1}+\left(2^u-1\right) \ln 4-u \ln 2 $$

hence

$$ T(n) = \frac{1}{2} n (C+\ln 16)-\ln (4 n) $$

imposing now the initial conditions we have $C = \ln 16-2\ln 4 = 0$ and finally

$$ T(n) = n\ln 4-\ln (4n) $$

Cesareo
  • 33,252