
04.1. 27 balls, labelled by numbers from 1 to 27, are in a red, blue or yellow bowl. Find the possible numbers of balls in the red bowl, if the averages of the labels in the red, blue, and yellow bowl are 15, 3 ja 18, respectively.


Solution. Let $R, B$, and $Y$, respectively, be the numbers of balls in the red, blue, and yellow bowl. The mean value condition implies $B \leq 5$ (there are at most two balls with a number $3$ ). $R, B$ and $Y$ satisfy the equations

$$
\begin{aligned}
R+B+Y & =27 \\
15 R+3 S+18 Y & =\sum_{j=1}^{27} j=14 \cdot 27=378
\end{aligned}
$$

We eliminate $S$ to obtain $4 R+5 Y=99$. By checking the possibilities we note that the pairs of positive integers satisfying the last equation are $(R, Y)=(21,3),(16,7),(11,11)$, $(6,15)$, and $(1,19)$. The last two, however, do not satisfy $B=27-(R+Y) \leq 5$. We still have to ascertain that the three first alternatives are possible. In the case $R=21$ we can choose the balls $5,6, \ldots, 25$, in the red bowl, and 2,3 and 4 in the blue bowl; if $P=16$, $7,8, \ldots, 14,16,17, \ldots, 23$, can go to the red bowl and $1,2,4$ and 5 in the blue one, and if $P=11$, the red bowl can have balls $10,11, \ldots 20$, and the blue one $1,2,3,4,5$. The red bowl can contain 21,16 or 11 balls.
