We have a scale and 7 balls. 1 ball is heavier than all the
rest. How to determine the heaviest ball with only 3
possible weighing attempts?
Answers were Sorted based on User's Feedback
Answer / subir
(Step-1)Divide the balls into 2 groups of 3 each, and weigh
them. If they weigh same, then the 7th ball outside is the
heaviest.
(Step-2) If not then,
one of the 3 balls group being weighed is heavier. Take
them down and consider the heavier group, with one ball on
each side of the balance.
(Step-3)if they measure unequal, then the heavier one is
detected, and if they measure equal then the one outside is
heavier.
Is This Answer Correct ? | 64 Yes | 5 No |
Answer / simon y
Sorry guys, you failed the interview, and you got the
question wrong. It is what is the least number of
weighings - the answer is 2 not 3.
1) Take 2 random groups of 3 balls, compare them. If they
are the same you got lucky - the heavier ball is the one
you didn't weigh. If they are different you need step 2
2) Take the 3 heavier balls from weighing 1) and randomly
compare 2 of them. If one is heavier, that is the hevier
ball - if tehy are the same, then the one you didn't weigh
is the heavy one.
Is This Answer Correct ? | 29 Yes | 10 No |
divide balls as 3 + 3 + 1 and
1. weight them 3 balls and 3 balls if both are equal the
outer ball is bigger one. else
2. Add the single ball which is not weighted before to the
higher weight 3 balls and now it total balls will be 3+ 1
and divide them as 2 + 2
3. In second attempt weight them and find which is having
higher weight then take the higher weight group and in 3rd
attempt compare them individual and you will get the bigger
ball in three attempts.
Is This Answer Correct ? | 11 Yes | 4 No |
Answer / kanishka sukumar
select 2 random groups of 3 balls and after weighing them
1.if equal
the one not weighed is heaviest
else
measure any 2 balls of the heavier group
2. if equal
the one not weighed is heaviest
else
the heavier one is the heaviest
Is This Answer Correct ? | 6 Yes | 3 No |
Answer / jitendra
pehale to 3=3 gr (one bahar rakha) 3=3 weigth karane ke bad
konsawla jada heavy hai wo pata chal jayega to 3 rai gaye
bad me 2=2 gr banage (pehala wala jo baki tha aur ye teen
)dono ka weight karane ke bad konsa heavy hai pata chal
jayega lastly 2 bache then final answer....
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / adub
12 vs 34
12 vs 56
1 vs 5
1) Establish a control group by weighing 12 vs 34. If they
are equal then 1234 are all control. If they are not equal
than 567 are all control.
2) Weigh two of the non-control group against two of the
control group. If they are equal than the other non-control
balls contain the outlier. If they are not equal than you
have determined heavier/lighter and narrowed it down to 2 balls.
3) Weight one of two balls against the control to find
which one is the outlier. example 1 vs 5. If equal then
you know it's the other ball.
note: There is one case where you would have to check
results from the first weighing to find out heavier/lighter.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / kiran
I think its impossible to answer this with CERTAINTY...we
could get a right answer but we cannot GUARANTEE a correct
answer ALWAYS...
Best i can get to is guarantee an answer in 4 comparision...
Is This Answer Correct ? | 1 Yes | 5 No |
let a,b,c,d,e,f,g be the 7 balls,
group them
a and b group 1
b and c group 2 and others one group
weigh group 1 against group 2
if they are not equal weigh the individual balls with
respect to each other
if they are not equal(group 1 is not equal to group 2)
weigh e against f, if they are not equal heaviest among
them is ur answer else g is the answer.
Is This Answer Correct ? | 6 Yes | 22 No |
Whats is abstraction in oops?
what is pointers
What is multiple inheritance? Give Example
Get me a number puzzle game-program
What is oops and why we use oops?
write knight tour problem which is present in datastructure
how much classes are used in c++
Explain the concepts involved in Object Oriented programming.
in the following, A D B G E C F Each of the seven digits from 0,1,2,3,4,5,6,7,8,9 is: a)Represented by a different letter in abov fig: b)Positioned in the fig abov so tht A*B*C,B*G*E,D*E*F are equal. wch does g represents? C
where is memory for struct allocated? where is memory for class-object allocated? I replied for struct in stack and for class-object in heap. THen he asked if class has struct member variable what happens.class on heap and what about struct in that class? couldnt ans :( :-?
The type of variable a pointer points to must be the part of pointer's definition so that:
WHEN A COPY CONSTER IS CALL ?