-
Contributing Member
find the weights......
A store keeper want to weight 1 to 4okg of wood according to the user input. What is the minimum number of weights he should buy for fulfill all the user input? what are the weights?
-------------------
suresh
-
Expert Member
Re: find the weights......
He should buy 4 weights. And they are 1,3,9 and 27.
to weigh
1kg = use 1 kg
2 kg = 3 -1 (put 1 kg in the other end of the balance)
3 kg = use 3 kg
4 kg = 3+1
5 kg = 9 -3 -1
6 kg = 9 -3
7 kg = 9 +1 -3
8 kg = 9 -1...and so on.
if you closely look at the weights you can identify that all of them are powers of 3. You can extend this problem up to any powers of 3.
-
Expert Member
Re: find the weights......
minimum number of weights is 6
weighs
1 kg,2 kg,4 kg,8 kg,16 kg,32 kg.
-
Expert Member
Re: find the weights......
Oh! sorry.
I dint saw the reply too.
-
Contributing Member
Re: find the weights......
James give the perfect explanation for this problem...Well done james...Happy to see you back...
-------------------
suresh
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules