Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Odd Ball Challenge (details)

by tye (Sage)
on Jun 24, 2005 at 04:53 UTC ( [id://469599]=note: print w/replies, xml ) Need Help??


in reply to Odd Ball Challenge

As stated, there are some ways to attempt a solution that strictly shouldn't be allowed (I'm sure it can be solved at least one of these ways, but I haven't worked through whether it can be solved without using the technique that shouldn't be allowed). If you made them dice instead of balls, if they were numbered, if you had stated that we had sacks or cups or such that we already knew were of equal weight, if we had a pen or other marking device that would not make a detectable change in weight on the balls, or if ...

But it is a subtle point that doesn't detract from the programming challenge (and provides alternate interpretations to make things more interesting) so I'll just leave it at that. (:

I don't know Perl6 and don't have Perl6 so getting it, learning it, and writing a solution-generator for this puzzle are more than I have time for at the moment, so I apologize for not offering or even attempting such. Thanks for the puzzle, though.

- tye        

Replies are listed 'Best First'.
Re^2: Odd Ball Challenge (details)
by Limbic~Region (Chancellor) on Jun 24, 2005 at 12:31 UTC
    tye,
    I said the balls are identical in appearance, I didn't say that there wasn't anyway of keeping track of which ball was which. A human could do it by keeping the groups separate when not being weighed and always put them on the balance the same way, let's just assume your code can too via array indices, hash keys, or method X.

    This isn't a Perl6 challenge. As I said, All solutions, to include Perl6, are welcome. I understand that it is a bit of work for no immediate tangible reward so don't worry about not offering or attempting a solution-generator. Something to think about on a rainy day (-;

    Cheers - L~R

      Of course you can keep balls segregated when not being weighed. Otherwise, the challenge would be hopeless. But you can't, without a change similar to one I mentioned, confidently keep balls segregated from each other on the same side of the balance across a weighing. That limitation prevents some strategies. Coding with or without that limitation will give different sets of solutions. And there is at least one initial division of balls for the first weighing of your problem that either leads to a solution or doesn't depending on whether you accept that limitation.

      "All solutions to include Perl6" means only Perl6 solutions are welcome. With the comma, your sentence just doesn't make sense to me. :) Thanks for clarifying.

      - tye        

        tye,
        Ok - UNCLE! You can assume that the balls will remain in place when on the balance and hence allows you to "number" the balls without affecting their weight.

        Cheers - L~R

Re^2: Odd Ball Challenge (details)
by tlm (Prior) on Jun 25, 2005 at 19:13 UTC

    If you made them dice instead of balls, if they were numbered, if you had stated that we had sacks or cups or such that we already knew were of equal weight, if we had a pen or other marking device that would not make a detectable change in weight on the balls, or if ...

    A typical (if not downright the most typical) way to render this problem is as a search for a counterfeit coin of unknown weight in a collection of fair coins; clearly, with coins, it is not difficult to keep track of the individual coins from one weighing to the next. (BTW, this "coin version" of the puzzle strikes me as realistic enough to suggest the possibility that the puzzle originally arose as an embellishment of a relatively common everyday task.)

    the lowliest monk

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://469599]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-23 18:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found