Upper Bound for Recurrence Relation: $T(n) \leq c n^2 \log^2 n$

Click For Summary

Discussion Overview

The discussion revolves around finding an asymptotic upper bound for the recurrence relation $T(n)=9T \left (\frac{n}{3} \right ) + n^2 \log n$, with a base case defined for $n \leq 9$. Participants explore the substitution method and its application in proving bounds using strong induction.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested, Mathematical reasoning

Main Points Raised

  • One participant proposes using the substitution method to find a specific function $f(n)$ to show that $T(n) \leq c f(n)$ for some $c>0$ and $n_0 \in \mathbb{N}$.
  • Another participant suggests that the substitution method is a valid approach, but emphasizes the need for a rigorous proof that the pattern holds for all iterations of the recurrence.
  • There is a discussion about the correct setting of the variable $i$ in the recurrence, with a suggestion to use $i = \log_3(n / 9)$ instead of $i = \log_3(n)$ due to the base case.
  • Some participants express uncertainty about whether the substitution method is the best approach for finding a hypothesis for the solution, while others affirm its correctness but note the need for a complete proof.
  • There is a repeated inquiry about whether finding the function $g(n)$ is sufficient for the proof by induction, indicating some confusion about the requirements of the method being used.

Areas of Agreement / Disagreement

Participants generally agree that the substitution method is a valid approach, but there is no consensus on whether it is the best method or on the rigor required for the proof. Some participants emphasize the need for a complete inductive proof, while others focus on finding the function $g(n)$.

Contextual Notes

Some participants note that the inductive step must be shown rigorously for all iterations, and there is mention of the need for clarity on the base case and the choice of $i$ in the recurrence. The discussion reflects varying levels of understanding regarding the application of the substitution method and the requirements for proving bounds.

Who May Find This Useful

This discussion may be useful for students or individuals interested in algorithm analysis, particularly those looking to understand recurrence relations and methods for establishing asymptotic bounds.

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

I want to find an asymptotic upper bound for the recurrence relation: $T(n)=9T \left (\frac{n}{3} \right ) + n^2 \log n $, $T(n)=c, \text{ when } n \leq 9$, using the following method:

We choose a specific function $f(n)$ and we try to show that for an appropriate $c>0$ and an appropriate $n_0 \in \mathbb{N}$, it stands that $T(n) \leq c f(n)$.
We suppose that $T(k) \leq c f(k), \forall k<n$ and we try to show that it stands for $n$.

Could we do it like that? (Thinking)

$T(n)=9T \left (\frac{n}{3} \right ) + n^2 \log n= \\

9 \cdot ( 9T \left ( \frac{n}{3^2} \right ) + \frac{n^2}{3^2} \log \left ( \frac{n}{3}\right)) +n^2 \log n =

\\ 9^2 T \left ( \frac{n}{3^2} \right )+ 9 \frac{n^2}{3^2} \log \left ( \frac{n}{3}\right) +n^2 \log n=

\\ = \dots =\\

9^i T\left ( \frac{n}{3^i} \right )+ \sum_{j=0}^{i-1} n^2 \log {\frac{n}{3^j}}=\\

9^i T\left ( \frac{n}{3^i} \right )+ n^2 \sum_{j=0}^{i-1} (\log n- j\log 3)= \\

9^i T\left ( \frac{n}{3^i} \right )+ n^2 \log n \sum_{j=0}^{i-1} 1 - \log 3 n^2 \sum_{j=0}^{i-1} j = \\

9^i T\left ( \frac{n}{3^i} \right )+ n^2 \ \log n \ i - \log 3 \ n^2 \ \frac{i(i-1)}{2} $For $i=\log_3 n $:

$T(n)=cn^2+n^2 \ \log n \ \log_3 n-\log 3 \ n^2 \frac{1}{2} (\log_3^2 n-\log_3n) \leq K n^2 \log^2n=O(n^2 \log^2n)$We will show that $T(n)=O(n^2 \log^2n)$.

We suppose that $\exists c>0$ such that $\forall k <n$ $T(k) \leq c k^2 \log^2k$.

$T(n)=9T \left (\frac{n}{3} \right ) + n^2 \log n \leq c n^2 \log^2 \left ( \frac{n}{3} \right ) + n^2 \log n=c n^2 \log^2n -\log^2 3 + n^2 \log n$

Is it right so far? Or have I done something wrong? (Thinking)

Is the substitution method a good way to find a function, in order to apply the method I am asked to use? :confused:
 
Physics news on Phys.org
Technically you should set $i = \log_3(n / 9)$ or something like that because $T(n)$ turns constant for $n < 9$, not $n < 1$. But yes, that is essentially correct, and is a good way of solving recurrences: exploiting a pattern in the recurrence to set up an inductive argument that says "if $T(n)$ looks like this after iterating $i$ times, then it still looks like this after iterating $i + 1$ times" and then plug in the number of times it should iterate to obtain a closed form. In this case the general form of the recurrence, as you appear to have discovered, was:
$$T(n) = 9^i T \left ( \frac{n}{3^i} \right ) + \sum_{k = 0}^{i - 1} n^2 \log \left ( \frac{n}{3^k} \right )$$
Which gives you something along the lines of $T(n) = c_1 n^2 + c_2 n^2 \log^2{n}$ for constants $c_1, c_2$ depending on what you plug into $i$, and then finding an upper bound based on that closed form of the recurrence is perfectly valid. And indeed $T(n) \in O(n^2 \log^2{n})$.

PS: if you would like to practice solving recurrences, here is a tricky one that you can work on - but please make a new thread for it if you need help - find a closed form for the recurrence below and tight upper/lower bounds:
$$T(n) = \sqrt{n} T(\sqrt{n}) + n$$
 
Last edited:
So, is the substitution method a right way to find a hypothesis of the solution of the recurrence relation, in order to use the method I am asked to use (Strong Induction), or is there a better way? (Thinking)
 
evinda said:
So, is the substitution method a right way to find a hypothesis of the solution of the recurrence relation, in order to use the method I am asked to use (Strong Induction), or is there a better way? (Thinking)

Yes, it is "right" in the sense of being correct mathematically, and it is reasonably easy in this case (for other recurrences there may be better ways of doing it). Though I wouldn't call your solution rigorous: you used substitution to find the pattern, but you did not prove that the pattern holds no matter how many times you substitute $T(n)$. Just iterating it a couple times isn't a proof! In other words, you need to show that for all $i$:
$$T(n) = 9^i T \left ( \frac{n}{3^i} \right ) + \sum_{k = 0}^{i - 1} n^2 \log \left ( \frac{n}{3^k} \right )$$
Implies:
$$T(n) = 9^{i + 1} T \left ( \frac{n}{3^{i + 1}} \right ) + \sum_{k = 0}^i n^2 \log \left ( \frac{n}{3^k} \right )$$
That is your inductive step to solve the recurrence by (strong) induction. Setting $i = \log_3(n)$ is only the final step of the process.​
 
I want to prove by induction, that $T(n)=O(g(n)) \Rightarrow T(n) \leq c g(n)$.

Don't I have to find from the substitution method only the function $g(n)$ ? Or am I wrong? (Thinking)
 
evinda said:
I want to prove by induction, that $T(n)=O(g(n)) \Rightarrow T(n) \leq c g(n)$.

Don't I have to find from the substitution method only the function $g(n)$ ? Or am I wrong? (Thinking)

I don't know, I don't have your lecture notes with me. You have found a closed form for $T(n)$ and upper-bounded it as per the problem statement. That seems perfectly fine to me. The upper-bounding step in and of itself is comparatively easy, so I'm not sure what you mean.
 
I am supposed to use this method:

We choose a specific function $f(n)$ and we try to show that for an appropriate $c>0$ and an appropriate $n_0 \in \mathbb{N}$, it stands that $T(n) \leq c f(n)$.
We suppose that $T(k) \leq c f(k), \forall k<n$ and we try to show that it stands for $n$.With the substitution method, I only wanted to find the specific function $f(n)$, in order to apply the above method. Am I wrong? (Thinking)
 

Similar threads

  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 19 ·
Replies
19
Views
4K
  • · Replies 29 ·
Replies
29
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K