Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following infinite series representations of : 4 = 1 - 1 3 + 1 5 - 1 7 + 1 9 - dots,

Consider the following infinite series representations of :
4=1-13+15-17+19-dots,
28=1+132+152+172+192+dots.
In this HW, you will write a PYTHON program to calculate using the above expressions.
a) For first evaluation retain 8 significant digits in both cases, using the relative error percentage to assess
convergence. How many terms need to be retained in each case to obtain the desired result, i.e., which
expression converges faster?
b) Repeat the calculations by calculating the true error instead of relative error, i.e., comparing your result at
each iteration with true value of (which can be obtained using math. pi in PYTHON). In this part, stop
the iterations when the absolute value of the true error becomes smaller than 10-7. Comment on how the
results for this case compare with those in (a).
c) For (b), also plot the (absolute) true error as a function of iterations to compare the convergence of both
expressions. What do you observe in this plot?
What to submit:
Two separate PYTHON codes for part (a) and (b), which reproduce the results upon execution, i.e., print out
the iteration number, the partial sum and the error directly to the command line.
A very short writeup showing the plot in (c) and providing brief answers to the questions. The writeup should
absolutely not be more than one page.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Demystified

Authors: Andrew Oppel

1st Edition

0072253649, 9780072253641

More Books

Students also viewed these Databases questions