in reply to Re: (GOLF) pearls and perl
in thread (GOLF) pearls and perl
my prose explanation may be unclear but i think it's correct. look closely at the example code. running it gives:
pearl #0 was light. found in 3 tests. pearl #0 was heavy. found in 3 tests. pearl #1 was light. found in 3 tests. pearl #1 was heavy. found in 3 tests. pearl #2 was light. found in 3 tests. pearl #2 was heavy. found in 3 tests. pearl #3 was light. found in 3 tests. pearl #3 was heavy. found in 3 tests. pearl #4 was light. found in 3 tests. pearl #4 was heavy. found in 3 tests. pearl #5 was light. found in 3 tests. pearl #5 was heavy. found in 3 tests. pearl #6 was light. found in 3 tests. pearl #6 was heavy. found in 3 tests. pearl #7 was light. found in 3 tests. pearl #7 was heavy. found in 3 tests. pearl #8 was light. found in 3 tests. pearl #8 was heavy. found in 3 tests. pearl #9 was light. found in 3 tests. pearl #9 was heavy. found in 3 tests. pearl #11 was light. found in 3 tests. pearl #10 was heavy. found in 3 tests. pearl #11 was light. found in 3 tests. pearl #11 was heavy. found in 3 tests.
if you get to step 2a, you've already used the balance once and you know that the pearl is in 9-12 and therefore 1-8 are all fakes. weighing 1-3 against 9-11 (your second use of the balance) tells you immediately whether it's 12 or one of 9-11 as well as whether it's light or heavy. if you know it's 12 you have to do another weigh (your third) to tell if it's lighter or heavier. if it's one of the other 3, you weigh 9 against 10 (your third). equal means that it's 11 and you know if it's light or heavy from the previous 1-3 vs 9-11 weighing. if you know that it's heavy you take the heavier of the two you just weighed; lighter, you take the lighter of the two.
is that more clear?
actually, i think your version of 2a will run into four weighs. take the case where it's 12. first, you've already weighed 1-4 against 5-8 before you get there. then you weigh 9 against 10 (#2). they're the same so you weigh 9 against 11 (#3). you know that it's 12 but don't have any way of knowing if it's heavy or light so your best bet then would be to guess and be happy with a 50/50 chance of losing your head.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: (GOLF) pearls and perl
by particle (Vicar) on Apr 13, 2002 at 15:00 UTC |