5. At the end of month 4 there were 3 rabbits, 2 of which are mature. The mature rabbits each produce another female resulting in 5 rabbits in month 5.
The updated chart shows the situation.
N | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
Rabbits | 1 | 1 | 2 | 3 | 5 |
Here is what we have been doing:
rabbits_At_End_Of_Month( N ) = rabbits_At_End_Of_Month( N-1 ) + rabbits_Born_At_End_Of_Month( N-1 ) rabbits_At_End_Of_Month( N ) = rabbits_At_End_Of_Month( N-1 ) + mature_Rabbits_At_End_Of_Month( N-1 ) rabbits_At_End_Of_Month( N ) = rabbits_At_End_Of_Month( N-1 ) + rabbits_At_End_Of_Month( N-2 )
Once you have this rule, to calculate the number of rabbits to put under a month in the chart just add up the entries for the previous two months.