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.