MS_Kekas wrote:
You are given $n$ not necessarily distinct real numbers $a_1, a_2, \ldots, a_n$. Let's consider all $2^n-1$ ways to select some nonempty subset of these numbers, and for each such subset calculate the sum of the selected numbers. What largest possible number of them could have been equal to $1$?
For example, if $a = [-1, 2, 2]$, then we got $3$ once, $4$ once, $2$ twice, $-1$ once, $1$ twice, so the total number of ones here is $2$.
Let us consider the $2^n$ subsets (including the empty subset, whose sum of elements is zero).
If all elements are zero, the number of subsets whose sum is $1$ is zero.
If at least one element $x_0$ is nonzero :
If a subset with sum $1$ contains $x_0$, then the same subset without $x_0$ has a sum $\ne 1$
If a subset with sum $1$ does not contain $x_0$, then the same subset with $x_0$ has a sum $\ne 1$
So the number of subsets with sum $1$ is $\le$ the number of subsets with sum $\ne 1$
And so the requested number is $\le\frac 122^n$
And $2^{n-1}$ indeed can be reached, for example with $\{1,0,0,...,0\}$
Hence the answer $\boxed{2^{n-1}}$