1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Sergeeva-Olga [200]
3 years ago
7

Complete computefibonacci() to return fn, where f0 is 0, f1 is 1, f2 is 1, f3 is 2, f4 is 3, and continuing: fn is fn-1 + fn-2.

hint: base cases are n == 0 and n == 1.
Mathematics
1 answer:
anastassius [24]3 years ago
3 0

Answer:

Fibonacci series is given by

f(0)=0, f(1)=1, f(2)=1, f(3)=2, f(4)=3.....

As you can see using the above result

f(4)=f(3) + f(2),

f(3)=f(2) + f(1),

f(2)=f(1) + f(0)

Proceeding using same pattern

f(5)=f(4) + f(3)=3+2=5

f(6)=f(4) + f(5)=3+5=8

f(7)=f(6) + f(5)=8+5=13

f(8)=f(7) + f(6)=13+8=21

f(9)=f(8) + f(7)= 21+13=34

f(10)=f(9) + f(8)=34+21=55

...........................................

..........................................

f(n-2)=f(n-3)  + f(n-4)

f(n-1)=f(n-2)+ f(n-3)

Similarly and finally we get using the same pattern we get, As given f(n)=f(n-1) + f(n-2).




You might be interested in
I don’t know how to take a picture on this and send it out for a question
Amanda [17]

Answer:

Where it says "add attachment" with the paper clip, select your picture from there. If you don't know how to do that, take a picture of it with your phone, email it to yourself, and download it on your computer. It should then be in a folder called "downloads" or something similar. Feel free to ask further questions if you're still stuck!

Step-by-step explanation:

5 0
3 years ago
Read 2 more answers
Solve for c: c+8=-11c
UNO [17]

Answer:

c= -2/3

Step-by-step explanation:

c+8 = -11c

C = -11c -8

c+11c = -8

12c = -8

divide both sides by 12

c= -2/3

7 0
3 years ago
Read 2 more answers
How much would you make a year if you only get 16.00 dollars a month in food stamps if your a senior citizen?
LenKa [72]
192 dollars i think....
7 0
3 years ago
Sean used 3/4 cup of sugar to make a dozen brownies. How much sugar is in each brownie
Law Incorporation [45]
So.  how many times 12 goes into 3/4?

\bf \cfrac{\quad \frac{3}{4}\quad }{12}\implies \cfrac{\quad \frac{3}{4}\quad }{\frac{12}{1}}\implies \cfrac{3}{4}\cdot \cfrac{1}{12}\implies \cfrac{3}{48}\implies \cfrac{1}{16}


6 0
3 years ago
Is 11/4 rational or irrational
Ipatiy [6.2K]

Answer:

rational

Step-by-step explanation:

7 0
3 years ago
Other questions:
  • The graph of a function is shown below.
    12·1 answer
  • Function f is an exponential function. x −2 0 2 4 6 f(x) 164 116116 14 1 4 By what factor does the output value increase as each
    6·2 answers
  • 1. If 8 is 40% of a value, what is the value?
    7·2 answers
  • What does 40 divided by 1+3-(3x7)+7-5 equal?
    9·1 answer
  • A right triangular prism is shown. A right triangular prism is shown. The right triangles have sides with lengths 15 and 8. The
    12·2 answers
  • Points A, B, C, and Q are _____.
    13·2 answers
  • A cube has an edge of 2 feet. The edge is increasing at the rate of 5 feet per minute. Express the volume of the cube as a funct
    8·1 answer
  • Find the compound amount on P16,100 for 4 years and 6 months at 10% compounded quarterly. (Round off your answer to the nearest
    12·1 answer
  • The difference of a number and 8 is 46 less the number. Find the number ​
    7·2 answers
  • Select the number that would make this statement true: 496 ÷ ________ = 49.6 (3 points)
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!