Expected of number of discrete uniform variables whose sum is bigger than k (from characteristic function of discrete Irwin–Hall distribution?)

274 Views Asked by At

The problem

Imagine we keep uniformly drawing $n$ integers $X_i$ from {0, 1, ..., 9} so that their sum is more than $10$. For instance, one draw would be {1, 0, 2, 5, 3}, hence $n=5$, and repeat this procedure over and over. What would the expected value of $n$ be (analytically calculated)? By simulation (over 10 million trials), it is 3.063577.

Apparently, if that were uniformly drawn from $[0,10]$, this expected value would be equal to the Euler number $e$.

[I very recently asked it on Mathematics StackExchange and am waiting for answers (and will post them here), but I thought maybe it may be more suitable for CV. Sorry if that makes it off-topic.]

What I have been trying to do

Consulting the paper Polynomial coefficients and distribution of the sum of discrete uniform variables by Caiado & Rathie (2007), I suspect (given $Y = \sum_{i=1}^{n}X_i$) the characteristic function of the distribution of $Y$ is something of the following form (Equation 2.3 in the paper)

$$ \Phi_Y(t) = \left( \sum_{p=0}^{k} \frac{e^{i.t.p}}{k+1} \right)^n , \forall t \in \mathbb{R}, i=\sqrt{-1} $$

If I understand it correctly, $k$ should be equal to 9 (right?)

If I have been correct, I tried calculating the inverse Fourier transform of $\Phi_Y(t)$ for $k=9$ and calculate its expected value but it is getting too complicated—and I suspect I'm very wrong here.

I went through multiple "similar" questions on SE (e.g., +, +, +, +, +, and +) but I'm too confused to infere something useful from them.

Is there an answer to my question?

Many thanks in advance!


Some R code for numerical estimation

This is the R code I used to calculate it numerically (edited since the first submission):

N <- 1e+7
s.list <- n.list <- rep(NA, N)

for(i in 1:N){
  s <- 0
  n <- 0
  seed <- i
  while(s < 11){
    s <- s + (sample(10, 1, replace = TRUE) - 1)
    n <- n + 1
  }
  if(!(i %% 10000)) print(paste("At iteration", round(i/1000,1), "K, s is", s, "and n is", n))
  s.list[i] <- s
  n.list[i] <- n
}

answer <- mean(n.list)
1

There are 1 best solutions below

0
On

The problem, as @whuber has elaborated on in his answer on the same question I asked on CrossValidated, can be solved through the probability generating function of $X_i$ and calculating the expected value of the sum by means of its survival function.

The answer is thus $$\frac{10}{9}\left(\left(\frac{9}{10}\right)^{-10} - \frac{1}{9}\right) = \frac{96125795110}{31381059609} \approx 3.063178755201$$