- Source: Balance puzzle
- Source: Balance (puzzle)
A balance puzzle or weighing puzzle is a logic puzzle about balancing items—often coins—to determine which holds a different value, by using balance scales a limited number of times. These differ from puzzles that assign weights to items, in that only the relative mass of these items is relevant.
For example, in detecting a dissimilar coin in three weighings (n = 3), the maximum number of coins that can be analyzed is 33 − 1/2 = 13. Note that with 3 weighs and 13 coins, it is not always possible to determine the identity of the last coin (whether it is heavier or lighter than the rest), but merely that the coin is different. In general, with n weighs, you can determine the identity of a coin if you have 3n − 1/2 - 1 or less coins. In the case n = 3, you can truly discover the identity of the different coin out of 12 coins.
This twelve-coin version of the problem appeared in print as early as 1945 and Guy and Nowakowski explain it "was popular on both sides of the Atlantic during WW2; it was even suggested that it be dropped over Germany in an attempt to sabotage their war effort".
Nine-coin problem
A well-known example has up to nine items, say coins (or balls), that are identical in weight except one, which is lighter than the others—a counterfeit (an oddball). The difference is perceptible only by weighing them on scale—but only the coins themselves can be weighed. How can one isolate the counterfeit coin with only two weighings?
= Solution
=To find a solution, we first consider the maximum number of items from which one can find the lighter one in just one weighing. The maximum number possible is three. To find the lighter one, we can compare any two coins, leaving the third out. If the two coins weigh the same, then the lighter coin must be one of those not on the balance. Otherwise, it is the one indicated as lighter by the balance.
Now, imagine the nine coins in three stacks of three coins each. In one move we can find which of the three stacks is lighter (i.e. the one containing the lighter coin). It then takes only one more move to identify the light coin from within that lighter stack. So in two weighings, we can find a single light coin from a set of 3 × 3 = 9.
By extension, it would take only three weighings to find the odd light coin among 27 coins, and four weighings to find it from 81 coins.
Twelve-coin problem
A more complex version has twelve coins, eleven of twelve of which are identical. If one is different, we don't know whether it is heavier or lighter than the others. This time the balance may be used three times to determine if there is a unique coin—and if there is, to isolate it and determine its weight relative to the others. (This puzzle and its solution first appeared in an article in 1945.) The problem has a simpler variant with three coins in two weighings, and a more complex variant with 39 coins in four weighings.
= Solution
=This problem has more than one solution. One is easily scalable to a higher number of coins by using base-three numbering: labelling each coin with a different number of three digits in base three, and positioning at the n-th weighing all the coins that are labelled with the n-th digit identical to the label of the plate (with three plates, one on each side of the scale labelled 0 and 2, and one off the scale labelled 1). Other step-by-step procedures are similar to the following. It is less straightforward for this problem, and the second and third weighings depend on what has happened previously, although that need not be the case (see below).
Four coins are put on each side. There are two possibilities:
1. One side is heavier than the other. If this is the case, remove three coins from the heavier side, move three coins from the lighter side to the heavier side, and place three coins that were not weighed the first time on the lighter side. (Remember which coins are which.) There are three possibilities:
1.a) The same side that was heavier the first time is still heavier. This means that either the coin that stayed there is heavier or that the coin that stayed on the lighter side is lighter. Balancing one of these against one of the other ten coins reveals which of these is true, thus solving the puzzle.
1.b) The side that was heavier the first time is lighter the second time. This means that one of the three coins that went from the lighter side to the heavier side is the light coin. For the third attempt, weigh two of these coins against each other: if one is lighter, it is the unique coin; if they balance, the third coin is the light one.
1.c) Both sides are even. This means that one of the three coins that was removed from the heavier side is the heavy coin. For the third attempt, weigh two of these coins against each other: if one is heavier, it is the unique coin; if they balance, the third coin is the heavy one.
2. Both sides are even. If this is the case, all eight coins are identical and can be set aside. Take the four remaining coins and place three on one side of the balance. Place 3 of the 8 identical coins on the other side. There are three possibilities:
2.a) The three remaining coins are lighter. In this case you now know that one of those three coins is the odd one out and that it is lighter. Take two of those three coins and weigh them against each other. If the balance tips then the lighter coin is the odd one out. If the two coins balance then the third coin not on the balance is the odd one out and it is lighter.
2.b) The three remaining coins are heavier. In this case you now know that one of those three coins is the odd one out and that it is heavier. Take two of those three coins and weigh them against each other. If the balance tips then the heavier coin is the odd one out. If the two coins balance then the third coin not on the balance is the odd one out and it is heavier.
2.c) The three remaining coins balance. In this case you just need to weigh the remaining coin against any of the other 11 coins and this tells you whether it is heavier, lighter, or the same.
Variations
Given a population of 13 coins in which it is known that 1 of the 13 is different (mass) from the rest, it is simple to determine which coin it is with a balance and 3 tests as follows:
1) Subdivide the coins in to 2 groups of 4 coins and a third group with the remaining 5 coins.
2) Test 1, Test the 2 groups of 4 coins against each other:
a. If the coins balance, the odd coin is in the population of 5 and proceed to test 2a.
b. The odd coin is among the population of 8 coins, proceed in the same way as in the 12 coins problem.
3) Test 2a, Test 3 of the coins from the group of 5 coins against any 3 coins from the population of 8 coins:
a. If the 3 coins balance, then the odd coin is among the remaining population of 2 coins. Test one of the 2 coins against any other coin; if they balance, the odd coin is the last untested coin, if they do not balance, the odd coin is the current test coin.
b. If the 3 coins do not balance, then the odd coin is from this population of 3 coins. Pay attention to the direction of the balance swing (up means the odd coin is light, down means it is heavy). Remove one of the 3 coins, move another to the other side of the balance (remove all other coins from balance). If the balance evens out, the odd coin is the coin that was removed. If the balance switches direction, the odd coin is the one that was moved to the other side, otherwise, the odd coin is the coin that remained in place.
= With a reference coin
=If there is one authentic coin for reference then the suspect coins can be thirteen. Number the coins from 1 to 13 and the authentic coin number 0 and perform these weighings in any order:
0, 1, 4, 5, 6 against 7, 10, 11, 12, 13
0, 2, 4, 10, 11 against 5, 8, 9, 12, 13
0, 3, 8, 10, 12 against 6, 7, 9, 11, 13
If the scales are only off balance once, then it must be one of the coins 1, 2, 3—which only appear in one weighing.
If there is never balance then it must be one of the coins 10–13 that appear in all weighings. Picking out the one counterfeit coin corresponding to each of the 27 outcomes is always possible (13 coins one either too heavy or too light is 26 possibilities) except when all weighings are balanced, in which case there is no counterfeit coin (or its weight is correct). If coins 0 and 13 are deleted from these weighings they give one generic solution to the 12-coin problem.
If two coins are counterfeit, this procedure, in general, does not pick either of these, but rather some authentic coin. For instance, if both coins 1 and 2 are counterfeit, either coin 4 or 5 is wrongly picked.
= Without a reference coin
=In a relaxed variation of this puzzle, one only needs to find the counterfeit coin without necessarily being able to tell its weight relative to the others. In this case, clearly any solution that previously weighed every coin at some point can be adapted to handle one extra coin. This coin is never put on the scales, but if all weighings are balanced it is picked as the counterfeit coin. It is not possible to do any better, since any coin that is put on the scales at some point and picked as the counterfeit coin can then always be assigned weight relative to the others.
A method which weighs the same sets of coins regardless of outcomes lets one either
(among 12 coins A–L) conclude if they all weigh the same, or find the odd coin and tell if it is lighter or heavier, or
(among 13 coins A–M) find the odd coin, and, at 12/13 probability, tell if it is lighter or heavier (for the remaining 1/13 probability, just that it is different).
The three possible outcomes of each weighing can be denoted by "\" for the left side being lighter, "/" for the right side being lighter, and "–" for both sides having the same weight. The symbols for the weighings are listed in sequence. For example, "//–" means that the right side is lighter in the first and second weighings, and both sides weigh the same in the third weighing. Three weighings give the following 33 = 27 outcomes. Except for "–––", the sets are divided such that each set on the right has a "/" where the set on the left has a "\", and vice versa:
/// \\\
\// /\\
/\/ \/\
//\ \\/
\/– /\–
–\/ –/\
/–\ \–/
\\– //–
–\\ –//
\–\ /–/
/–– \––
–/– –\–
––/ ––\
–––
As each weighing gives a meaningful result only when the number of coins on the left side is equal to the number on the right side, we disregard the first row, so that each column has the same number of "\" and "/" symbols (four of each). The rows are labelled, the order of the coins being irrelevant:
\// A light /\\ A heavy
/\/ B light \/\ B heavy
//\ C light \\/ C heavy
\/– D light /\– D heavy
–\/ E light –/\ E heavy
/–\ F light \–/ F heavy
\\– G light //– G heavy
–\\ H light –// H heavy
\–\ I light /–/ I heavy
/–– J light \–– J heavy
–/– K light –\– K heavy
––/ L light ––\ L heavy
––– M either lighter or heavier (13-coin case),
or all coins weigh the same (12-coin case)
Using the pattern of outcomes above, the composition of coins for each weighing can be determined; for example the set "\/– D light" implies that coin D must be on the left side in the first weighing (to cause that side to be lighter), on the right side in the second, and unused in the third:
1st weighing: left side: ADGI, right side: BCFJ
2nd weighing: left side: BEGH, right side: ACDK
3rd weighing: left side: CFHI, right side: ABEL
The outcomes are then read off the table. For example, if the right side is lighter in the first two weighings and both sides weigh the same in the third, the corresponding code "//– G heavy" implies that coin G is the odd one, and it is heavier than the others.
Generalization to multiple scales
In another generalization of this problem, we have two balance scales that can be used in parallel. For example, if you know exactly one coin is different but do not know if it is heavier or lighter than a normal coin, then in
n
{\displaystyle n}
rounds, you can solve the problem with at most
(
5
n
−
5
)
/
2
{\displaystyle (5^{n}-5)/2}
coins.
Generalization to multiple unknown coins
The generalization of this problem is described in Chudnov.
Let
R
n
{\displaystyle \mathbb {R} ^{n}}
be the
n
{\displaystyle n}
-dimensional Euclidean space and
[
e
1
,
e
2
]
{\displaystyle [\mathrm {e} ^{1},\mathrm {e} ^{2}]}
be the inner product of vectors
e
1
{\displaystyle \mathrm {e} ^{1}}
and
e
2
{\displaystyle \mathrm {e} ^{2}}
from
R
n
.
{\displaystyle \mathbb {R} ^{n}.}
For vectors
e
=
(
e
1
,
…
,
e
n
)
∈
R
n
{\displaystyle \mathrm {e} =(e_{1},\dots ,e_{n})\in \mathbb {R} ^{n}}
and subsets
E
=
{
e
j
}
⊆
R
n
,
{\displaystyle E=\{\mathrm {e} ^{j}\}\subseteq \mathbb {R} ^{n},}
the operations
(
⋅
)
∗
{\displaystyle (\cdot )^{*}}
and
(
⋅
)
+
{\displaystyle (\cdot )^{+}}
are defined, respectively, as
e
∗
=
(
s
i
g
n
(
e
i
)
)
i
{\displaystyle \mathrm {e} ^{*}=(sign(e_{i}))_{i}}
;
E
∗
=
{
(
e
j
)
∗
}
{\displaystyle E^{*}=\{(\mathrm {e} ^{j})^{*}\}}
,
e
+
=
(
|
s
i
g
n
(
e
i
)
|
)
i
{\displaystyle \mathrm {e} ^{+}=(|sign(e_{i})|)_{i}}
,
E
+
=
{
(
e
j
)
+
}
.
{\displaystyle E^{+}=\{(\mathrm {e} ^{j})^{+}\}.}
By
I
n
{\displaystyle I^{n}}
we shall denote the discrete [−1; 1]-cube in
R
n
{\displaystyle \mathbb {R} ^{n}}
; i.e., the set of all sequences of length
n
{\displaystyle n}
over the alphabet
I
=
{
−
1
,
0
,
1
}
{\displaystyle I=\{-1,0,1\}}
The set
I
t
n
=
{
x
∈
I
n
|
w
(
x
)
≤
t
}
⊆
I
n
{\displaystyle I_{t}^{n}=\{\mathrm {x} \in I^{n}|w(\mathrm {x} )\leq t\}\subseteq I^{n}}
is the discrete ball of radius
t
{\displaystyle t}
(in the Hamming metric
w
(
)
{\displaystyle w()}
) with centre at the point
0
.
{\displaystyle \mathrm {0} .}
Relative weights of
n
{\displaystyle n}
objects are given by a vector
x
=
(
x
1
,
…
,
x
n
)
∈
I
n
,
{\displaystyle \mathrm {x} =(x_{1},\dots ,x_{n})\in I^{n},}
which defines the configurations of weights of the objects: the
i
{\displaystyle i}
th object has standard weight if
x
i
=
0
;
{\displaystyle x_{i}=0;}
the weight of the
i
{\displaystyle i}
th object is greater (smaller) by a constant (unknown) value if
x
i
=
1
{\displaystyle x_{i}=1}
(respectively,
x
i
=
−
1
{\displaystyle x_{i}=-1}
). The vector
x
+
{\displaystyle \mathrm {x} ^{+}}
characterizes the types of objects: the standard type, the non-standard type (i.e., configurations of types), and it does not contain information about relative weights of non-standard objects.
A weighing (a check) is given by a vector
h
∈
I
n
;
{\displaystyle \mathrm {h} \in I^{n};}
the result of a weighing for a situation
x
∈
I
n
{\displaystyle \mathrm {x} \in I^{n}}
is
s
(
x
;
h
)
=
s
i
g
n
(
[
x
;
h
]
)
.
{\displaystyle s(\mathrm {x} ;\mathrm {h} )=sign([\mathrm {x} ;\mathrm {h} ]).}
The weighing given by a vector
h
=
(
h
1
,
…
,
h
n
)
{\displaystyle \mathrm {h} =(h_{1},\dots ,h_{n})}
has the following interpretation: for a given check the
i
{\displaystyle i}
th object participates in the weighing if
h
i
≠
0
{\displaystyle h_{i}\neq 0}
; it is put on the left balance pan if
h
i
<
0
{\displaystyle h_{i}<0}
and is put on the right pan if
h
i
>
0.
{\displaystyle h_{i}>0.}
For each weighing
h
{\displaystyle \mathrm {h} }
, both pans should contain the same number of objects: if on some pan the number of objects is smaller than as it should be, then it receives some
r
(
h
)
=
[
h
;
1
,
…
,
1
]
{\displaystyle r(\mathrm {h} )=[\mathrm {h} ;1,\dots ,1]}
reference objects. The result of a weighing
s
(
x
;
h
)
{\displaystyle s(\mathrm {x} ;\mathrm {h} )}
describes the following cases: the balance if
s
(
x
;
h
)
=
0
{\displaystyle s(\mathrm {x} ;\mathrm {h} )=0}
, the left pan outweighs the right one if
s
(
x
;
h
)
=
−
1
{\displaystyle s(\mathrm {x} ;\mathrm {h} )=-1}
, and the right pan outweighs the left one if
s
(
x
;
h
)
=
1.
{\displaystyle s(\mathrm {x} ;\mathrm {h} )=1.}
The incompleteness of initial information about the distribution of weights of a group of objects is characterized by the set of admissible distributions of weights of objects
Z
⊆
I
n
,
{\displaystyle Z\subseteq I^{n},}
which is also called the set of admissible situations, the elements of
z
∈
Z
{\displaystyle z\in Z}
are called admissible situations.
Each weighing
h
{\displaystyle \mathrm {h} }
induces the partition of the set
I
n
{\displaystyle I^{n}}
by the plane (hyperplane )
[
x
;
h
]
=
0
{\displaystyle [\mathrm {x} ;\mathrm {h} ]=0}
into three parts
W
(
s
|
I
n
;
h
)
=
{
x
∈
I
n
|
s
(
x
;
h
)
=
s
}
{\displaystyle W(s|I^{n};\mathrm {h} )=\{\mathrm {x} \in I^{n}|s(\mathrm {x} ;\mathrm {h} )=s\}}
,
s
∈
I
,
{\displaystyle s\in I,}
and defines the corresponding partition of the set
Z
=
W
(
0
|
Z
,
h
)
+
W
(
1
|
Z
,
h
)
+
W
(
−
1
|
Z
,
h
)
,
{\displaystyle Z=W(0|Z,\mathrm {h} )+W(1|Z,\mathrm {h} )+W(-1|Z,\mathrm {h} ),}
where
W
(
s
|
Z
,
h
)
=
W
(
s
|
I
n
,
h
)
∩
Z
.
{\displaystyle W(s|Z,\mathrm {h} )=W(s|I^{n},\mathrm {h} )\cap Z.}
Definition 1. A weighing algorithm (WA)
A
{\displaystyle {\mathcal {A}}}
of length
m
{\displaystyle m}
is a sequence
A
=<
A
1
,
…
,
A
m
>
,
{\displaystyle {\mathcal {A}}=<\mathrm {A} _{1},\dots ,\mathrm {A} _{m}>,}
where
A
j
:
I
j
−
1
→
I
n
{\displaystyle \mathrm {A} _{j}:I^{j-1}\to I^{n}}
is the function determining the check
h
j
=
A
j
(
s
j
−
1
)
;
h
j
∈
I
n
,
{\displaystyle \mathrm {h} ^{j}=\mathrm {A} _{j}(s^{j-1});\mathrm {h} ^{j}\in I^{n},}
at each
j
{\displaystyle j}
th step,
j
=
1
,
2
,
…
,
m
,
{\displaystyle j=1,2,\dots ,m,}
of the algorithm from the results of
s
j
−
1
=
(
s
1
,
…
,
s
j
−
1
)
∈
I
j
−
1
{\displaystyle \mathrm {s} ^{j-1}=(s_{1},\dots ,s_{j-1})\in I^{j-1}}
weighings at the previous steps (
h
1
=
A
1
(
)
{\displaystyle \mathrm {h} ^{1}=\mathrm {A} _{1}()}
is a given initial check).
Let
S
(
Z
,
A
)
{\displaystyle S(Z,{\mathcal {A}})}
be the set of all
(
Z
,
A
)
{\displaystyle (Z,{\mathcal {A}})}
-syndromes and
W
(
s
|
A
)
⊆
I
{\displaystyle W(s|{\mathcal {A}})\subseteq I}
be the set of situations with the same syndrome
s
{\displaystyle s}
; i.e.,
W
(
s
|
A
)
=
{
z
∈
I
m
|
s
(
z
|
A
)
=
s
}
{\displaystyle W(s|{\mathcal {A}})=\{\mathrm {z} \in I^{m}|s(z|{\mathcal {A}})=s\}}
;
W
(
s
|
Z
;
A
)
=
W
(
s
|
A
)
∩
Z
.
{\displaystyle W(s|Z;{\mathcal {A}})=W(s|{\mathcal {A}})\cap Z.}
Definition 2. A WA
A
{\displaystyle {\mathcal {A}}}
is said to:
a) identify the situations in a set
Z
{\displaystyle Z}
if the condition
|
W
(
s
|
Z
,
A
)
|
=
1
{\displaystyle |W(s|Z,{\mathcal {A}})|=1}
is satisfied for all
s
∈
S
(
Z
A
)
;
{\displaystyle s\in S(Z{\mathcal {A}});}
b) identify the types of objects in a set
Z
{\displaystyle Z}
if the condition
|
W
+
(
s
|
Z
A
)
|
=
1
{\displaystyle |W^{+}(s|Z{\mathcal {A}})|=1}
is satisfied for all
s
∈
S
(
Z
A
)
.
{\displaystyle s\in S(Z{\mathcal {A}}).}
It is proved in that for so-called suitable sets
Z
{\displaystyle Z}
an algorithm of identification the types identifies also the situations in
Z
.
{\displaystyle Z.}
As an example the perfect dynamic (two-cascade) algorithms with parameters
n
=
11
,
m
=
5
,
t
=
2
{\displaystyle n=11,m=5,t=2}
are constructed in which correspond to the parameters of the perfect ternary Golay code (Virtakallio-Golay code). At the same time, it is established that a static WA (i.e. weighting code) with the same parameters does not exist.
Each of these algorithms using 5 weighings finds among 11 coins up to two counterfeit coins which could be heavier or lighter than real coins by the same value. In this case the uncertainty domain (the set of admissible situations) contains
1
+
2
C
11
1
+
2
2
C
11
2
=
3
5
{\displaystyle 1+2C_{11}^{1}+2^{2}C_{11}^{2}=3^{5}}
situations, i.e. the constructed WA lies on the Hamming bound for
t
=
2
{\displaystyle t=2}
and in this sense is perfect.
To date it is not known whether there are other perfect WA that identify the situations in
I
t
n
{\displaystyle I_{t}^{n}}
for some values of
n
,
t
{\displaystyle n,t}
. Moreover, it is not known whether for some
t
>
2
{\displaystyle t>2}
there exist solutions for the equation
∑
i
=
0
t
2
i
C
n
i
=
3
m
{\displaystyle \sum _{i=0}^{t}2^{i}C_{n}^{i}=3^{m}}
(corresponding to the Hamming bound for ternary codes) which is, obviously, necessary for the existence of a perfect WA. It is only known that for
t
=
1
{\displaystyle t=1}
there are no perfect WA, and for
t
=
2
{\displaystyle t=2}
this equation has the unique nontrivial solution
n
=
11
,
m
=
5
{\displaystyle n=11,m=5}
which determines the parameters of the constructed perfect WA.
References
External links
A playable example of the second puzzle
Two-pan balance and generalized counterfeit coin problem
A balance puzzle is a mathematical puzzle which challenges the solver to distribute a subset of numbers so that the several sides of a stylized diagram representing a balance scale are equal. The balance puzzle is a classical number puzzle in the World Puzzle Championship.
It consists of a mobile or tree structure, with designated positions where the player must hang specified weights, so that everything balances.
See examples below.
There are usually 8 to 12 consecutive numbers (weights) to place, which makes it much smaller than, for example, sudoku.
As in many mathematical puzzles, the solution is unique.
Expert puzzlers often prefer puzzles where the rules explicitly states that there is only one solution.
This property allows for some reasoning strategies.
It also makes generating puzzles a bit more difficult.
Variants
Balloon balance: same puzzle but with negatives weights also to be placed. example
Kata Kunci Pencarian:
- Metabolisme
- Saturnus
- Perluasan alam semesta
- Shaun the Sheep 3D
- E. Phillips Oppenheim
- Daftar lagu rock instrumental
- Fedspeak
- Winston Churchill sebagai penulis
- Daftar episode Shaun the Sheep
- Balance puzzle
- Balance (puzzle)
- Balance
- Escape room
- Art of Balance
- Super Puzzle Fighter II Turbo
- One-factor-at-a-time method
- Power of three
- Counterfeit (disambiguation)
- The Challenge: Battle for a New Champion