in reply to Re^3: Puzzle: The Ham Cheese Sandwich cut. in thread Puzzle: The Ham Cheese Sandwich cut.
Exactly. If all points lie on the same line, that line is the correct line.
Btw, where I am so far, I may actually end up using some kind of (VERY nonstandard) tree to get from n^2 to n*lg(n). That would make you right :-)
Re^5: Puzzle: The Ham Cheese Sandwich cut.
by BrowserUk (Patriarch) on Nov 17, 2005 at 22:04 UTC
|
Yes. The tree would have to be a "multi-dimensional R-B tree"--not that I have the foggiest clue how you would construct one (yet).
Okay, you've satified me on that case, but what about this one.
Two groups of 3 points; one of the first group and two of the second lie on a straight line. The other two points of the first group lie either side of that line ('scuse the crude drawings, but if I can't visualise it, I can't program it:):
+-------------+
| \ |
| x x |
| \ |
| \ |
| x . |
| \ |
| . |
+-------------+
No matter where you put the third point of the second group, other than on that line, the problem is insoluble. I think?
The same logic applies to the higher dimensions also. (I think).
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] |
|
| [reply] |
|
| [reply] [d/l] |
|
I think we have to have a practical definition of which group a point on the line is in.
You could go with neither, or both (I'd suggest "both").
Then if you put the 3rd point off the line, that half-plane has 3 points of that color, and the other half-plane has 2 points. "At most" -- well, you can't split a point, so it "at most" must be ceil(n/2).
On the other hand, choosing "neither" means that one side has 1 point, and the other side has 0, each of which is "at most" n/2.
<p.
We just have to get the definitions right.
-QM
--
Quantum Mechanics: The dreams stuff is made of
| [reply] |
|
| [reply] [d/l] |
|
|
|
I think we have to have a practical definition of which group a point on the line is in.
You could go with neither, or both (I'd suggest "both").
It's neither. Otherwise, there's no way to satisfy the condition that either set contain at most half the points if the set contains an odd number of elements.
There's an analogy with the partition phase of quicksort: given a pivot, one divides the set of points into three: those points less than the pivot, those point greater than the pivot, and those equal to the pivot. One recurses into the first two groups.
| [reply] |
|
|
|