Task 2: (50 points) Write a script that will ask the user to input an error tolerance and call a function to estimate th
Posted: Sun May 15, 2022 12:23 pm
Task 2: (50 points) Write a script that will ask the user to input an error tolerance and call a function to estimate the mathematical constant, n. Estimate the value of it with an error less than the user-specified error tolerance. Error of the estimated value is calculated as the absolute value of the difference between the estimated value and the actual value of A. Have the user input a (positive) error tolerance value BETWEEN 1.0 x 10-2 and 1.0 x 10-6. Include error handling to make sure that the user inputs a number in the specified range without terminating the function if incorrect input is given. Calculate the value of at using the following Taylor Series expansion: 4 Σ(-1)*, 4 = 4 2n + 1 + 4 5 4 7 + .. = TC n=0 Since it is not practical to add an infinite number of terms, include the number of terms that is required to produce the first sum that gives a value with an error that is less than the error tolerance. Output the number of terms required to determine A within the error tolerance, the estimate of , and the resulting error.
. Write a Python module containing a script that will call functions to complete the tasks as described below. If not specified, you can control program flow as you wish.
. Write a Python module containing a script that will call functions to complete the tasks as described below. If not specified, you can control program flow as you wish.