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
Solve the system of equations. <br><br> 10x+y=−20 <br><br> y=2x2−4x−16<br><br> ( , ) and ( , )
Sladkaya [172]
I will go about solving this using the elimination method.

First, convert the equations.

10x + y = -20
4x + y = -12

Second, find the easiest variable to get rid of and get rid of it!  (In this case, y)  We will subtract to get rid of y.

6x = -8

Third, you want to solve the equation.

6x = -8 (divide by 6)
x = -1 \frac{1}{3}

Fourth, solve for y by inserting the answer for x into one of the equations.

10(-1 \frac{1}{3}) + y = -20
-13 \frac{1}{3} + y = -20 (subtract -13 \frac{1}{3})
y = -6 \frac{2}{3}

The solution for this system of equations is (-1 \frac{1}{3}, -6 \frac{2}{3}).
7 0
3 years ago
Read 2 more answers
List the angles of triangle ABC in order from smallest to largest measure if AB = 9, AC = 11, and BC = 10.
galben [10]
Across smallest side- smallest angle.
across largest side- largest angle
largest side is AC, so largest angle is B
smallest side is AB, so smallest angle is C
angles from smallest to largest : C, A, B
4 0
3 years ago
-16 + (-8)
nlexa [21]
-16 + (-8) = -24
(-4) - 7 = -11
-24 - (-9) = -15
6.25 + (-8.50) = 2.25
10.8 - (6.4) = 4.4
-54.26 + (-15.42) = -69.68

F ur fractions
6 0
3 years ago
Each egg carton holds one dozen eggs. Michael's chicken farm fills 121 egg cartons. He thinks that there were over 1500 eggs. Is
Kobotan [32]
121 x 12 = 1452 so over 1500 is not a correct estimate. Less than 1500 is the right estimate
3 0
3 years ago
Can anyone help? Will give Brainly + 18 pts
Ainat [17]

Answer:

-2 + × = y

Step-by-step explanation:

I think this is the answer because it's asking for an expression which this would be one.

5 0
3 years ago
Read 2 more answers
Other questions:
  • A number minus 11 is 12
    11·1 answer
  • Fill in the blanks to make each of the following a true statement. Also name the property exhibited by each statement.
    8·1 answer
  • Doing 1 week at Jackson School 210 students buy milk and 196 students by twos how many drinks are sold that week
    7·1 answer
  • Jose works at a restaurant. They earn 14.45 per hour plus a 8.50 each time someone signs up for the store's credit card.
    5·1 answer
  • HELP!! The aquarium has 6 fewer yellow fish than green fish. 40 percent of the fish are yellow. How many green fish are in the a
    5·2 answers
  • The graph of a non-invertible function passes through the points (−2,4), (0,2), and (3,−2).
    6·1 answer
  • Help ASAP 40 Points and Brainliest
    8·1 answer
  • Which statement about the equation 3x ^ 2 + 9x - 12 = 0 is true ? 1 . The product of the roots is -12 . 2 The product of the roo
    7·1 answer
  • Rodger put $1,000 in a bank account that pays 5% annual simple interest. At the end of four years, how much interest has he earn
    8·1 answer
  • Help plz help plzzzz
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!