Question
There are 5 bags labeled 1 to 5. All the coins in a given bag have the same weight. Some bags have coins of weight 10 gm, others have coins of weight 11 gm. I pick 1, 2, 4, 8, 16 coins respectively from bags 1 to 5. Their total weight comes out to 323 gm. Then the product of the labels of the bags having 11 gm coins is ___.
Official answer and solution
- Official answer
- 12
- From
- Official GATE 2014 answer key
Solution
Formulate a binary weight equation for the excess weight above the baseline 10 gm weight.
Let the 5 bags be labeled .
The number of coins picked from bags 1 to 5 are respectively.
Total number of coins picked = coins.
If all 31 coins had weight 10 gm each, the total weight would be:
Each coin of weight 11 gm adds of excess weight.
The actual measured total weight is .
Therefore, the excess weight is:
Let indicate whether bag has 11 gm coins () or 10 gm coins ():
Expressing 13 in binary base 2:
So:
- (bag 1 has 11 gm coins)
- (bag 3 has 11 gm coins)
- (bag 4 has 11 gm coins)
The bags containing 11 gm coins are bags 1, 3, and 4.
The product of their labels is:
12
Summing the labels () instead of multiplying them ().
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2014 Computer Science and Information Technology (CS) Session 1
- Question
- 47 of 65, printed as CS Q.37
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.