answer.
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]
2 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]2 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
The proof for the power property of logarithms appears in the table with an expression missing.
iVinArrow [24]

Answer:

log_{b}(b^{x r})

Step-by-step explanation:

A picture of the question is shown in the figure attached. There we can see that the step corresponding to Properties of exponents is the option:

log_{b}(b^{x r})

which is equivalent to

log_{b}((b^{x})^{r})

7 0
2 years ago
Read 2 more answers
Hari borrowed Rs. 126000 from a money-lender at 15% per annum simple interest,
amid [387]

Answer:

Rs. 112000

Step-by-step explanation:

  • Borrowed money = Rs. 126000
  • Interest rate = 15% PA simple
  • Time = 3 years

<u>Hari is due to pay after 3 years:</u>

  • 126000* (1+ 3*15/100) = 182700

He pays Rs. 70700, remaining money is cleared by giving buffalo.

<u>Cost of buffalo:</u>

  • 182700 - 70700= Rs. 112000

<u>Answer is:</u> Rs. 112000

7 0
2 years ago
Read 2 more answers
Jim lost 4 lbs each week for 10 weeks. Express his total weight change as an integer.
yKpoI14uk [10]

Answer:

4:10

Step-by-step explanation

7 0
2 years ago
Read 2 more answers
The following histogram shows the relative frequencies of the heights, recorded to the nearest inch, of a population of women. T
Airida [17]

Answer:

The following histogram shows the relative frequencies of the height recorded to the nearest inch of population of women the mean of the population is 64.97 inches and the standard deviation is 2.66 inches

(a) Based on the histogram, what is the probability that the selected woman will have a height of at least 67 inches? Show your work

Answer:

0.22268

Step-by-step explanation:

z-score is z = (x-μ)/σ,

where x is the raw score

μ is the population mean

σ is the population standard deviation.

(a) Based on the histogram, what is the probability that the selected woman will have a height of at least 67 inches? Show your work

At least means equal to or greater than 67 inches

z = 67 - 64.97/2.66

z = 0.76316

P-value from Z-Table:

P(x<67) = 0.77732

P(x>67) = 1 - P(x<67) = 0.22268

The probability that the selected woman will have a height of at least 67 inches is 0.22268

Step-by-step explanation:

6 0
2 years ago
From a height of 50 meters above sea level on a cliff, two ships are sighted due west. The angles of depression are 61° and 28°.
Olenka [21]

Answer:

The ships are 66 meters apart.

Step-by-step explanation:

For the sake of convenience, let us label ships A and B

As shown in the figure, the distances to the ships from right triangles.

The distance to the ship A is d_1 and it is given by

tan (61^o)= \dfrac{50}{d_1}

d_1=\dfrac{50}{tan (61^o)}

\boxed{d_1= 27.71m}

And the distance to the ship B is d_2 and is given by

tan (28^o)= \dfrac{50}{d_2}

d_2=\dfrac{50}{tan (28^o)}

\boxed{ d_2=94.04m}

Therefore, the distance d between the ships A and B is

d= d_2-d_1=94.04-27.7\\\\\boxed{d=66m}

In other words, the ships are 66 meters apart.

8 0
2 years ago
Read 2 more answers
Other questions:
  • Can you show the work for 342.6 times 0.28
    11·2 answers
  • Harrison has 30 cds in his music collection. If 40% of the cds are country and 30% are pop, how many are other types of music
    8·2 answers
  • Find the length of the longest line segment that can be drawn on a rectangular board 3.07m by 2.24m
    15·1 answer
  • What are the explicit equation and domain for a geometric sequence with a first term of 3 and a second term of −9?
    10·2 answers
  • A staircase has 105 blocks, how many stairs does it have?
    12·1 answer
  • You work at a fruit market. Bananas cost 50¢ a pound. A customer hands you a bunch of bananas that weighs 3 pounds. How much sho
    10·2 answers
  • Graph the linear equation. Find three points that solve the equation, then plot on the graph. -3y=x-6
    13·1 answer
  • 4.Find the square roots of the following decimal numbers
    7·2 answers
  • A hockey player strikes a hockey puck. The height of the puck increases until it reaches a maximum height of 1.5 feet, 30 feet a
    8·1 answer
  • A food scientist takes a random sample of 25 cereals in order to test the claim that the mean fiber content is less than 2.5 gra
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!