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]
4 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]4 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
Erica had 6 coins in her coin collection. she goes to a coin show and buys some coins. how many dose she have now?
rewona [7]
It doesnt say how many she buys at the coin show so we dont know but its going to be more than 6
8 0
3 years ago
Read 2 more answers
Which Statement or Inequalities describe the number line graph?
Vika [28.1K]
I might be wrong but:

x is less than negative three and x is greater than or equal to negative one.

Inequality is x<-3 and x ≥ -1
8 0
3 years ago
the diameter of the sweep of the main rotor of the eh101 helicopter is 18.6 meters. A toy model of it has a sweep of 31 centimet
Aliun [14]

Answer:

The actual length of 60 cm is modeled as 1 cm length.

Step-by-step explanation:

The diameter of the sweep of the main rotor of the helicopter is 18.6 meters i.e. 1860 cm.

Now, the toy model of the helicopter has a sweep of 31 cm.

Therefore, the scale in which the model is made is 1860 : 31 i.e. 60 : 1 ratio.

So, the actual length of 60 cm is modeled as 1 cm length. (Answer)

4 0
3 years ago
Read 2 more answers
List three methods of assigning probabilities. (Select all that apply.)
motikmotik

Answer:

D. Equally likely outcomes

E. Relative frequency

F. Cumulative frequency

3 0
3 years ago
Read 2 more answers
Arrange the following fraction in ascending order 2/3 1/6 3/5<br>​
sladkih [1.3K]
Ascending order just means to be arranged from smallest to largest

Answer: 1/6 2/3 3/5
3 0
3 years ago
Other questions:
  • How do I solve this
    6·1 answer
  • The sum of two numbers is 46 and the difference is 10 . What are the numbers?
    11·1 answer
  • Alyssa and Caleb drove 210 mikes to the beach in separate cars. They left at the same time. They both drove at a constant speed.
    11·2 answers
  • Need this answered ASAP
    14·1 answer
  • What percent of 67.5 is 7.02
    5·1 answer
  • Solve the following system in three variables using linear combinations. 3x−2y+z=0 4x+y−3z=−9 9x−2y+2z=20
    7·1 answer
  • How many solutions does the following equation have?<br><br> 0 = -6 | 9v - 7 |
    14·1 answer
  • Use fraction models to solve three and two thirds minus two and four sevenths equals blank.
    15·2 answers
  • A mixture of green paint contains 9 pounds of blue paint and 12 pounds of yellow paint to make the same shade of green paint usi
    10·1 answer
  • Please help , Take your time , <br>​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!