Question

Problem Three: (Based on Attaway, Chapter 5, Exercise 20) The inverse of the mathematical constant e can be approximated as f
0 0
Add a comment Improve this question Transcribed image text
Answer #1

clc;
clear;


%%e0 (ACTUAL VALUE OF e)
e0=exp(1);

%%loop for calculation of 1/e=x

i=2;
while i>0
x=(1-1/i)^i;
e=1/x;
  
if abs(e0-e)<.0001
break;
end
i=i+1;
end

n_for_approx_e=i
e_calculated=1/x

Add a comment
Know the answer?
Add Answer to:
Problem Three: (Based on Attaway, Chapter 5, Exercise 20) The inverse of the mathematical constant e can be approximated as follows: a c 7n Write a script that will loop through values of n (star...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Self-check exercise: While-loops The value of (π^2)/8 can be approximated by the series Write a script...

    Self-check exercise: While-loops The value of (π^2)/8 can be approximated by the series Write a script that evaluates this expression, ignoring all terms that are strictly smaller than .000001. Your script should display the number of terms summed and the sum. Use a while-loop. Think about the initialization of your variables and the order of computation carefully! In the loop body you need to calculate the value of a term only once. We use the above series for approximating (π^2)/8...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT