Repeated Substitution to solve a recurence.

  • Thread starter Thread starter Kine
  • Start date Start date
  • Tags Tags
    Substitution
Click For Summary
SUMMARY

The discussion focuses on solving the recurrence relation T(n) = T(n-1) + n^2 with base case T(0) = 1. The user attempts repeated substitution to derive a pattern, leading to T(n) = T(n-k) + kn^2 - (k-1)kn. However, they struggle to finalize the solution. The suggested approach involves calculating specific values for T(n) and fitting a third-degree polynomial, p(x) = ax^3 + bx^2 + cx + d, to the resulting sequence to derive a closed-form expression.

PREREQUISITES
  • Understanding of recurrence relations
  • Familiarity with polynomial fitting techniques
  • Knowledge of mathematical induction
  • Basic programming skills for implementing recurrence solutions
NEXT STEPS
  • Learn about solving recurrence relations using the Master Theorem
  • Study polynomial interpolation methods for fitting functions
  • Explore mathematical induction to prove closed-form solutions
  • Investigate the use of generating functions in recurrence relations
USEFUL FOR

Mathematicians, computer scientists, and software developers interested in algorithm analysis and optimization of recursive functions.

Kine
Messages
1
Reaction score
0
I have to solve the following recurrence but I keep getting stuck.


T(n) = 1, n=0
T(n) = T(n-1) + n^2, when n>1

I start by plugging in (n-1) into the function again to get...

T(n)=(T(n-2)+(n-1)^2)+n^2

Which simplifies down to (T(n-2)+2n^2-2n+1.

I then do it again and get this...

T(n)=(T(n-3)+(n-2)^2))+2n^2-2n+1

Which comes out to...

T(n) = T(n-3) + 3n^2 - 6n + 5

By this point I noticed a bit of the pattern and tried to solve the recurrence

T(n) = T(n-k) + kn^2 - (k-1)kn

However, I don't know what to do about the value at the end of the function which more or less halts my progress...

Am I going about this the correct way or am I off base?
 
Physics news on Phys.org
So far you have changed from one recurance to another but you haven't "solved" the equation.

If [itex]T(0)= 1[/itex] then [itex]T(1)= T(0)+ 1^2= 1+ 1= 2[/itex], [itex]T(2)= T(1)+ 2^2= 2+ 4= 6[/itex], [itex]T(3)= T(2)+ 3^2= 6+ 9= 15[/itex], [itex]T(4)= T(3)+ 4^2= 15+ 16= 31[/itex], [itex]T(5)= T(4)+ 5^2= 31+ 25= 56[/itex]. If you do not recognize that sequence, try fitting a third degree polynomial to it.

Let [itex]p(x)= ax^3+ bx^2+ cx+ d[/itex].
Taking x= 0, 1, 2, 3 will give 4 linear equations to solve for a, b, c, and d. Check to see if that also workds for x= 4 and x= 5.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K