## Task A-3.5.

For a pair of numbers $\{a, b\}$, we say it has a weight of $|a-b|$. In how many ways can the set $\{1,2, \ldots, 12\}$ be divided into six pairs such that the total sum of the weights of these pairs is 30?
## Solution.

Let's denote the pairs as $\left\{a_{i}, b_{i}\right\}$ for $i=1,2, \ldots, 6$, where $a_{i}$ is always the larger and $b_{i}$ the smaller number in the pair. Notice that the sum of all numbers is

$$
a_{1}+b_{1}+a_{2}+b_{2}+\cdots+a_{6}+b_{6}=1+2+\cdots+12=78
$$

On the other hand, the sum of the weights is

$$
\left(a_{1}-b_{1}\right)+\left(a_{2}-b_{2}\right)+\cdots+\left(a_{6}-b_{6}\right)=30
$$

By adding these two equations, we get that $2\left(a_{1}+a_{2}+\cdots+a_{6}\right)=108$, or the sum of the larger numbers in all pairs is 54.

Since $7+8+9+10+11+12=3 \cdot 19=57$, it follows that we need to subtract 3 from this sum to get 54. This can be done in three ways.

i) The set of larger numbers is $\{4,8,9,10,11,12\}$. This means the set of smaller numbers is $\{1,2,3,5,6,7\}$. In the pair with the number 4, any of the three smaller numbers can be paired, and for the remaining numbers, we can arbitrarily choose the smaller number in the pair. This gives us a total of $3 \cdot 5 \cdot 4 \cdot 3 \cdot 2 \cdot 1=360$ ways.

2 points

ii) The set of larger numbers is $\{5,7,9,10,11,12\}$. This means the set of smaller numbers is $\{1,2,3,4,6,8\}$. In the pair with the number 5, any of the four smaller numbers can be paired, and in the pair with the number 7, any of the six smaller numbers except those in the first pair (so also four possibilities). In this case, we have $4 \cdot 4 \cdot 4 \cdot 3 \cdot 2 \cdot 1=384$ ways.

iii) The set of larger numbers is $\{6,7,8,10,11,12\}$. This means the set of smaller numbers is $\{1,2,3,4,5,9\}$. Similarly to the previous cases, we have $5 \cdot 4 \cdot 3 \cdot 3 \cdot 2 \cdot 1=360$ ways.

## COUNTY COMPETITION IN MATHEMATICS

## 4th grade - high school - A variant

## February 28, 2019.

## IF A STUDENT HAS A DIFFERENT APPROACH TO SOLVING THE TASK, THE COMMITTEE IS OBLIGED TO GRADE AND EVALUATE THAT APPROACH IN AN APPROPRIATE MANNER.