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
The perimeter of a rectangle is 96 ft. Find the dimensions of the rectangle if the ratio of the length to the width is 7 : 5. Wh
Korolek [52]
Lets say we have a rectangle. if the ratio is 7:5, we can put the width as 7x, and the length as 5x (or vice versa, it doesn't really matter.) If the perimeter is solved by 2(h+w), we have 2(7x+5x)=96, or 2(7x)+2(5x)=96, which is C
4 0
3 years ago
Read 2 more answers
Help me pls working on quizizz :(
nexus9112 [7]

here your answer mate

3.25

hope it helps ☺️✌️

8 0
3 years ago
Read 2 more answers
Brainliest, but dont darn answer IF YOUR NOT GOING TO EXPLAIN HOW YOU GET YOUR ANSWER, please and thanks, appreciate ya!
stich3 [128]

Answer:

A. 2/3

Step-by-step explanation:

Simplify it by four, 8 / 4 = 2, 12 / 4 = 3

3 0
2 years ago
Read 2 more answers
Please help solve one of them
Ksenya-84 [330]

Answer: im not sure

Step-by-step explanation:

4 0
3 years ago
Solve the simultaneous equations: <br> <img src="https://tex.z-dn.net/?f=y%20%3D%20%20x%5E%7B2%7D%20-%203x%20-%203%20" id="TexFo
Paraphin [41]
I hope this helps you

8 0
3 years ago
Other questions:
  • he graph below shows the price of different numbers of cans of beans at a store: A graph is shown. The values on the x axis are
    10·2 answers
  • What is the mixed number of 4/3
    14·2 answers
  • n a nature conservatory, the ratio of butterflies to total number of flying insects is 36 to 100. There are 450 total flying ins
    10·1 answer
  • You spin a spinner and flip a coin. Find the probability of the compound event.
    15·2 answers
  • 1
    12·2 answers
  • (PLEASE HELP 50 POINTS) At a dog show, the entries included Welsh corgis and cocker spaniels. The table compares the weights wit
    13·2 answers
  • The dimensions of a rectangle are shown. What is the area of the rectangle?
    5·1 answer
  • Determine whether the equation x+x+x+x=4x has a one solutions, no solutions, or an infinite number of solutions determine the tw
    14·1 answer
  • Find the volume of each prism. Round to the nearest tenth if necessary
    13·1 answer
  • PLEASE HELP BEST ANSWER GETS BRAINLYEST
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!