Comment on Programmer tries to explain binary search to the police
adrian783@lemmy.world 11 months agoyou can do it like you weight 6v6 then 3v3 then for the last weighing you weight the 2 out of 3.
or you weigh 4v4 to find out which grouping of 4 the light weight person is in, then do 2v2 and 1v1.
ChairmanMeow@programming.dev 11 months ago
You don’t know if the person is lighter or heavier yet.
Sagifurius@lemm.ee 11 months ago
That’s not the question.
ChairmanMeow@programming.dev 11 months ago
I mean that not knowing it is part of the question, and the proposed solution doesn’t work without knowing if the person is heavier or lighter.
If you know if the person is heavier or lighter, the question becomes trivial.
Sagifurius@lemm.ee 11 months ago
The question is to figure out who is different, not how they are different. That takes one more step, half the time.