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
What is the value of the expression 1/2(6x9x1)+15
Vanyuwa [196]

Answer:

the answer of the expression is 42

Step-by-step explanation:

PEMDAS parenthesis are first so we start out with 6x9x1 and the answer to that is 54, next is MULTIPLICATION so we take 1/2 times 52 which is 27 then next is ADD so we add 15 and the answer is 42

5 0
3 years ago
Pls answer this with a picture showing the correct box plot
faust18 [17]

Answer/Step-by-step explanation:

To find out the mistake of the student, let's find the min, max, median, Q1 and Q3, which make up the 5 important values that are represented in a box plot.

Given, {2, 3, 5, 6, 10, 14, 15},

Minimum value = 2

Median = middle data point = 6

Q1 = 3 (the middle value of the lower part of the data set before the median)

Q3 = 14 (middle value of the upper part of the data set after the median)

Maximum value = 15

If we examine the diagram the student created, you will observe that he plotted the median wrongly. The median, which is represented by the vertical line that divides the box, ought to be at 6 NOT 10.

See the attachment below for the correct box plot.

3 0
3 years ago
What is the song part 2 : I'm bad as michale jackson (yah yah yah)
Dmitry_Shevchenko [17]

Answer:

what was the first one.....the first song part

Step-by-step explanation:

3 0
3 years ago
Read 2 more answers
If h(x) = 6 – x, what is the value of (hxh) (10)
vova2212 [387]

For those who may need it in the future, the answer on e1010 is actually: C: 10

8 0
3 years ago
Olives garden is only 10 yd and the watermelon plants she wants to grown requir 2.5yd each how many watermelon plants can she gr
olga_2 [115]

Answer:

4

Step-by-step explanation:

10÷2.5

8 0
3 years ago
Other questions:
  • Find the radius of convergence of the power series \sum_{n=1}^\infty \frac{x^n}{\root 9 \of n}
    10·1 answer
  • Question 7 of 10
    9·2 answers
  • Math question.......................................
    10·2 answers
  • Please help me with this question!!
    9·1 answer
  • The Value of X________
    5·1 answer
  • We are using the formula P=%(W) (Part = Percent x Whole)
    14·1 answer
  • 1 point
    13·2 answers
  • I need help plsssssssssssss
    7·2 answers
  • What is something that only a college can offer? Don't need any lame and commonly used answers like meeting new people, experts,
    14·1 answer
  • The scale factor is...?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!