Question: IS 310 Homework 4 1) Write a loop to approximate the mathematical constant e. Go to https://en.wikipedia.org/wiki/E_(mathematical_constant) to see the formula to do the approximation.

IS 310 Homework 4 1) Write a loop to approximate the mathematical constant e. Go to https://en.wikipedia.org/wiki/E_(mathematical_constant) to see the formula to do the approximation. You can use the factorial function of the math module, which will make your task easier. Find the smallest number of terms in the calculation so that your approximation and math.e deviate less than 2) Write a loop to approximate the mathematical function sine. Go to http://people.math.sc.edu/girardi/m142/handouts/10sTaylorPolySeries.pdf to see the formula to do the approximation. Note that in the formula sin x, x is measured in radian. For example, if x is 13 degrees,x can be converted to radian as follows: x-l3 # x is 13 degrees. x 13 / 180 * math.pi # x is now in radian. You also need to alternate the sign of the terms in the calculation. Use this (-1) ** n where n is the term number. Find the smallest number of terms in the calculation so that your approximation and math.sin(13/180 * math.pi) deviate less than 1.0e-13. (50 points)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
