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
PLEASE HELP!!!!!<br> x^2 + 12xy + 35y^2
SVEN [57.7K]
The answer is = (x + 5y) (x + 7y)

Break the expression into two groups.
 
x^2 + 12xy + 35y^2
(x^2 + 5xy) (7xy + 35^2)

Factor out x from x^2 + 5xy: x(x + 5y)
Factor out 7y from 7xy + 35y^2: 7y(x + 5y)
=x(x + 5y) + 7y(x + 5y)

Next, factor out the common term (x+ 5y).

Answer = (x + 5y) (x + 7y)
7 0
3 years ago
Read 2 more answers
Need help in algebra fast <br> Please help
Bogdan [553]

Answer:

A

Step-by-step explanation:

because it's not equal to it is dashes ----

8 0
4 years ago
How to change a bianary number into decimal number​
adelina 88 [10]

1. Positional Notation

2. Doubiling

3. An Online Converter

6 0
3 years ago
Read 2 more answers
Which is closest to the quotient 2,967 ÷ 0.003?
rodikova [14]

Answer:

989000

Step-by-step explanation:

Divide  2,967 ÷ 0.003

7 0
3 years ago
Solve the inequality using the Distributive Property. -4(y-6) ≤ (-9+y)(-2)
iragen [17]

Answer:

3 ≤ y

Step-by-step explanation:

-4(y-6) ≤ (-9+y)(-2)

Distribute

-4y +24 ≤ 18 -2y

Add 4y to each side

-4y+4y +24 ≤ 18 -2y+4y

24≤ 18 +2y

Subtract 18 from each side

24-18≤ 18-18 +2y

6 ≤ 2y

Divide by 2

6/2≤ 2y/2

3 ≤ y

8 0
3 years ago
Other questions:
  • The diameter of a circle is 22 inches.
    11·2 answers
  • David must install fencing around a lot that is shaped like a right triangle. The side of the lot that runs east-west is 200 ft
    15·1 answer
  • Hey can you please help me posted picture of question
    15·2 answers
  • What is the slope of line m?
    12·2 answers
  • A business committee decided to increase the area of their square parking lot. They increased the width of the parking lot by 60
    5·1 answer
  • Lily goes to bed at 11:00 p.m. She sleeps for 8 hours. What time did she wake up?
    8·2 answers
  • One year there was a total of 73 commercial and noncommercial orbital launches worldwide. In​ addition, the number of noncommerc
    8·1 answer
  • 1 1/2 miles equals how many feet​
    5·2 answers
  • Find the equation of a line that passes through the points (1,-3) and (3,-4).
    9·2 answers
  • I NEED HELP WITH THIS ASAP!
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!