All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math
Evaluate area (Posted on 2024-03-28) Difficulty: 3 of 5
Given a 1*1 square.
Find the area of the subset of points that are closer to its center than to any of the square’s sides.

No Solution Yet Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Monte Carlo method | Comment 2 of 3 |
(In reply to solution by Charlie)

hit=0;
for trial=1:10000000
  x=rand-.5;
  y=rand-.5;
  s=[x+.5 .5-x y+.5 .5-y norm([x y])];
  s2=find(s==min(s));
  if s2==5
    hit=hit+1;
  end
end
hit/trial


finds

ans =
                 0.2189057
                 
agreeing with the analytic answer.

  Posted by Charlie on 2024-03-28 19:53:08
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (0)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information