- #1
Grouchy187
- 1
- 0
I need to do this problem but I get stuck halfway through,
Find complexity of S(n) = S(n-1) + n^2.5 for n > 1 and where S(1) = 2
What I did so far..
S(n) = S(n-1) + n^2.5
S(n-1) = S(n-2) + (n-1)^2.5
S(n-2) = S(n-3) + (n-2)^2.5
so following this pattern...
S(3) = S(2) + 3^2.5
S(2) = S(1) + 2^2.5
then canceling,
S(n) = S(1) + 2^2.5 + 3^2.5 + ... + (n-2)^2.5 + (n-1)^2.5 + n^2.5
So basically, it is the Summation of n^2.5
But I do not know how to get a equation from that in terms of n. Any help would be appreciated.
Homework Statement
Find complexity of S(n) = S(n-1) + n^2.5 for n > 1 and where S(1) = 2
Homework Equations
The Attempt at a Solution
What I did so far..
S(n) = S(n-1) + n^2.5
S(n-1) = S(n-2) + (n-1)^2.5
S(n-2) = S(n-3) + (n-2)^2.5
so following this pattern...
S(3) = S(2) + 3^2.5
S(2) = S(1) + 2^2.5
then canceling,
S(n) = S(1) + 2^2.5 + 3^2.5 + ... + (n-2)^2.5 + (n-1)^2.5 + n^2.5
So basically, it is the Summation of n^2.5
But I do not know how to get a equation from that in terms of n. Any help would be appreciated.