- #1
Ad2d
- 9
- 0
Homework Statement
I have recurrence relation problem and what to ask would my way be just as correct as the TA did the solution:
f(n) = 0, n=1 and 2f(n/2) + n -1
The Attempt at a Solution
Here we assume n = 2k
This is my way:
f(k-1) = 2[2f(2k-2)*2k-1-1] + 2k - 1
= 4(f(2k-2) * (2*2k) - 3
:
:
= 2j*f(2k-j) + j2k - (j-1)
Guess: j=k
2j*f(2j-j) + j2j - (j-1)
2jf(1)+ j2j - (j-1)
j2j - (j-1) = j2j - j + 1 = j(2j)
The TA way
She did the same thing I did but in the part where we have
= 4(f(2k-2) * (2*2k) - 3
she put
= 4(f(2k-2) * (2*2k) - 22 + 1
where my guess came to be j(2j) she gets 2j(j-1) +1
Is her way correct where instead of putting the -3 she put the -22 + 1 ?
Last edited: