View previous topic :: View next topic |
Author |
Message |
Freiza Grandmaster Cheater
Reputation: 22
Joined: 28 Jun 2010 Posts: 662
|
Posted: Tue Jul 05, 2011 12:36 am Post subject: |
|
|
Jorg hi wrote: | What kind of interview is this? |
This is a question of Artificial Intelligence. like 8 queen problem and water jug problem.
if you have got the answer ignore reading next few lines:
there are many solutions to it.
But the best solution requires only 2 weighing.
Step 1) make group of 3-3-2.
Step 2) let us call group 1 : a1 a2 a3
group 2 : b1 b2 b3
group 3 : c1 c2
now weigh group 1's on one side and group 2's on the other side of the balance.
if both side are equal then heavier ball is in group 3.
now we weigh c1 and c2. to find out the heavier one
if group 1's side is heavier then
take a1 and a2 . if a1 and a2 are equal then a3 is heavier or the heavier one is obviously heavy
same for group 2.
|
|
Back to top |
|
 |
Ricardo I post too much
Reputation: 1
Joined: 25 Sep 2007 Posts: 4418
|
Posted: Tue Jul 05, 2011 11:38 am Post subject: |
|
|
Freiza wrote: | Jorg hi wrote: | What kind of interview is this? |
This is a question of Artificial Intelligence. like 8 queen problem and water jug problem.
if you have got the answer ignore reading next few lines:
there are many solutions to it.
But the best solution requires only 2 weighing.
Step 1) make group of 3-3-2.
Step 2) let us call group 1 : a1 a2 a3
group 2 : b1 b2 b3
group 3 : c1 c2
now weigh group 1's on one side and group 2's on the other side of the balance.
if both side are equal then heavier ball is in group 3.
now we weigh c1 and c2. to find out the heavier one
if group 1's side is heavier then
take a1 and a2 . if a1 and a2 are equal then a3 is heavier or the heavier one is obviously heavy
same for group 2. |
that's.. that's pretty damn smart.
|
|
Back to top |
|
 |
Freiza Grandmaster Cheater
Reputation: 22
Joined: 28 Jun 2010 Posts: 662
|
Posted: Tue Jul 05, 2011 1:01 pm Post subject: |
|
|
@ Ricardo
Thank you.
|
|
Back to top |
|
 |
SF I'm a spammer
Reputation: 119
Joined: 19 Mar 2007 Posts: 6028
|
Posted: Tue Jul 05, 2011 1:44 pm Post subject: |
|
|
That's not answering his question, though. You solved it for... 8 objects? He has to solve it for 36, and what you posted is aleady posted on the site OP linked to.
_________________
|
|
Back to top |
|
 |
Trow Grandmaster Cheater
Reputation: 2
Joined: 17 Aug 2006 Posts: 957
|
Posted: Tue Jul 05, 2011 2:51 pm Post subject: |
|
|
Zacky wrote: | What kind of interview was this? |
Jorg hi wrote: | What kind of interview is this? |
Trick question, Jorg hi?
Anyhow, my friends and I have given up on the question (because we are stupid or something) so if you have a solution, please let me (us) know.
_________________
Get kidnapped often. |
|
Back to top |
|
 |
Freiza Grandmaster Cheater
Reputation: 22
Joined: 28 Jun 2010 Posts: 662
|
Posted: Tue Jul 05, 2011 4:01 pm Post subject: |
|
|
SF wrote: | That's not answering his question, though. You solved it for... 8 objects? He has to solve it for 36, and what you posted is aleady posted on the site OP linked to. |
i think,
The concept is still the same.. now it will take 4 weighs.. now just weigh for
group 1 = 12 balls
group 2 = 12 balls
group 3 = 12 balls.
then the problem will be reduced to 12 ball problem .. hence it is easy to solve it recursively.
And 36 ball problem cannot be solved any lesser than 4 weigh.
|
|
Back to top |
|
 |
|