Question: In python 3, write function approxE(n) to compute e(euler's number) to n significant digits, using Bernoullis formula e= (1 +1/k)^k and a while loop. In

In python 3, write function

approxE(n) to compute e(euler's number) to n significant digits, using Bernoullis formula e= (1 +1/k)^k and a while loop. In this question, we will define the answer to be correct to n significant digits when two consecutive approximations agree to n significant digits. When two consecutive approximations agree to n significant digits, return the later approximation (which will be more accurate). For example, if (1 +1/4)^4 and (1 +1/5)^5 agree to n digits, then you would return (1 +1/5)^5.

EX: input=1, output=2.25

input=2, output=2.44140625

input=3,output=2.6328787177279187

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!