Question: Write a function called approximate_e that uses the following formula to compute e, Euler's number: e = sigma^infinity_k = 0 1/k! = 1 + 1

Write a function called approximate_e that uses the following formula to compute e, Euler's number: e = sigma^infinity_k = 0 1/k! = 1 + 1 + 1/2 + 1/6 + 1/24 +... Instead of going to infinity, the function stops at the smallest k for which the approximation differs from exp(1) (i.e., the value returned MATLAB's built-in function) by no more than the positive scalar, delta, which is the only input argument. The first output of the function is the approximate value of e, while the second is k. You are not allowed to use the built-in function factorial
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
