Euler's number is an irrational constant given by 
Starting with x=0, count the number of times you can add a uniformly distributed random number to x before it equals or exceeds 1. Repeat this N times, then calculate the estimate of Euler's number by computing the mean of those counts.
The more iterations calcualted, the closer the approximation should be.
The input to your function should be the number of iterations of the algorithm to perform (N) and the output should be the estimate of Euler's number.
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers132
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15780 Solvers
-
Construct an index vector from two input vectors in vectorized fashion
449 Solvers
-
Create an index-powered vector
938 Solvers
-
1655 Solvers
-
438 Solvers
More from this Author12
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!