其他分享
首页 > 其他分享> > MathProblem 68 Four weights and a scale problem

MathProblem 68 Four weights and a scale problem

作者:互联网

Using a balance scale and four weights you must be able to balance any integer load from \(1\) to \(40\). How much should each of the four weights weigh?

Solution

从数学角度来看,需要满足:

\[a\cdot A+b\cdot B+c\cdot C+ d\cdot D=x, \ (1\leq x\leq 40) \]

其中 \(a,b,c,d,\in \{0,1,-1 \}\), \(A>B>C>D\) 是我们要求的。

不妨直接待定系数来求解:

\[\begin{align} A+B+C+ d_1\cdot D&=40\\ A+ B+C+ d_2\cdot D&=39 \end{align} \]

因为此时只有可能移动最小的砝码来达到平衡。所以 \(D=1, d_1=1, d_2=0\)
因此 \(A+B+C=39\)

对于 \(38 \Rightarrow A+B+C-D=38\)
对于 \(37 \Rightarrow A+B+D=37\Rightarrow C=3\)
对于 \(36 \Rightarrow A+B=36\)
对于 \(35 \Rightarrow A+B-D=35\)
对于 $34 \Rightarrow A+B-C+D=34 $
对于 \(33 \Rightarrow A+B-C=33\)
对于 $32 \Rightarrow A+B-C-D=32 $
对于 \(31\Rightarrow A+C+D=31\rightarrow B=9, A=27\)

标签:scale,对于,cdot,MathProblem,36,40,Four,weights,Rightarrow
来源: https://www.cnblogs.com/xinyu04/p/16641588.html