Recurrence relation - initial condition

In summary, the conversation discusses finding the exact solution for the recurrence relation $T(n)=2T(\sqrt{n})+1$. It involves setting $T(2^m)=S(m)$ and using an initial condition to solve for $T(2)$, which is found to be equal to $-1$. The solution for $T(n)$ is then determined to be $T(n)=-1$ for all $n$.
  • #1
evinda
Gold Member
MHB
3,836
0
Hello! (Smile)

I want to find the exact solution of the recurrence relation: $T(n)=2T(\sqrt{n})+1$.$$m=\lg n \Rightarrow 2^m=n \\ \ \ \ \ \ \ \ \ 2^{\frac{m}{2}}=\sqrt{n}$$

So we have: $T(2^m)=2T(2^{\frac{m}{2}})+1$

We set $T(2^m)=S(m)$, so we get: $S(m)=2S \left( \frac{m}{2}\right)+1$

$$S(m)=2S \left( \frac{m}{2}\right)+1=2^2S\left( \frac{m}{2^2} \right)+2+1= \dots= 2^i S \left( \frac{m}{2^i}\right)+ \sum_{j=0}^{i-1} 2^j$$If we would have an initial condition, let $S(1)=c$ then we would say that the recursion ends when $\frac{m}{2^i}=1$.

So that the recurrence relation is well-defined, it has to hold the following:

$$ n>\sqrt{n} \Rightarrow n^2>n \Rightarrow n^2-n>0 \Rightarrow n(n-1)>0 \Rightarrow n>1 \wedge n>0 \Rightarrow n \geq 2 \Rightarrow 2^m \geq 2 \Rightarrow m \geq 1$$So does this mean that we have to set $T(2)=S(1)=c$ ? (Thinking)
 
Physics news on Phys.org
  • #2
Your initial condition would probably have to be in terms of T(n), not S(n). You can find T(0)= -1 and T(1) = -1 from the equation, though.
If you use the method from my post in http://mathhelpboards.com/discrete-mathematics-set-theory-logic-15/solve-f-n-2f-sqrt-n-n-14405.html, you can find the solution of your recurrence to be
$$ T(n) = \left ( T(2) +1 \right ) \log_{2} n - 1, n = 2^{2^k}.$$
I'm not sure exactly how to solve this for T(2), though. If you take $ T(2) = 2 T( \sqrt 2 ) +1 $ and iterate, you have
$$ T(2) = 2^c T( \sqrt[c] 2 ) +2^{c} - 1 $$ for all $ c \geq 1 $.
Taking the limit, you get
$$ T(2) = \lim_{c \to \infty} \left ( 2^c - 2^c -1 \right ) = -1, $$
which implies that
$$ T(n) = ( -1 +1 ) \log_2 n -1 = -1 $$ for all n.
:confused: This seems to be really weird, until you take the limit as $ i \to \infty $ of the final recurrence relation in your post, which gives us the same answer.
Either I am horribly wrong, or this is the correct solution.
 
Last edited:

FAQ: Recurrence relation - initial condition

1. What is a recurrence relation?

A recurrence relation is a mathematical formula that describes a sequence of values by relating each term to one or more previous terms. It is often used to model relationships in natural phenomena or to solve problems in computer science and engineering.

2. What is an initial condition in a recurrence relation?

An initial condition is the starting point for a recurrence relation. It is the value of the first term in the sequence and is used to determine all subsequent terms. Without an initial condition, the recurrence relation cannot be evaluated.

3. Why are initial conditions important in recurrence relations?

Initial conditions are important because they provide a starting point for the recurrence relation and allow us to calculate the values of subsequent terms. Without them, the recurrence relation would not have a well-defined solution.

4. Can a recurrence relation have multiple initial conditions?

Yes, a recurrence relation can have multiple initial conditions if it is a multi-dimensional or multi-variable recurrence relation. Each initial condition corresponds to a different starting point for the sequence.

5. How are initial conditions used to solve a recurrence relation?

To solve a recurrence relation, we first use the initial condition(s) to determine the value of the first term in the sequence. Then, we use the recurrence relation formula to calculate the values of subsequent terms, using the previously calculated terms as inputs. This process continues until we reach the desired term in the sequence.

Back
Top