Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Odd Ball Challenge

by greenFox (Vicar)
on Jun 24, 2005 at 04:01 UTC ( [id://469595]=note: print w/replies, xml ) Need Help??


in reply to Odd Ball Challenge

"How many ways are there to measure 12 balls in groups of two 3 times so that you are guaranteed to know which ball is odd and how it is odd?"

That sentence completely threw me. 12/2 = 6, how can you possibly measure 6 groups with just three measurements? Or maybe it was 12/2*3??? Heres my best attempt, I am sure it can be improved upon :)

What possibile groupings of the 12 balls would allow you to pick the one odd ball after just three measurements?

--
Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho

Replies are listed 'Best First'.
Re^2: Odd Ball Challenge
by Limbic~Region (Chancellor) on Jun 24, 2005 at 12:00 UTC
    greenFox,
    The question was a restatement of the riddle itself and I probably did a poor job of capturing it. Let me be a little more verbose. Each time you use the balance, you are going to be comparing 2 groups (left and right) which may or may not represent the total number of balls (12). That's the part about 12 balls in groups of 2. You can only use the balance 3 times.

    The problem as I see it can be attacked at least 2 ways. The first is just to exhaustively calculate all possible groupings which should result in balanced pairs over 3 tries and sift through the aftermath attempting to pick a set that can answer the riddle. The second is to assess what information is gained after each weighing and determine which ways might lead to a correct solution (which will require backtracking).

    Personally, I have no idea how to go about writing this code and am not even sure if the approaches I described are the right ones to use. It was keeping me awake the other night so I figured if it got under my skin my fellow monks would like it too.

    Cheers - L~R

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-24 23:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found