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

Home > Just Math
points or pigeons in square? (Posted on 2019-08-05) Difficulty: 2 of 5
Given 5 points inside a square of side 10 cm, what is the probability that at least two of the points are within 8cm of each other?

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
re: computer soln | Comment 6 of 8 |
(In reply to computer soln by Steven Lord)

Based on charlies observations I went back and had a second look at this problem and now agree that it is impossible as the most spread you can make 4 points is by placing them at the 4 corners, however even this configuration does not leave room for a 5th point without causing a pair to be within 8cm.

With that being said, your code seemed to contradict this so either our thinking was wrong or your code was.  In that regard I think I found the bug in your code and it is in the part where you check if d>=64, after that if statement you then check if flag=1 which only happens once a d>=64 is found.  The problem is you only skip to 2 (thus avoiding incrementing cntng) the second time one of these are found.  So if there is only 1 pair of points that are within 8cm then you will still end up counting them.  Perhaps I am wrong, I think the best proof would be if you could have it output some examples of points that it considers valid.
  Posted by Daniel on 2019-08-05 22:23:45

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