TITLE: Probability of choosing integers that sum to zero
QUESTION [9 upvotes]: This is just a little problem that occurred to me. I don't know how to go about solving it and thought it would be fun to post here.
Let $N \geq 3$ be a natural number, and let $n \leq N$.

What is the probability that $n$ numbers randomly selected without repetition from $\{1,...,N\}$ have the property that their signs may be chosen so that they sum to $0$?

For example, if $N=n=3$, then the selection $1,2,3$ has the desired property because $3 +(-2) + (-1)=0$.
In this case, $1,2,3$ is the only possible selection and so the probability of obtaining the desired property is $1$.
On the other hand, if $N=3$ and $n=2$, then no selection has the desired property and the probability is therefore $0$.

REPLY [3 votes]: Denote the number of admissible selections by $a_{N,n}$. We have $a_{N+1,3}=a_{N,3}+\left\lfloor\frac N2\right\rfloor$, with $a_{3,3}=1$. This is OEIS sequence A002620. The counts for $n\gt3$ don’t seem to be in OEIS.
I wrote some Java code to compute these counts. Here they are up to $N=16$:
\begin{array}{c|cc}
N\setminus n&3&4&5&6&7&8&9&10&11&12&13&14&15&16\\\hline
3&1\\
4&2&1\\
5&4&3&0\\
6&6&8&3&0\\
7&9&15&9&3&1\\
8&12&26&26&12&4&1\\
9&16&41&52&40&20&5&0\\
10&20&61&101&100&60&25&5&0\\
11&25&86&170&219&170&85&25&5&1\\
12&30&118&276&428&396&255&110&30&6&1\\
13&36&156&417&772&867&651&350&140&42&7&0\\
14&42&202&615&1308&1710&1519&1001&490&182&49&7&0\\
15&49&256&865&2100&3204&3235&2485&1491&693&231&49&7&1\\
16&56&319&1195&3244&5616&6469&5720&3976&2184&924&280&56&8&1\\
\end{array}
(Apparently $a_{N,N-2}=a_{N-1,N-2}a_{N,N-1}$.)
Here are the corresponding probabilities to uniformly randomly pick an admissible subset (the table above, normalized by the total numbers of subsets):
\begin{array}{c|cc}
N\setminus n&3&4&5&6&7&8&9&10&11&12&13&14&15&16\\\hline
3&1.000\\
4&0.500&1.000\\
5&0.400&0.600&0.000\\
6&0.300&0.533&0.500&0.000\\
7&0.257&0.429&0.429&0.429&1.000\\
8&0.214&0.371&0.464&0.429&0.500&1.000\\
9&0.190&0.325&0.413&0.476&0.556&0.556&0.000\\
10&0.167&0.290&0.401&0.476&0.500&0.556&0.500&0.000\\
11&0.152&0.261&0.368&0.474&0.515&0.515&0.455&0.455&1.000\\
12&0.136&0.238&0.348&0.463&0.500&0.515&0.500&0.455&0.500&1.000\\
13&0.126&0.218&0.324&0.450&0.505&0.506&0.490&0.490&0.538&0.538&0.000\\
14&0.115&0.202&0.307&0.436&0.498&0.506&0.500&0.490&0.500&0.538&0.500&0.000\\
15&0.108&0.188&0.288&0.420&0.498&0.503&0.497&0.497&0.508&0.508&0.467&0.467&1.000\\
16&0.100&0.175&0.274&0.405&0.491&0.503&0.500&0.497&0.500&0.508&0.500&0.467&0.500&1.000\\
\end{array}
Note that from $n=7$ on, the probability is quite close to $\frac12$. Since a subset can only be admissible if the sum of its elements is even, this suggests that from $n=7$ on most subsets with even sum are admissible.
Here are the corresponding probabilities if we only pick from the subsets with even sum:
\begin{array}{c|cc}
N\setminus n&3&4&5&6&7&8&9&10&11&12&13&14&15&16\\\hline
3&1.000\\
4&1.000&1.000\\
5&0.667&1.000&\text{n/a}\\
6&0.600&0.889&1.000&\text{n/a}\\
7&0.474&0.789&1.000&1.000&1.000\\
8&0.429&0.684&0.929&1.000&1.000&1.000\\
9&0.364&0.621&0.867&1.000&1.000&1.000&\text{n/a}\\
10&0.333&0.555&0.802&1.000&1.000&1.000&1.000&\text{n/a}\\
11&0.294&0.506&0.752&0.969&1.000&1.000&1.000&1.000&1.000\\
12&0.273&0.463&0.697&0.947&1.000&1.000&1.000&1.000&1.000&1.000\\
13&0.247&0.427&0.656&0.910&0.999&1.000&1.000&1.000&1.000&1.000&\text{n/a}\\
14&0.231&0.395&0.614&0.881&0.997&1.000&1.000&1.000&1.000&1.000&1.000&\text{n/a}\\
15&0.212&0.369&0.580&0.845&0.990&1.000&1.000&1.000&1.000&1.000&1.000&1.000&1.000\\
16&0.200&0.345&0.547&0.816&0.982&1.000&1.000&1.000&1.000&1.000&1.000&1.000&1.000&1.000\\
\end{array}
Indeed, this probability is apparently $1$ when $n$ is sufficiently large.