Let $a_{1}, a_{2}, \ldots, a_{n}$ be real numbers. Consider the $2^{n}-1$ (non-empty) sums formed from these. How many of these can be positive?
Solution. Let's consider the numbers $2^{n-1}, 2^{n-2}, \ldots, 2^{0}=1$ as our starting point. We will show that by appropriately assigning signs to these numbers, any non-empty sum can be positive from 0 to $2^{n-1}$.

First, take the sequence $a_{1}=-2^{n-1}, a_{2}=-2^{n-2}, \ldots, a_{n}=-2^{0}$, where all terms are negative, meaning there is no positive non-empty sum among them.

If we then consider the non-empty sums for any other assignment of signs, the sign of such a sum depends only on the sign of the term with the largest absolute value, since the absolute value of the sum of all smaller absolute value terms is less than that of this single term.

Any positive integer between 0 and $2^{n-1}$ can be uniquely written in binary with at most $n$ digits. If the number $M=2^{k_{1}}+2^{k_{2}}+\ldots+2^{k_{p}}$ (where $k_{1}>k_{2}>\ldots>k_{p}$) is written in binary, then by choosing the signs of $a_{k_{1}}, a_{k_{2}}, \ldots, a_{k_{p}}$ to be positive and all others to be negative, the sums that will be positive are those whose largest index is some $k_{j}$. For a given $j$, the number of such sums is $2^{k_{j}}$, so in total there are $2^{k_{1}}+2^{k_{2}}+\ldots+2^{k_{p}}=M$ such sums.