All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Weights (Posted on 2003-06-23)
You are given N number of weights that are all powers of 2. You are also given an item that weighs 1003 lbs.

(1) Exactly how many of those weights would be needed to balance the weight of the item if you could only use one of each weight?

(2) What's the fewest number of weights you can use to balance the weight of the item if there is an unlimited amount of each weight available to you?

 See The Solution Submitted by luvya Rating: 1.8000 (5 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 answer | Comment 10 of 12 |

Let w be the required number of distinct weights. By the given conditions, 1003 must be expressible as sum of distinct powers of 2. Accordingly, w is equal to the number of 1's in the binary representation of 2.

Now, 1003 is 1111101011 in the binary system which contain eight 1s, so that w =8.

Consequently, precisely 8 of those weights would be needed to balance the weight of the item if one of each weight is used.

Following similar arguments, we observe that for part b, the fewest number of weights that can be used to balance the weight of the item if there is an unlimited amount of each weight available is 8.

Edited on November 9, 2007, 10:00 am
 Posted by K Sengupta on 2007-11-09 09:58:34

 Search: Search body:
Forums (0)