Expected sum of picked numbers from set

70 Views Asked by At

Let suppose that I have a finite set $X$ of natural numbers. I keep drawing, with reintroduction and uniform probability, from this set until the sum of the extracted numbers, $S$, is bigger or equal than the constant value $\bar S$. What is the expected value $E[S]$ of this sum?

I would solve it in this following way.

Let $e_n$ be the expected value of the sum if the starting value is $n$, therefore $E[S]=e_0$. It should hold this recurrence relation

$e_n=\frac{1}{|X|}\sum_{i\in X}e_{n+i}$

where $|X|$ is the cardinality of my set. Is it true? I am not able to justify rigorously why this relation holds. Obviously if this hold, the solution can be implemented numerically in a very trivial way.

Are there a better way to solve this problem?