02/24/2003 Archived Entry: "One of those interview questions microsoft uses"
 

[Previous entry: "dude ... I like japanese fashion ;)"] [Main Index] [Next entry: "Kiki and Lala's Cookies"]

One of those interview questions microsoft uses ...

Suppose you have 8 billiard balls, and one of them slightly heavier than the rest, but the only way to tell is by putting it on a scale against another. What's the fewest number of times you'd have to use the scale to find the heavier ball?

My first answer involves using the scale 3 times, but my friend found a better way by using the scale only 2 times. See if you can figure it out. :-)


Replies: 9 comments

- @ 00/00/ 00:00 PST


- @ 00/00/ 00:00 PST


oh woops, didn't see someone already mentioned it (didn't realize more recent comments are at the top)

- deified @ 07/04/2008 12:54 PM PST


*SPOILER ALERT: do not read if you're still trying to figure it out*

I initially found a solution that used the scale 3 times, so I was pleased when you said that it could be done using the scale twice.

SOLUTION:

- Split the eight balls into 3 groups. Group A contains 3 balls: A1, A2, and A3. Group B contains 3 balls: B1, B2, and B3. Group C contains 2 balls: C1 and C2.
- Weigh Group A against Group B.
....- If they're the same, then weigh C1 against C2 and you have your answer.
....- If group A is heavier, then weigh A1 against A2.
........- If they're different, then you have your answer.
........- If they're the same, then A3 is the heavy ball.
....- If group B is heavier, then weigh B1 against B2.
........- If they're different, then you have your answer.
........- If they're the same, then B3 is the heavy ball.

- deified @ 07/04/2008 12:53 PM PST


Yup, that's the way to do it.

- kiki @ 03/13/2003 02:33 PM PST


hi, i'm one of stella's friends.

well, you could leave two off the scale, so:

3(a) v. 3(b)
if a==b,
then weight the two off the scale
1(c) v. 1(d)
if a>b, then a=THE ONE

if a ne b,
eliminate three balls from lesser side,
put one ball on the side, and weight two

1(e) v. 1(f)
if e==f,
then last ball is THE ONE
if e ne f,
the heavier one is THE ONE

Scale used twice in all instances.

- howard @ 03/13/2003 01:10 PM PST


Haha, that does sound fun. :-) That's the same way I tried the problem, but that will require using the scale 3 times, so it's something else which will only use the scale twice. :-) Keep 'em coming.

- kiki @ 02/26/2003 08:30 AM PST


Oh. This is only going to work if the building is very high. Even if it doesn't work it'll be fun dropping balls onto Bill's car.

- X-CalyBur @ 02/25/2003 10:33 PM PST


This is probably not the answer you're looking for but how about this: Split the 8 balls so there's 4 on each side and eliminate the 4 balls from the lighter side. Then split the 4 balls you have left over 2 each and weight again. Eliminate the lighter side. Then take the two remaining balls, go up to the roof of Microsoft and look for Bill Gates car parked below. Then drop both of the two balls over the ledge at the same time and see which one hits Bill's car first. A simple physics explaination. A better solution that wouldn't even require the scale is to drop all 8 balls down on Bill's car simultaneously. Oh what fun.

- X-CalyBur @ 02/25/2003 10:31 PM PST



Add A New Comment

Name

E-Mail (optional)

Homepage (optional)

Comments

NOTE: URLS IN COMMENTS ARE NOT ALLOWED!