2. Write a program to evaluate \textit{e} by the series: $e = 1 + 1 + \frac{1}{2!} + \frac{1}{3!} + \frac{1}{4!} + \frac{1}{5!} + ...$ Test your program as you increase the number of terms in the series. Determine how many significant digits of precision that you obtain in your answer as a function of the number of terms in the series. How many terms are necessary to reach machine precision?
Added by Brittany W.
Close
Step 1
Step 1: The series for *e* is given by: $$e = \sum_{n=0}^{\infty} \frac{1}{n!}$$ where *n*! is the factorial of *n*. Show more…
Show all steps
Your feedback will help us improve your experience
Sri K and 86 other Calculus 3 educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write a program to evaluate e by the series: e = 1+1+ 2 + 3+4+3 Test your program as You increase the number of terms in the series. Determine how many significant digits of precision that you obtain in your answer as a function of the number of terms in the series. How many terms are necessary to reach machine precision?
Sri K.
Write a program that approximates the value of $\pi$ by summing the terms of this series: $4 / 1-$ $4 / 3+4 / 5-4 / 7+4 / 9-4 / 11+\ldots$ The program should prompt the user for $n$, the number of terms to sum, and then output the sum of the first $n$ terms of this series. Have your program subtract the approximation from the value of math. pi to see how accurate it is.
The mathematical constant “e” can be expressed as an infinite series: e = 1 + 1/1! + 1/2! + 1/3! + ... Write a program that will print an approximate value of “e” by computing the series out to 1/n!, where n is an integer entered by the user. In other words, calculate: e = 1 + 1/1! + 1/2! + ... + 1/n! Note: “e” will be a floating point type. Hint: Use two “for” loops – one to go through each term, and another to determine the factorial part for each term.
Willis J.
Recommended Textbooks
Calculus: Early Transcendentals
Thomas Calculus
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD