9

You are an ancient merchant, and you need to weigh out many different items of many different weights. To do so, you'll design a scale to weigh objects. Unlike a standard scale, your scale will have four different pans, at your choice of four distances from the fulcrum.

You will also select four different standardized masses, of weights of your choice.

Your goal is to be able to weigh out every possible integer weight from 1 gram up to N grams, for the largest possible value of N.

To "weigh out" a weight means that there must be some arrangement of the weight and your standardized masses on the pans of your scale such that the scale exactly balances. Also, assume that your scale exactly balances when all four pans are empty.

If your scale only had 2 pans equidistant from the fulcrum, the optimal value of N would be 40. With 4 pans, how much higher can you go?

Edit: There was a bug in the computer program I used to find my best solution. I have fixed it, and am refinding a best solution.

isaacg
  • 6,915
  • 1
  • 19
  • 52
  • 1
    I'm not sure it matters, but should we be assuming the four pans must lie in a straight line? – msh210 Feb 07 '24 at 07:41
  • 1
    Do you know the optimal solution? I have the impression that with 4 weights and 4 pans this will be a big enough number to make this infeasible for pen and paper. – quarague Feb 07 '24 at 08:00
  • @msh210 Yes, a straight line. – isaacg Feb 07 '24 at 16:53
  • @quarague I wrote a computer program, I believe it's found the best solution. – isaacg Feb 07 '24 at 16:53
  • @isaacg Can you mathematically prove that your answer is optimal? There does exist a simple proof that the optimal solution for the two-pan equal-distance case with $n$ weights is $(3^n-1)/2$ (which is $40$ when $n=4$). I have a, answer for this problem, but I cannot imagine how to prove it optimal, so I am not sure if it is worth posting. – Mike Earnest Feb 07 '24 at 22:28
  • @MikeEarnest I'd encourage you to post a solution, even if you don't know that the solution is optimal. I don't have a simple proof, just a computer program. If someone else comes up with a better solution than yours later, that's fine. Such puzzles are common on this site, including https://puzzling.stackexchange.com/q/120118/2187, https://puzzling.stackexchange.com/q/125025/2187, https://puzzling.stackexchange.com/q/98590/2187 – isaacg Feb 07 '24 at 23:44
  • 1
    I learned a new word - fulcrum :) – Dmitry Kamenetsky Feb 08 '24 at 08:45
  • Were you able to fix the bug? Is my solution optimal? – Mike Earnest Feb 14 '24 at 16:39
  • @MikeEarnest I fixed the bug. I'd accidentally been searching for ways to weigh negative weights: -1, -2, -3, etc. With the bug fixed, your solution is optimal, according to my program. – isaacg Feb 14 '24 at 16:40

1 Answers1

5

Here is my solution. I do not know if this is optimal or not.

I can achieve $N=3(5^4-1)/4=468.$

Here is the method.

We specify the locations of the pans by their $x$-coordinates, where $x=0$ is the fulcrum. The pans should be placed at $x=-1,1,2,3$. The measures of the weights are $1,5,5^2$ and $5^3$.

Note that any integer in the range between $-(5^4-1)/4$ and $+3(5^4-1)/4$ can be uniquely written in the form $\sum_{i=0}^3 d_i5^i$, where $d_i\in \{-1,0,1,2,3\}$ (see Lemma). This allows you to weigh any item with weights in that range. Place the item to be weighed in the pan at $x=-1$, then for each $i\in \{0,1,2,3\}$, place the weight with measure $5^i$ in the pan at $x=d_i$. If $d_i=0$, you simply omit that weight.

Proof of Lemma:

It is well-known that every number in the range $0$ to $5^n-1$ can be uniquely written in the form $\sum_{i=0}^{n-1}a_i5^i$, with each $a_i\in \{0,1,2,3,4\}$. This is just how the base-5 system works. That is, $$0\le x\le 5^n-1\quad \iff \quad x=\sum_{i=0}^{n-1}a_i5^i$$ Now, subtract $1+5+\dots+5^{n-1}=(5^n-1)/4$ from both sides. We see that $$-\frac{5^n-1}4\le x\le \frac{3(5^n-1)}4\quad \iff\quad x=\sum_{i=0}^{n-1}(a_i-1)5^i$$ Conclude by letting $d_i=a_i-1$.

Mike Earnest
  • 32,336
  • 6
  • 92
  • 237
  • 2
    Good answer, but I suspect there is room for improvement. (For example, you always place the item to be weighed in the same pan, when it could go in any of them, with or without some accompanying weights.) – fljx Feb 08 '24 at 09:42
  • I had the same thought, but having the target weight in a different pan is equivalent to having an appropriate multiple of the target weight in the original pan. Since 469 factorizes into 7×67, you'll be hard-pressed to modify this setup into one that can accommodate an appropriate ratio. – AxiomaticSystem Feb 08 '24 at 18:44