HWK1 - HWK #1 Solutions Problem 1.1 In part (a) we can use...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
HWK #1 Solutions Problem 1.1 In part (a) we can use the following weights: 1 gm, 2 gm, 4 gm, 8 gm, 16 gm, 32 gm In part (b) we can use the following weights: 1 gm, 1 gm, 3 gm, 3 gm, 9 gm, 9 gm, 27 gm, 27 gm In part (c) we can use the following weights: 1 gm, 3 gm, 9 gm, 27 gm Object to be weighed: x gm object to be weighed part (a) balance scale part (b) balance scale part (c) balance scale left pan right pan left pan right pan left pan right pan 17 gm 16 gm, 1 gm 17 gm 9 gm, 3 gm, 3 gm, 1 gm, 1 gm 17 gm 27 gm 17 gm , 9 gm, 1 gm 25 gm 16 gm, 8 gm, 1 gm 25 gm 9 gm, 9 gm, 3 gm, 3 gm, 1 gm 25 gm 27 gm, 1 gm 25 gm , 3 gm 38 gm 32 gm, 4 gm, 2 gm 38 gm 27 gm, 9 gm, 1gm, 1 gm 38 gm 27 gm, 9 gm, 3 gm 38 gm , 1 gm (a)(ii) Each positive integer has a unique binary representation. Specifically, each integer between 1 and 63 - and so each integer between 1 and 40 - has a unique binary representation in the form a 5 *32 + a 4 *16 + a 3 *8 + a 2 *4 + a 1 *2 + a 0 *1 where each a i is 0 or 1. Given an object of 1-40 grams, the a i values correspond to the weights needed: a i = 1 means the 2 i gm weight will be used. Example: 39 = 32 + 4 + 2 + 1. To weigh a 39-gram object, place the object on the right pan and the weights (32 gm, 4 gm, 2 gm, 1 gm) on the left pan. (c)(ii) Each integer has a unique base 3 (ternary) representation. Specifically, each integer between 1 and 80 - and hence between 1 and 40 - has a unique ternary representation in the form t 3 *27 + t 2 *9 + t 1 *3 + t 0 *1 where each t i is 0, 1, or 2.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Example: 23 = 9 + 9 + 3 + 1 + 1 and an object weighing 23 grams can be weighed by balancing with weights of 9 gm, 9 gm, 3 gm, 1 gm, and 1 gm. However, since we have only one weight of each size, it is a little more complicated if the weight's ternary representation has a "2". However, we make the following two observations: 2*3 x = 1*3 x+1 - 1*3 x To use the scale, we can put balancing weights on the pan alongside the object to be weighed. Example 1: 19 = 0201 3 , so we could weigh a 19-gram object with a 1-gram weight and two 9-gram weights. However, we have only one 9-gram weight. We can do the following: Put the object on the left pan. Put the 1-gram weight on the right pan. Instead of putting two 9-gram weights on the right pan, we use a 27-gram weight on the right pan and a 9-gram weight on the other (left) pan.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/26/2010 for the course ECE 290 taught by Professor Brown during the Fall '08 term at University of Illinois at Urbana–Champaign.

Page1 / 6

HWK1 - HWK #1 Solutions Problem 1.1 In part (a) we can use...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online