[Math] What’s the probability that a sum of dice is prime

dicenumber theoryprime numbersprobabilityrecreational-mathematics

Prompted by today's Minute Math question on the MAA site (http://amc.maa.org/mathclub/5-0,problems/T-problems/T-web,ia/2005web/tb05-12-ia.shtml), I started thinking about the probability that the sum of the numbers rolled on a set of $n$ dice is prime, particularly the asymptotics as $n\rightarrow\infty$. Heuristics strongly suggest that this is proportional to $1/\mathrm{ln}\ n$, and in fact, that it's $1/\mathrm{ln}\ n – O(1/\mathrm{ln}^2n)$, but I'm wondering how I would go about getting better asymptotics on the second term.

For the record, the heuristic argument goes something like this: assume for concreteness' sake that we're rolling 6-sided dice. Then the sum of the dice is closely approximated by a normal variable with mean $\mu=7n/2$ and variance $\sigma^2=35n/12$, and since the PNT says that the 'probability' of an integer $n$ being prime is roughly $1/\mathrm{ln}\ n$, we should be able to integrate that probability with respect to the normal distribution:
$$p = {1\over \sqrt{2\pi\sigma^2}}\int_n^{6n} e^{-\left({(t-\mu)^2\over 2\sigma^2}\right)} {1\over\mathrm{ln}\ t} dt$$
And since $1/\mathrm{ln}\ t$ is monotonic, the value of the integral is bounded by the values we get by replacing its term in the integral with its maximum and minimum values on the integration interval:
$${1\over\mathrm{ln}\ 6n} {1\over \sqrt{2\pi\sigma^2}}\int_n^{6n} e^{-\left({(t-\mu)^2\over 2\sigma^2}\right)} dt < p < {1\over\mathrm{ln}\ n} {1\over \sqrt{2\pi\sigma^2}}\int_n^{6n} e^{-\left({(t-\mu)^2\over 2\sigma^2}\right)} dt$$
Both of the integrals in the latter formula are essentially 1 (by definition), so we get ${1\over\mathrm{ln}\ 6n} < p < {1\over\mathrm{ln}\ n}$; replacing $\mathrm{ln}\ 6n$ by $(\mathrm{ln}\ 6 + \mathrm{ln}\ n)$ and using the binomial formula gives the heuristic approximation I alluded to above. This leads me to a couple of questions:

  1. How safe is the heuristic argument above? I know that the PNT gives good bounds on the number of primes in an interval (on the order of $n^{1/2}$ here, which in particular means that the error from the prime-counting would be $O(n^{-1/2})$ and so much smaller than the inverse-log terms above), but my analytic number theory isn't good enough to know whether 'weighting' by the normal distribution would throw off the classical proofs.
  2. How would I go about evaluating the integral above? Obviously the bounds I use bring it in to a fairly small range, but it seems as though to get a second term in my asymptotics I'd need to be able to at least approximate the integral, and there aren't any obvious tricks that look like they'd handle it well…

Best Answer

For (1.), Rosser and Schoenfeld (sp?) non-asymptotic estimates bound $\pi(n)$ between functions of the form $x/(\log x + C)$ and this should be enough.

For (2) your integrals are rapid decaying and incredibly close to the integrals on the whole real line. O($n$) standard deviations from the average is quite an unlikely event.

Related Question