Question: Consider the sequence defined by for The sequence converges on as N increases . The relative absolute error, , between the term in the sequence
Consider the sequence defined by
for
The sequence converges on asNincreases The relative absolute error, between the term in the sequence and is given by the formula:
Note the vertical bars indicate an absolute value. Write a function named cuberootapproxthat accepts a single scalar input variable errorTol. Add commands to use this input value for the error tolerance as the convergence criterion for the sequence. Use a whileloop to generate sequence terms until the relative error, is less than or equal to the value in the input tolerance variable errorTol. Assign values to the two output variables as follows.
Assign the value of the the last term generated to the variable lastTerm.
Count the number of terms needed to meet the tolerance and assign this value to the variable numTerms.
Be sure to assign a value to each of the output variables.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
