Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. The Fibonacci Series Fibonacci (c. 1175-c. 1250) was an Italian mathematician from the Republic of Pisa, considered to be the most talented Western mathematician

image text in transcribed

3. The Fibonacci Series Fibonacci (c. 1175-c. 1250) was an Italian mathematician from the Republic of Pisa, considered to be "the most talented Western mathematician of the Middle Ages". He developed the Fibonacci sequence as follows. Fibonacci considers the growth of an idealized (biologically unrealistic) rabbit population, assuming that: a newly born pair of rabbits, one male, one female, are put in a field; rabbits are able to mate at the age of one month so that at the end of its second month a female can produce another pair of rabbits; rabbits never die and a mating pair always produces one new pair (one male, one female) every month from the second month on. The puzzle that Fibonacci posed was: how many pairs will there be in one year? . At the end of the first month, they mate, but there is still only 1 pair. . At the end of the second month the female produces a new pair, so now there are 2 pairs of rabbits in the ie At the end of the third month, the original female produces a second pair, making 3 pairs in all in the field At the end of the fourth month, the original female has produced yet another new pair, and the female born two months ago also produces her first pair, making 5 pairs. At the end of the nth month, the number of pairs of rabbits is equal to the number of new pairs (that is, the number of pairs in month n 2) plus the number of pairs alive last month (that is, n 1). This is the nth Fibonacci number The Fibonacci sequence can then be defined as: It can be reformulated as fold1 1 fold2 1 fnew - fold1 + fold2 After that, fold2 can be discarded, which is no longer needed, and set fold2 to fold1 and fold1 to fnew, Repeat an appropriate number of times. Write a Python function that is given an integer n and returns the nth Fibonacci number. Have your function deal with negative numbers by using Python's abs(olute) function Once your function is defined, use it to calculate the number of rabbits after each of 10, 50, 100, and 200 generations. Paste your function definition and test results here

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Define "Rights Issue".

Answered: 1 week ago

Question

Discuss the Rights issue procedure in detail.

Answered: 1 week ago

Question

Discuss the Rights issue procedure in detail.

Answered: 1 week ago

Question

Explain the procedure for valuation of shares.

Answered: 1 week ago

Question

Which months of this year 5 Mondays ?

Answered: 1 week ago

Question

Describe key customer feedback collection tools.

Answered: 1 week ago

Question

Know what customers expect from the firm when they complain.

Answered: 1 week ago

Question

Understand why customers complain.

Answered: 1 week ago