Rosalind Community Support

Home » Community Forum » Questions » Mortal Fibonacci Rabbit question
Search
Search this community...
Share a Feedback

Community Forum

"Champions" Idea | Implemented
Sign in with Facebook Idea | Accepted
Rate upcoming features Question | Pending

Knowledge Base

Signin into
Rosalind Community.

Signin with

Your email address
UserRules Password
Login

Mortal Fibonacci Rabbit question

Follow
Vote
0
Unfollow
I think the modification to the recurrence relation is straightforward, Fn = Fn-1 + Fn-2 - Fn-m, or something close to that. But for any n > 40 or so, the program runs for more than 5 minutes, so I can't provide a solution before the timer ends. Should I expect to need to use parallel programming techniques here, or am I missing something?
from John · 4 years & 145 days ago · · 4 comments
Try to memoize the results of recursion (store Fn in array). It will work in one moment.
from anonymous · 4 years & 142 days ago · Flag as inappropriate
Good Comment
Hi John,

Thanks for your feedback. As "anonymous" pointed out, you are probably creating too many unnecessary recursive calls; in the future, please feel free to ask questions like this on the "questions" forum associated with the individual problem; for FIBD, this forum is at http://rosalind.info/problems/fibd/questions.

<3,

Rosalind
from Rosalind · 4 years & 142 days ago · Flag as inappropriate
Good Comment
I am still scraping around to figure out the solution to this problem (The reason I am here!) but thought I would share a great lecture on memoization and dynamic programming from MITX on EDX - you will have to create an account to watch it but it really helped me out - https://courses.edx.org/courses/MITx/6.00x/2013_Spring/courseware/Week_11/videosequence:Lecture_21/

mrgraeme
from anonymous · 4 years & 96 days ago · Flag as inappropriate
Good Comment
I am still scraping around to figure out the solution to this problem (The reason I am here!) but thought I would share a great lecture on memoization and dynamic programming from MITX on EDX - you will have to create an account to watch it but it really helped me out - https://courses.edx.org/courses/MITx/6.00x/2013_Spring/courseware/Week_11/videosequence:Lecture_21/

mrgraeme
from anonymous · 4 years & 96 days ago · Flag as inappropriate
Good Comment
Write a comment... Comment

Similar Feedback

How was Rosalind built?
4 years & 359 days ago · Answered
Dynamic programming
4 years & 277 days ago · Waiting
Will increasing the number of jobs in programming?
4 years & 175 days ago · Pending
problems/subs
4 years & 352 days ago · Resolved
Tutorials
4 years & 188 days ago · Pending

Followers 

Rosalind · Community Support for Rosalind · Powered by UserRules · Terms