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
lys-0071 [83]
3 years ago
8

The Fibonacci sequence 1, 1, 2, 3, 5, 8, 13, 21…… starts with two 1s, and each term afterward is the sum of its two predecessors

. Please write a function, Fib(n), which takes n as the input parameter. It will return the n-th number in the Fibonacci sequence. Using R, the output for Fib(9) should give only the 9th element in the sequence and not any of the previous elements. Please Help :)
Engineering
2 answers:
Novay_Z [31]3 years ago
5 0

9th value is 34

Explanation:

R or Fib (n) function is given by: (n - 1) + (n - 2), where n is the number in the Fibonacci sequence .

Hence, fib (9) = (9 - 1) + (9 - 2)

                      = 8th value + 7th value on the sequence summed together  

<em>Fibonacci sequence: 1, 1, 2, 3, 5, 8, 13, 21.</em><em> </em>The 8th value is 21 and the 7th value is 13.  

R = (n - 1) + (n - 2)

R (9) 0r Fib (9) = 21 + 13

           = 34

Olin [163]3 years ago
5 0
<h2>Answer:</h2>

  #Create a function Fib to return the nth term of the fibonacci series

  #Method header declaration

   Fib <- function(n)  {

 

   #when n <= 1, the fibonacci number is 1

   #hence return 1

   if (n <= 1)

           return(1)

   #when n = 2, the fibonacci number is 1

   #hence return 1

   else if (n == 2)

            return(1)

   

   #at other terms, fibonacci number is the sum of the previous two

   #numbers.

   #hence return the sum of the fibonacci of the previous two numbers

   else

           return( Fib(n-1) + Fib(n-2))

   }    #End of method.

============================================================

<h2>Sample Output:</h2>

A call to Fib(9) will give the following output:

>> 34

============================================================

<h2>Explanation:</h2>

The above program has been written in R language and it contains comments explaining each of the lines of code. Please go through the comments in the code.

For readability, the actual lines of code have been written in bold face to distinguish them from the comments.

You might be interested in
Write a new ARMv8 assembly file called "lab04b.S" which is called by your main function. It should have the following specificat
Len [333]

Answer:

my_mul:

.globl my_mul

my_mul:

   //Multiply X0 and X1

   //   Does not handle negative X1!

   //   Note : This is an in efficient way to multipy!

   SUB SP, SP, 16       //make room for X19 on the stack

   STUR X19, [SP, 0]    //push X19

   ADD X19, X1, XZR     //set X19 equal to X1

   ADD X9 , XZR , XZR //set X9 to 0

mult_loop:

   CBZ X19, mult_eol

   ADD X9, X9, X0

   SUB X19, X19, 1

   B mult_loop

mult_eol:

   LDUR X19, [SP, 0]

   ADD X0, X9, XZR      // Move X9 to X0 to return

   ADD SP, SP, 16       // reset the stack

   BR X30

Explanation:

6 0
3 years ago
The rolling process is governed by the frictional force between the rollers and the workpiece. The frictional force at the entra
adell [148]

Answer:

b)false

Explanation:

Rolling is a process in which work piece passes through rolls to produce desired out put of the work piece.Rolling  is a metal forming process.

We know that friction force is responsible for motion of work piece between rolls.If friction force is so small at the entrance side then work piece will not enter in the forming zone and forming process will not occurs.So the friction force should be high at the entrance side and low at the exit side.

So given statement is wrong.

3 0
3 years ago
Water exiting the condenser of a power plant at 45 Centers a cooling tower with a mas flow rate of 15,000 kg/s. A stream of cool
MariettaO [177]

Answer: hello your question is incomplete below is the missing part

question :Determine the temperature of the cooled water exiting the cooling tower

answer : T  = 43.477° C

Explanation:

Temp of water at exit = 45°C

mass flow rate of cooling tower = 15,000 kg/s

Temp of makeup water = 20°C

Assuming an atmospheric pressure of = 101.3 kPa

<u>Determine temperature of the cooled water exiting the cooling tower</u>

Water entering cooling tower at 45°C

Given that Latent heat of water at 45°C = 43.13 KJ/mol

Cp(wet air) = 1.005+ 1.884(y1)

where: y1 - Inlet mole ratio = (0.01257) / (1 - 0.01257) = 0.01273

Hence : Cp(wet air) = 29.145 +  (0.01273) (33.94) = 29.577 KJ/kmol°C

<u>First step : calculate the value of Q </u>

Q = m*Cp*(ΔT) + W(latent heat)

Q = 321.6968 (29.577) (40-30) +  43.13 (18.26089)

Q =  95935.8547 KJ/s

Given that mass rate of water = 15000 kg/s

<u>Hence the temperature of the cooled water can be calculated using the equation below</u>

Q = m*Cp*∆T

Cp(water) = 4.2 KJ/Kg°C

95935.8547 = (15000)*(4.2)*(45 - T)

( 45 - T ) = 95935.8547/ 63000.    ∴ T  = 43.477° C

5 0
2 years ago
a sprue is 12 in long and has a diameter of 5 in at the top. The molten metal level in the pouring basing is taken to be 3 in fr
vampirchik [111]

Answer:

See explaination

Explanation:

We can describe Aspiration Effect as a phenomenon of providing an allowance for the release of air from the mold cavity during the metal pouring.

See the attached file for detailed solution of the given problem.

8 0
3 years ago
Read 2 more answers
A 15-ft beam weighing 570 lb is lowered by means of two cables unwinding from overhead cranes. As the beam approaches the ground
7nadin3 [17]

Answer:

I. Tension (cable A) ≈ 6939 lbf

II. Tension (cable B) ≈ 17199 lbf

Explanation:

Let's begin by listing out the data that we were given:

mass of beam (m) = 570 lb, deceleration (cable A) = -20 ft/s², deceleration (cable B) = -2 ft/s²,

g = 32.17405 ft/s²

The tension on an object is given by the product of mass of the object by gravitational force plus/minus the product of mass by acceleration.

Mathematically represented thus:

T = mg + ma

where:

T = tension, m = mass, g = gravitational force,

a = acceleration

I. For Cable A, we have:

T = mg + ma = (570 * 32.17405) + [570 * (-20)]

T = 18339.2085 - 11400 = 6939.2085

T ≈ 6939 lbf

II. For Cable B, we have:

T = mg + ma = (570 * 32.17405) + [570 * (-2)]

T = 18339.2085 - 1140 = 17199.2085

T ≈ 17199 lbf

4 0
3 years ago
Other questions:
  • Vehicles arrive at a single toll booth beginning at 8:00 A.M. They arrive and depart according to a uniform deterministic distri
    9·1 answer
  • A __ insulated panel consists of a layer of insulating foam between two osb or plywood panels
    14·2 answers
  • A well pumps at 400 L/s from a confined aquifer whose thickness is 24 m. If the drawdown 50 m from the well is 1 m and the drawd
    10·1 answer
  • Is air conditioner a refrigerator?
    10·1 answer
  • Two satellites A and B are orbiting the earth around the equator, E, at different altitudes on a circular path of 2400km and 300
    8·1 answer
  • As part of an insurance company’s training program, participants learn how to conduct an analysis of clients’ insurability. The
    9·1 answer
  • Nitrogen gas is compressed at steady state from a pressure of 14.2 psi and a temperature 60o F to a pressure of 120 psi and a te
    7·1 answer
  • Which of the following describes what a manufacturing engineer does
    9·2 answers
  • Resistance depends on which three properties of a wire?
    15·1 answer
  • Concerning the storage battery, what category of the primary sources is voltage produced?​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!