Grandpa keeps geese, pigs, goats, and chickens - a total of 40 animals. For every goat, there are 3 geese. If there were 8 fewer chickens, there would be as many as geese and pigs combined. If Grandpa traded a quarter of the geese for chickens at a ratio of 3 chickens for 1 goose, he would have a total of 46 animals.

How many of each animal does Grandpa keep?

(M. Volfová)
Let's denote the quantities of each type of animal by their initial letters. The information from the problem can be written step by step as follows:

\[
\begin{aligned}
h + p + k + s & = 40, \\
h & = 3k, \\
s - 8 & = h + p, \\
40 - \frac{1}{4}h + \frac{3}{4}h & = 46.
\end{aligned}
\]

From the last equation, we get \(\frac{1}{2}h = 6\), so \(h = 12\). From the second equation, we find that \(k = 4\). Substituting these values into the remaining two equations, we get

\[
\begin{aligned}
& 12 + p + 4 + s = 40, \quad \text{so} \quad p + s = 24, \\
& s - 8 = 12 + p, \quad \text{so} \quad s = p + 20.
\end{aligned}
\]

From this, we further derive

\[
\begin{aligned}
p + (p + 20) & = 24, \\
2p & = 4, \\
p & = 2, \quad \text{and thus} \quad s = 22.
\end{aligned}
\]

The grandfather keeps 12 geese, 2 pigs, 4 goats, and 22 chickens.

Scoring suggestion. 2 points for determining the number of geese; 1 point for determining the number of goats; 3 points for determining the number of pigs and chickens.