Proving by Induction: Solving Recurrence Relation

Click For Summary

Discussion Overview

The discussion revolves around proving by induction the solution to the recurrence relation $T(n)=2T \left ( \frac{n}{2} \right )+n^2$ for $n>1$ with the initial condition $T(1)=1$. Participants explore the method of induction, questioning whether to base the proof on $n$ or $k$, where $n$ is assumed to be of the form $2^k$.

Discussion Character

  • Exploratory
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • Some participants suggest proving by induction with respect to $k$, as $T(n)$ is not defined for all natural numbers.
  • Others question the necessity of using induction at all, proposing that verifying the solution directly may suffice.
  • A participant outlines the steps of induction, starting with the base case and assuming the relation holds for $k$, then attempting to show it for $k+1$.
  • There is a suggestion that the relation might need to be assumed for any $k \geq 0$ at a later step in the induction.

Areas of Agreement / Disagreement

Participants express differing views on whether induction is necessary, with some advocating for its use while others believe direct verification is adequate. The discussion remains unresolved regarding the best approach to take.

Contextual Notes

Participants note that the recurrence relation is only defined for powers of two, which influences the choice of induction variable. There are also discussions about the implications of the boundary condition and the validity of the proposed solution.

evinda
Gold Member
MHB
Messages
3,741
Reaction score
0
Hello! (Wave)

I want to prove by induction, that the solution of the recurrence relation $T(n)=2T \left ( \frac{n}{2} \right )+n^2, n>1 \text{ and } T(1)=1$ is $n(2n-1)$.

We have to suppose that $n=2^k, k \geq 0$, right?

Do I have to prove the solution by induction with respect to $n$ or to $k$ ? (Thinking)
 
Physics news on Phys.org
evinda said:
Hello! (Wave)

I want to prove by induction, that the solution of the recurrence relation $T(n)=2T \left ( \frac{n}{2} \right )+n^2, n>1 \text{ and } T(1)=1$ is $n(2n-1)$.

We have to suppose that $n=2^k, k \geq 0$, right?

Do I have to prove the solution by induction with respect to $n$ or to $k$ ? (Thinking)

Hi! (Blush)

I'd pick $k$, since $T(n)$ is not defined for all $n \in \Bbb N$. (Thinking)

Btw, do you really have to use induction? (Wondering)
 
I like Serena said:
I'd pick $k$, since $T(n)$ is not defined for all $n \in \Bbb N$. (Thinking)

Btw, do you really have to use induction? (Wondering)

The exercise asks the following:

Solve the recurrence relation $ \displaystyle{T(n)=\left\{\begin{matrix}
1 &,n=1 \\
2T \left(\frac{n}{2} \right )+n^2 &, n>1
\end{matrix}\right.}$

and then, prove that the solution you found is right, using mathematical induction.

So, do we have to do it like that?

We suppose that $n=2^k, k \geq 0$.

  • $k=0 \Rightarrow n=1: T(1)=1=1\cdot (2 \cdot 1-1) \checkmark$
    $$$$
  • We suppose that the relation stands for any $k>1$, so $T(2^k)=2^k(2^{k+1}-1)$
    $$$$
  • We will show that the relation stands for $k+1$.

    $$T(2^{k+1})=2T \left (\frac{2^{k+1}}{2} \right )+(2^{k+1})^2=2T(2^k)+2^{2k+2}=2 (2^k(2^{k+1}-1))+2^{2k+2}\\ =2^{2k+2}-2^{k+1}+2^{2k+2}=2^{k+1}(2 \cdot 2^{k+1}-1)$$
 
evinda said:
The exercise asks the following:

Solve the recurrence relation $ \displaystyle{T(n)=\left\{\begin{matrix}
1 &,n=1 \\
2T \left(\frac{n}{2} \right )+n^2 &, n>1
\end{matrix}\right.}$

and then, prove that the solution you found is right, using mathematical induction.

So, do we have to do it like that?

We suppose that $n=2^k, k \geq 0$.

  • $k=0 \Rightarrow n=1: T(1)=1=1\cdot (2 \cdot 1-1) \checkmark$
    $$$$
  • We suppose that the relation stands for any $k>1$, so $T(2^k)=2^k(2^{k+1}-1)$
    $$$$
  • We will show that the relation stands for $k+1$.

    $$T(2^{k+1})=2T \left (\frac{2^{k+1}}{2} \right )+(2^{k+1})^2=2T(2^k)+2^{2k+2}=2 (2^k(2^{k+1}-1))+2^{2k+2}\\ =2^{2k+2}-2^{k+1}+2^{2k+2}=2^{k+1}(2 \cdot 2^{k+1}-1)$$

Perfect! (Happy)Alternatively, note that $T(n)=n(2n-1)$ fits in the original equation, including the boundary condition that $T(1)=1$.
Therefore it is a solution.

$$T(1)=1(2\cdot 1 - 1)=1$$

$$n(2n-1)=T(n)=2T\left(\frac n2\right)+n^2 = 2\cdot \frac n 2 \left(2\cdot \frac n 2 - 1\right) + n^2 = n(n-1) + n^2 = n(2n-1)$$

In other words, there is no real need for a proof by induction.
Just verifying that the proposed solution satisfies the problem statement is enough. (Nerd)
 
Or do I have to suppose maybe, at the second step, that the relation stands for any $k \geq 0$ ? (Thinking)
 
evinda said:
Or do I have to suppose maybe, at the second step, that the relation stands for any $k \geq 0$ ? (Thinking)

Oh yes. (Blush)
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
5
Views
2K