I am posing the problem as a puzzle below, but the actual problem's wording is "Sort 5 numbers in 7 comparisons":
There are five balls of equal sizes, but different weights and different colours. You can identify each ball uniquely based on their colours, but not by their weights. You can assume that no two balls have the same weight.
You have a weighing scale ("pan-balance") that lets you put one ball on each side and lets you determine which is heavier and which is lighter.
Using the weighing scale at most SEVEN times (i.e., you compare any 7 pairs for their relative weights), arrange the five balls in increasing order of their weights.
As an example, you can sort 3 numbers in at most 3 comparisons, i.e., you need no more than 3 comparisons, but it could be done in 2 (only if you are lucky).
2006-09-08
08:28:07
·
5 answers
·
asked by
kali
1