What is the probability that the sum of a subset of the remainders a number m excluding 0 of gives you a multiple of m?

53 Views Asked by At

I was wondering: given an integer $m$, we get its set of remainders $\{0, 1, 2, \dots, m-2, m-1 \}$. Now, if we exclude $0$, we get the integers from $1$ to $m-1$, which is the subset I'm interested in. If we select a subset of these integers, what is the probability the the sum of the members of that subset gives you a multiple of $m$?

Many thanks in advance!

1

There are 1 best solutions below

0
On BEST ANSWER

Computing the first few values and searching OEIS yields OEIS sequence A000016 (the lowest OEIS index I’ve ever encountered, I believe). The entry provides the formula

$$ a_m=\frac1{2m}\sum_{d\mid m\atop 2\not\mid d}\phi(d)2^{m/d}\;. $$

As pointed out by ACheca, a proof is given in An interesting result about subset sums by Nitu Kitchloo and Lior Pachter. (The result there is twice ours, since $m$ is included, so each of our admissible subsets yields two, one with $m$ and one without.) The corresponding probability is

$$ p_m=2^{-(m-1)}a_m=\frac{2^{-m}}m\sum_{d\mid m\atop 2\not\mid d}\phi(d)2^{m/d}\;. $$

I doubt that this can be further simplified. For $m$ an odd prime, this is

$$ p_m=\frac1m+\left(1-\frac1m\right)2^{-(m-1)}\;, $$

which is close to $\frac1m$ as expected.