We are given a recurrence relation:
We are to find the asymptotic behavior of T(n) for large n.
Step 1: Understand the recurrence
The recurrence is:
T(n)=T(n−3)+n2
This means that every time we increase n by 3, we add n21. So, starting from some base case (e.g., T), we can write:
T(n)=T(451)+k=0∑m
where m is such that n=451+3m, so m=3
Thus:
T(n)=T(451)+k=0∑
Let’s denote m=⌊3n−451⌋, then:
T(n)=Θ(1)+k=0∑m
Step 2: Analyze the sum
We want to estimate:
k=0∑m(451+3k)
Let’s change variables for easier estimation. Let xk=451+3k, then as k increases from 0 to m, goes from 451 to in steps of 3.
So the sum becomes:
x=451,x≡451mod3∑n
That is, it's the sum of x21 over all integers congruent to 451 modulo 3, up to n.
Now note that:
x=a∑b
Similarly, we can bound the sum:
x=451∑nx
So the full sum (over only every third integer) will be less than this total sum, and since the terms decrease rapidly, the sum converges.
Therefore:
k=0∑m(451+3k)
Hence:
T(n)=Θ(1)+O(1)=Θ(1)
Final Answer:
T(n)=Θ(1)
Proof Summary:
- The recurrence adds terms of the form n21 at each step.
- The sum ∑ converges to a constant.