4. There is an unlimited supply of square glasses in 10 colors. In how many ways can 4 glasses be inserted into a $2 \times 2$ window frame so that some color appears in both the upper and lower halves of the window.
Solution. If the upper half of the glass is of one color (one of 10), then the colors of the lower glasses can be chosen in $10^{2}-9^{2}=19$ ways. If the upper glasses are different $\left(10 * 9=90\right.$ ways to choose), then the colors of the lower ones can be chosen in $10^{2}-8^{2}=36$ ways.

In total $10 * 19+90 * 36=190+3240=3430$ ways.

Answer: 3430.