Puzzle: find the minimum number of weights

Posted by avd on Stack Overflow See other posts from Stack Overflow or by avd
Published on 2010-04-07T04:25:33Z Indexed on 2010/04/07 4:33 UTC
Read the original article Hit count: 234

Filed under:
|

I came across this question: say given two weights 1 and 3, u can weigh 1,2 (by 3-1),3,4 (by 3+1). Now find the minimum number of weights so that you can measure 1 to 1000.

So the answer was 1,3,9,27...

I want to know how do you arrive at such a solution means powers of 3. What is the thought process?

Source: http://classic-puzzles.blogspot.com/search/label/Google%20Interview%20Puzzles

Solution: http://classic-puzzles.blogspot.com/2006/12/solution-to-shopkeeper-problem.html

© Stack Overflow or respective owner

Related posts about puzzle

Related posts about interview-questions