- #1
ged25
- 6
- 0
I have this problem where I'm having trouble solving so any help would be appreciated.
Here's the problem:
You have a balancing scale and a set of unique weights. Each weight that you have is a power of 3 ie you have weights 1,3,9,27 etc. You are given a weight w.
The problem is to tell which weight goes on which pan so that the scale is balanced.
For example:
Suppose you are given weight with value 35.
Solution:
The left pan will have 35 + 1 = 36
The right pan will have 27 + 9 = 36
Another example with weight 52.
The left pan will have 52 + 27 + 3 = 82
The right pan will have 81 + 1 = 82
I hope the problem is clear.
I haven't gotten further than understanding that value on the pans must be 3x or 3x + 1.
Here's the problem:
You have a balancing scale and a set of unique weights. Each weight that you have is a power of 3 ie you have weights 1,3,9,27 etc. You are given a weight w.
The problem is to tell which weight goes on which pan so that the scale is balanced.
For example:
Suppose you are given weight with value 35.
Solution:
The left pan will have 35 + 1 = 36
The right pan will have 27 + 9 = 36
Another example with weight 52.
The left pan will have 52 + 27 + 3 = 82
The right pan will have 81 + 1 = 82
I hope the problem is clear.
I haven't gotten further than understanding that value on the pans must be 3x or 3x + 1.