Let S be the sum of k randomly selected integers between 1 and n.

What is the probability of S being divisible q?

Can this be expressed in a closed form?

This is the generalization of one of the problems from this year's hungarian high school final exam - advanced mathematics.

  • $\begingroup$ Is $q$ prime perhaps? $\endgroup$ – vadim123 May 16 '13 at 17:42
  • $\begingroup$ what is $q$? Is it a prime? You should specify and maybe show where you got so far. $\endgroup$ – sigmatau May 16 '13 at 17:43
  • $\begingroup$ q is an arbitrary integer between 1 and n. With this general case I have no idea how to start, sadly. $\endgroup$ – Zoltan May 16 '13 at 17:57
  • $\begingroup$ The problem becomes easy if k is big enough for using CLT. And for $n>>q$ we can even think that $n=q$. Otherwise, if you want the precise formula, the probability should be expressed as the sum of partitions. It gonna be a terrifying formula. $\endgroup$ – gukoff May 16 '13 at 18:16
  • $\begingroup$ Are there any bounds on $k$? $\endgroup$ – leeabarnett May 16 '13 at 18:34

One can use discrete Fourier transform, starting with $z=\mathrm e^{2\mathrm i\pi/q}$ a $q$th root of unity and using the identity $$ \sum_{u=1}^qz^{un}=q\,\mathbf 1_{q\ \text{divides}\ n}. $$ Thus, $$ P[q\ \text{divides}\ S]=\frac1q\sum_{u=1}^qE[z^{uS}]. $$ Now, for every $x$, $E[x^S]=E[x^X]^k$ where $X$ is uniform on $\{1,2,\ldots,n\}$, and, for every $x\ne1$, $$ E[x^X]=\frac1n\sum_{u=1}^nx^u=\frac{x}n\frac{1-x^n}{1-x}, $$ and whether the formula for $P[q\ \text{divides}\ S]$ all this, when put together, yields, is a "closed form" or not is... well, debatable.

  • $\begingroup$ can you explain this a bit? $\endgroup$ – Zoltan May 19 '13 at 23:56
  • $\begingroup$ Sure, if only you explain which part(s) you want to see explained a bit. $\endgroup$ – Did May 20 '13 at 7:24
  • $\begingroup$ How did you make the jump to use a Fourier transformation to begin with? Is this some standard technique that I somehow missed? $\endgroup$ – Zoltan May 27 '13 at 15:15
  • $\begingroup$ It all depends what one calls standard. Well known by the experts, sure, and advertised several times by Gowers (and others), hence, as such, worth knowing. But standard as in "explained in every calculus textbook", maybe not. $\endgroup$ – Did May 27 '13 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.