4. How many nonempty subsets of $\{1,2, \ldots, 10\}$ have the property that the sum of its largest element and its smallest element is 11 ?
Answer: 341
Solution: If $a$ is the smallest element of such a set, then $11-a$ is the largest element, and for the remaining elements we may choose any (or none) of the $10-2 a$ elements $a+1, a+2, \ldots,(11-a)-1$. Thus there are $2^{10-2 a}$ such sets whose smallest element is $a$. We also require that $11-a \geq a$ or $a<6$. We see that there are
$$
\sum_{a=1}^{5} 2^{10-2 a}=\sum_{a=0}^{4} 4^{a}=\frac{4^{5}-1}{4-1}=\frac{1023}{3}=341
$$
possible sets.