1. Vasya's dad is good at math, but on the way to the garage, he forgot the code for the digital lock on the garage. In his memory, he recalls that all the digits of the code are different and their sum is 28. How many different codes does dad need to try to definitely open the garage, if the opening mechanism of the lock consists of four disks with a complete set of digits on each?
Solution. Among the digits of the code, there are 9 and 8. Otherwise, since all digits of the code are different, the largest sum of the digits of the code would not exceed $9+7+6+5$. Then the other two digits of the code are no more than 7, and their sum is 11. Only two options are possible: $\{7,4\}$ and $\{6,5\}$. Let's count the number of possible codes. The digit 9 can take any of the 4 positions. Then there will be three possibilities left for 8. Thus, the number of different arrangements of 9 and 8 will be $4 \cdot 3=12$. The two remaining positions must be taken by either 7 and 4, or 5 and 6, and for each pair, there are two options. Therefore, the number of possible codes is $12 \cdot 4=48$. Answer: 48.