May I thank Slippy for holding the fort during my enforced absence, I think she adds a touch of class to the proceedings; speaking of which, I made bail so I could say
Lzzie:
?'GIT'
Gosh, It's Tough
Good Imagination TryAgain
Good, I Trust
Genuinely In Touch
Generous In Thought
Gyroscopic Inertial Thruster
Great Inventive Thinkster
Gin In Tonic
Grinning I Think
Everyone a winner!
Rap:
Weights
A+B+C+D=40
One has to be 1?-let A=1
To get two the difference between A and the next weight (B) has to be 2
B-A=B-1=2
So B=3
Now A+B+C+D=4+C+D=40
Or C+D=36
So C & D have to be evenly distributed around 36
Call this difference X
C+X=D-X
C=D-2X
C+D=D-2X+D=36
2D-2X=36
D-X=18
C+X=18
Most reasonable X is 9
C=18-9=9
C=18+9=27
So the 4 weights are
1,3,9,27
I checked and this works, but I'm not sure if it is unique
Now, you would think there is no more to say about that; but
Mark:
WEIGHTS
Rap is correct, however, he could have arrived at the answer more directly had he not abandoned his initial strategy.
As an aside, it's somewhat fortunate that the strategy works, because on the surface, there is nothing that requires 1 to be a weight. The weights must sum to 40, and all integers between 1 and 40 must be uniquely represented by the various sums and differences, but 1 could be covered by 5 and 6 (6-5=1) for example.
To generalize rap's strategy:
Step 1: Start with 1.
Step 2: To get the next weight, double what you've already got and add 1. If the current total weight is X, then the next weight is 2X+1 because 2X+1 - X = X+1.
Step 3: If not finished, go to step 2.
1, 3, 9, 27
Note that these are powers of 3. For a given weight, to determine the arrangement of weights on the balance scale, follow this procedure:
Step 1: Write the desired weight in base 3 (digits are 0, 1, and 2)
Step 2: From right to left: If the current digit is a 0 or a 1, leave it unchanged. If the current digit is a 2, change it to a -1 and add 1 (adhering to base 3 addition rules) to the next digit.
Step 3: If not finished, go to step 2.
Step 4: If a ternary digit for a given weight (1, 3, 9, 27) is 0, it is not used in the weighing. If the digit is 1, place the corresponding weight on the left pan. If the digit is -1, place the corresponding weight on the right pan.
Example: 25 = 0221 base 3
The sequence of digit modifications is:
0 2 2 1 (leave the 1 alone)
0 2 -1 1 (change the 2 to a -1)
1 0 -1 1 (add 1 to the next 2 which results in a carry: 2+1 = 10)
27 goes on the left
9 is not used
3 goes on the right
1 goes on the left
(27+1) - 3 = 25
This works because it leaves the original base 3 number unchanged. When you convert a 2 to a -1, you are subtracting 3 times the place value. By adding one to the next digit, you are adding back 3 times that place value (which in base 3 is the next place value).
Print it out folks, you will never see better!