Question: 2. e Approximation Your task is to test the performance of an e approximation. Euler's number e 2:71828 can be approximated with the following formula:

2. e Approximation Your task is to test the performance of an e approximation. Euler's number e 2:71828 can be approximated with the following formula: e = 1 0! + 1 1! + 1 2! + 1 3! + : : : (1) Complete the following steps (a) Create a module called eApproximation.py (b) Import the math module to get the factorial() function (c) Import the time module to get the time() function. (d) Write a function e approx(n) that uses an accumulator an returns and approximation of e as given by equation (1) (e) Test the running time of e approx() by running the function with inputs from 100 to 1000 and printing out the results.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!