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
Triangle
Gnesinka [82]

Answer:

I think it's 165 degrees

3 0
3 years ago
Read 2 more answers
When 8 is subtracted from the square of a number, the result is 7 times the number.
LuckyWell [14K]

Answer:

8

Step-by-step explanation:

x^2 - 8 = 7x

x^2 - 7x - 8=0

(x - 8)(x + 1)=0

x - 8= 0   x + 1=0

x=8           x= -1

8 is the positive solution

4 0
3 years ago
A basketball scout has developed a screening tool to identify future NBA all-stars. The screening tool is fairly reliable; 95% o
Over [174]

Answer:

The value is P(F) =0.0095

Step-by-step explanation:

From the question we are told that

    The  probability that a player is  being identified as an NBA all-stars is 95% = 0.95

     The number of player in the camp is  n =  100

Generally the probability that a player becomes the first person to be evaluated is mathematically represented as

         p(1) = \frac{1}{n}

=>      p(1) = \frac{1}{100}

=>     p(1) = 0.01

Generally the probability that the first basketball player his screening tool identifies as a future NBA all-star is truly a future NBA all-star

      P(F) =  P(1) *  0.95

=>    P(F) =0.01 * 0.95

=>    P(F) =0.0095

             

3 0
4 years ago
Please help math part2
Keith_Richards [23]
How I got my answer before was substitution! 
5 0
3 years ago
Find the 60th term of<br> the arithmetic sequence 4, -1, -6, ...
Tomtit [17]

Answer:

-291

Step-by-step explanation:

4+(-5)(n-1)=4-5*59=4-295=291

4 0
3 years ago
Other questions:
  • Determine the type of correlation that exists in the given data set. R S –40 2 –30 36 –20 27 –10 78 0 13 10 96 20 39 30 4 40 68
    12·1 answer
  • The shorter leg of a 30°- 60°- 90° right triangle is 12.5 inches. How long are the longer leg and the hypotenuse?
    5·2 answers
  • A can of tuna is shaped like a cylinder.<br> Find its volume to the nearest tenth Use 3.14 for n
    12·1 answer
  • Her coins have a total value of $9.50. She has a total of 50 coins. Write systems of equations can be used to find the number of
    10·1 answer
  • if 4% of packages get lost in the mail, then which decimal best represent the amount of packages lost in the mail?​
    11·1 answer
  • Find the quotient of 68.0052 and 12. round the answer to the nearest hundred
    8·1 answer
  • Please xplain if u answer
    6·1 answer
  • states that “providing shelter to Jews was a crime punishable by death.” How does this statement contribute to the development o
    15·1 answer
  • Please help me vote you brainiest
    14·1 answer
  • If you can solve this, your a genius..<br> 900 + 1 = ?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!