I have identified what caused me to be off by 1 in my answer for the third question on the first test, though I do not know how to remedy it. I'm confused about how to add two of the same function together.
I'm doing the second assignment right now and I'm trying to finalize my closed form for question one. I'm using the third tutorial #3 solution as a guide.
The final line of the solution states -
[F(n + 1) - 1] + F(n)G(1) + F(n - 1)G(n - n)
As I understand, according to the recurrence, this will be -
[F(n + 1) - 1] + F(n)(1) + F(n - 1)G(0)
= [F(n + 1) - 1] + F(n)(1) + F(n - 1)(1)
= F(n + 1) - 1 + F(n) + F(n - 1)
The final closed form provided is -
2F(n + 1) - 1
I'm not sure how this happens? I previously thought that you just added the elements within the brackets for every F() together (like in this case, n +1 + n + n -1), but that obviously isn't right because I struggled with this very issue on test 1 and forgot to ask about it in office hours. I'm having a hard time finding answers to this online, as well. Most searches for adding functions either give me results for adding heterogeneous functions (ie (f + g)(x) variety), or they apply to functions in specific programming languages.
I'm going to try to look back on old slides and the course notes to see what I'm doing wrong. The logic is probably very simple and I feel foolish for not being able to figure it out right now.
Edit: I have found the closed form for question one of the assignment, just be looking at different results for values of n, but I still don't understand how adding the two functions together resulted in that answer. :(
Edit 2: I know the answer now! It had to do with the induction hypothesis!
No comments:
Post a Comment