functionsscopingand abstraction italian mathematician leonardo of pisaalso known as fibonaccideveloped formula designed to quantify this notionalbeit with some not terribly realistic assumptions suppose newly born pair of rabbitsone male and one femaleare put in pen (or worsereleased in the wildsuppose further that the rabbits are able to mate at the age of one month (whichastonishinglysome breeds canand have one-month gestation period (whichastonishinglysome breeds dofinallysuppose that these mythical rabbits never dieand that the female always produces one new pair (one maleone femaleevery month from its second month on how many pregnant rabbits will there be at the end of six monthson the last day of the first month (call it month )there will be one female (ready to conceive on the first day of the next monthon the last day of the second monththere will still be only one female (since she will not give birth until the first day of the next monthon the last day of the next monththere will be two females (one pregnant and one noton the last day of the next monththere will be three females (two pregnant and one notand so on let' look at this progression in tabular form notice that in this tablefor month females(nfemales( - females( - this is not an accident each female that was alive in month - will still be alive in month in additioneach female that was alive in month - will produce one new female in month the new females can be added to the females alive in month - to get the number of females in month the growth in population is described naturally by the recurrencefemales( females( females( females( + females(nmonth females this definition is little different from the recursive definition of factorialit has two base casesnot just one in generalyou can have as many base cases as you need in the recursive casethere are two recursive callsnot just one againthere can be as many as you need figure contains straightforward implementation of the fibonacci recurrence, along with function that can be used to test it while obviously correctthis is terribly inefficient implementation of the fibonacci function there is simple iterative implemenentation that is much better