2. In the wallet of the merchant Hans, there are 20 silver coins worth 2 crowns each, 15 silver coins worth 3 crowns each, and 3 gold ducats (1 ducat equals 5 crowns). In how many ways can Hans pay a sum of 10 ducats? Coins of the same denomination are indistinguishable.
Answer: 26

Solution. If the merchant paid $x$ coins at 2 crowns each, $y$ coins at 3 crowns each, and $z$ ducats (i.e., $z$ times 5 crowns), we get the system: $2 x+3 y+5 z=50, x \in[0 ; 20], y \in[0 ; 15], z \in[0 ; 3]$.

a) When $z=0$, we get the equation $2 x+3 y=50$, which has suitable solutions under the condition for $y=4,6,8,10,12,14$ - a total of 6 solutions.

b) When $z=1$, we get the equation $2 x+3 y=45$, which has suitable solutions under the condition for $x=0,3,6,9,12,15,18$ - a total of 7 solutions.

When $z=2$, there are 7 solutions, and when $z=3$, there are 6 solutions. These two cases could be analyzed similarly to the previous one. However, this is not necessary, using the fact that the amount to be paid is exactly half of all the merchant's money. Therefore, the number of ways using 2 ducats is equal to the number of ways using 1 ducat (since 2 ducats will remain in the wallet); similarly, the number of ways using 3 ducats is equal to the number of ways without ducats.

Thus, the total number of ways: $6+7+7+6=26$.

Answer to variant 172: 17 ways.

Answer to variant 173: 26 ways.

Answer to variant 174: 22 ways.