Problem 47103. Estimate Pi by Monte Carlo method
Solution Stats
Problem Comments
-
3 Comments
My solution, although giving the correct answers (checked via "format longg" and accepted by the later tests), did not get accepted in the first test. Maybe there is a problem there?
The test suite has been updated to check against a tolerance; hopefully that will overcome the concern mentioned by Undine Falkenhagen.
Tip: Generate the pair of numbers using p = rand(2,n)' (the order that numbers must be used: rand(n,2) does not work for instance); this will not solve the problem, but it's half way there.
Solution Comments
Show commentsProblem Recent Solvers12
Suggested Problems
-
Convert a Cell Array into an Array
1942 Solvers
-
Find the area of the four walls
280 Solvers
-
Element by element multiplication of two vectors
379 Solvers
-
Matlab Basics II - Create a vector with a repeated entry
241 Solvers
-
Return fibonacci sequence do not use loop and condition
688 Solvers
More from this Author2
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!