Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PYTHON uer the lowing (Cool) tae 72 6 m2 m=1 The summation up to a finite integer n, i.e. Em=1 m2, is called a truncated
PYTHON
uer the lowing (Cool) tae 72 6 m2 m=1 The summation up to a finite integer n, i.e. Em=1 m2, is called a truncated series. a) (25 points) Write a program that asks the user to enter an integer n, and computes the truncated series Cm=1 ma Sample input/output: Enter an integer n > 0: 10 The truncated series evaluates to: 1.5497677311665408 Enter an integer n > 0: 100 The truncated series evaluates to: 1.6349839001848923 Any correct solution is worth full grade. Submit your solution in a file called Prob2a.py including your name and ID number. b) (25 points) For every truncated series at some integer n, the difference | - Im=1 mil is called the approximation error. Write a program that asks the user to enter a number e and computes the smallest n such that the truncated series at n has approximation error less than e. Note: 2 To compute the approximation error, you may use the Python value of a by including from math import pi. Sample input/output: Enter a desired approximation error: 0.03 The smallest n is: 33 Enter a desired approximation error: 0.001 The smallest n is: 1000Step 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