Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


interview question that i never managed to answer
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Tue Jul 05, 2011 12:36 am    Post subject: Reply with quote

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 Wink

same for group 2.
Back to top
View user's profile Send private message Send e-mail
Ricardo
I post too much
Reputation: 1

Joined: 25 Sep 2007
Posts: 4418

PostPosted: Tue Jul 05, 2011 11:38 am    Post subject: Reply with quote

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 Wink

same for group 2.


that's.. that's pretty damn smart.
Back to top
View user's profile Send private message
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Tue Jul 05, 2011 1:01 pm    Post subject: Reply with quote

@ Ricardo

Thank you.
Back to top
View user's profile Send private message Send e-mail
SF
I'm a spammer
Reputation: 119

Joined: 19 Mar 2007
Posts: 6028

PostPosted: Tue Jul 05, 2011 1:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
Trow
Grandmaster Cheater
Reputation: 2

Joined: 17 Aug 2006
Posts: 957

PostPosted: Tue Jul 05, 2011 2:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Tue Jul 05, 2011 4:01 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites