Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Homework 1 Consider the following infinite series representations of : 4 = 1 - 1 3 + 1 5 - 1 7 + 1 9
Homework
Consider the following infinite series representations of :
dots
dots
In this HW you will write a PYTHON program to calculate using the above expressions.
a For first evaluation retain 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, ie which
expression converges faster?
b Repeat the calculations by calculating the true error instead of relative error, ie 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 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, ie 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started