Title: Ultimate Balance
1TECHNICAL INTERVIEW QUESTION on PUZZLESThe
Ultimate Balance Puzzle
- There are 12 balls, one of which is different in
weight (can be heavier or lighter) - Find the odd ball using less than 3 weightings of
the balance
2The Ultimate Balance Puzzle
- Assume that the balls are identified as b1, b2,
b12. If we determine that a ball is normal, it
will be relabeled N. If we suspect that a ball
could potentially be heavier, lets add a
superscript h to its label. If we suspect that
a ball could potentially be lighter than normal,
lets add a superscript l to its label.
Weigh b1, b2, b3, b4 vs b5, b6, b7, b8
Other results
b1, b2, b3, b4 equals b5, b6, b7, b8
Weigh b9, b10 vs b11, N
b9, b10 equals b11, N
b9, b10 gt b11, N
b9, b10 lt b11, N
Weigh b9h ,b11l vs N, N
b12
Weigh b9l , b11h vs N, N
b9h ,b11l N,N
b9h ,b11l lt N,N
b9h ,b11l gt N,N
b9l ,b11h N,N
b9l ,b11h lt N,N
b9l ,b11h gt N,N
b10
b11
b9
b10
b9
b11
3The Ultimate Balance Puzzle
- Assume that the balls are identified as b1, b2,
b12. If we determine that a ball is normal, it
will be relabeled N. If we suspect that a ball
could potentially be heavier, lets add a
superscript h to its label. If we suspect that
a ball could potentially be lighter than normal,
lets add a superscript l to its label.
Weigh b1, b2, b3, b4 vs b5, b6, b7, b8
The case b1,b2,b3,b4 lt b5,b6,b7,b8 is a mirror
replica of this case and is not shown.
b1, b2, b3, b4 gt b5, b6, b7, b8
Weigh b1h,b2h,b5l vs b3h,b6l,N
b1h,b2h,b5l b3h,b6l,N
b1h,b2h,b5l gt b3h,b6l,N
b1h,b2h,b5l lt b3h,b6l,N
Weigh b1h vs b2h
Weigh b7l vs b8l
Weigh b3h vs N
b1h b2h
b1h gt b2h
b1h lt b2h
b3h N
b3h gt N
b7l b8l
b7l gt b8l
b7l lt b8l
b6
b1
b2
b5
b3
b4
b8
b7
4Was this Content Useful?
Like
Share
Comment
CodeGround Online Testing Platform is an online
assessment and evaluation system that helps
Recruiters conduct online screening tests to
filter candidates before the interview process.
CodeGround Recruitment Tests can be used during
Campus Recruitment or screening walk-in
candidates. CodeGround supports Aptitude Tests,
English Communication Skills Assessments and
Online Coding Contests in C, C, Java, PHP,
Ruby, Python and JavaScript. CodeGround also
supports asynchronous automated interviews.