ion of n (n ranging between 1 and 80) for (a) x = 15 and (b) x = −15. [You can plot the two cases either as different curves on the same plot or in different plots, whichever is clearer.] Discuss the contributions of truncation and roundoff to the fractional error for the different values of x and n. Also discuss how you could reduce truncation and roundoff errors in order to estimate e x more accurately using the Taylor series.
ion of n (n ranging between 1 and 80) for (a) x = 15 and (b) x = −15. [You can plot the two cases either as different curves on the same plot or in different plots, whichever is clearer.] Discuss the contributions of truncation and roundoff to the fractional error for the different values of x and n. Also discuss how you could reduce truncation and roundoff errors in order to estimate e x more accurately using the Taylor series.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
USING PYTHON NOT MATLAB
We can use the sum of the first n terms of the Taylor series of e x with a = 0 to estimate the value of the exponential function. Using a logarithmic y axis, plot the fractional error in the estimated e x (compared to numpy.exp(x)) as a function of n (n ranging between 1 and 80) for (a) x = 15 and (b) x = −15. [You can plot the two cases either as different curves on the same plot or in different plots, whichever is clearer.] Discuss the contributions of truncation and roundoff to the fractional error for the different values of x and n. Also discuss how you could reduce truncation and roundoff errors in order to estimate e x more accurately using the Taylor series.
Expert Solution
Step 1: Program approach
- Import the necessary libraries (numpy and matplotlib.pyplot)
- Define the function to calculate the nth term of the Taylor series for (where x is the input parameter and n is the term number) and to calculate the estimated value of using the first n terms of the Taylor series
- Define the function to calculate the fractional error between the estimated value of and the actual value (computed using numpy.exp(x))
- Set the values of x for which the error is to be calculated (x = 15 and x = -15 in this case)
- For each value of x, loop through the values of n from 1 to 80 (inclusive), and calculate the corresponding fractional error using the functions defined above
- Plot the fractional error as a function of n for each value of x, using a logarithmic y-axis
- Display the resulting plots
Step by step
Solved in 4 steps with 3 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY