3

I saw this question which inspired my question.

Choose $n$ uniformly random numbers between $0$ and $1$ and record the value of the smallest number. Do this again and add the second number to the first number. Keep doing this until the sum of the numbers exceeds $1$. How many numbers are expected to be needed?

I have not studied probability so I don't really know how to proceed with this. I looked at the answers to this question where the answer for $n=1$ is shown to be $e$ but I couldn't get a good enough grasp of the concepts to try them out in my problem. I also looked here but didn't understand it well enough either.

Dylan Levine
  • 2,122
  • If $X$ is the smallest element of $n$ choices, then $P(X\geq x)=(1-x)^n$ and thus $P(X<x)=1-(1-x)^n.$ So that gives your distribution for $X.$ – Thomas Andrews Apr 03 '24 at 21:31
  • 1
    Writing the expected number $E_n$ as a function of $n$, it turns out that $E_n$ is almost linear in $n$ with slope $1$, and indeed, we can prove that $E_n\sim n$ as $n\to\infty$. – Sangchul Lee Apr 09 '24 at 00:36

3 Answers3

5

I don't think you can find a closed form solution for any $n$, but for small $n$ the closed form solution can be found:

Like that answer you referenced, we first need the probability that the sum of the $k$ first numbers is less than $y$ $$ P_k(y) = \int_0^\infty d^k x\, n(1-x_1)^{n-1}\ldots n(1-x_k)^{n-1}\theta(y-x_1-\ldots-x_k), $$ where $\theta$ is the Heaviside step function. Really, we only want $y=1$, but with the $y$ the integral can be simplified using a Laplace transform with respect to $y$ $$ \begin{align*} \hat P_k(s) &= \int^\infty_0 dy \,e^{-ys}\int_0^\infty d^k x\, n(1-x_1)^{n-1}\ldots n(1-x_k)^{n-1}\theta(y-x_1-\ldots-x_k)\\ &=s^{-1}\left(\int_0^\infty dx\, n(1-x)^{n-1}e^{-sx}\right)^k = \frac{f_n(s)^k}{s}, \end{align*}. $$ where we defined $f_(s)=\int_0^\infty dx\, n(1-x)^{n-1}e^{-sx}$. The actual probability can be recovered as $P_k=\mathcal L^{-1}\{\frac{f_n(s)^k}{s}\}(1)$ Now the expected number of rounds is given by the sum $$ \mathbb E_n(N)=\sum_{k=0}^\infty P_k(y)=\sum_{k=0}^\infty \mathcal L^{-1}\{\frac{f_n(s)^k}{s}\}(1)=\mathcal L^{-1}\{\frac{1}{s(1-f_n(s))}\}(1). $$

The inverse Laplace transform is evaluated using the roots of a $n$th order polynomial and so it quickly becomes nasty, but it can be done for small $n$.

For $n=1$: $$ \begin{gather*} f_1(s)=\frac 1 s,\qquad \frac{1}{s(1-f_1(s))}=\frac{1}{s-1},\\ \mathbb E_1(N)=\mathcal L^{-1}\{\frac{1}{s-1}\}(1)=e. \end{gather*} $$ For $n=2$: $$ \begin{gather*} f_2(s)=\frac 2 s-\frac 2 {s^2},\qquad \frac{1}{s(1-f_2(s))}=\frac{s}{2+s(s-2)},\\ \mathbb E_2(N)=\mathcal L^{-1}\{\frac{s}{2+s(s-2)}\}(1)=e(\sin 1+\cos 1)\approx 3.75605. \end{gather*} $$

Ben
  • 1,024
1

This is a partial answer:

The CDF of an uniform random variable on $(0,1)$ is given by $$ \begin{cases} 0 \text{ if } x<0\\ x \text{ if } 0 \le x\le 1\\ 1 \text{ otherwise}\end{cases} $$ So the CDF of the minimum of $n$ random variables is given by

$$ G(x)=\begin{cases} 0 \text{ if } x<0\\ 1-(1-x)^n \text{ if } 0 \le x\le 1\\ 1 \text{ otherwise}\end{cases} $$

The pdf of the minimum is given by $$ g(x)= \begin{cases} n(1-x)^{n-1} \text{ if } 0\le x \le 1\\ 0 \text{ otherwise} \end{cases} $$

The characteristic function is given by

$$ \phi(t)= n \int_0^1 e^{itx} (1-x)^{n-1} dx= n! \dfrac{e^{it}}{(it)^n} \left(1- e^{-it} \sum_{k=0}^{n-1} \frac{(it)^k}{k!}\right) $$

Let call $S_\ell=\sum_{i=1}^\ell X_i$, where $X_i$ is the r.v. with CDF $G(x)$. As the random variables are iid, it is possible to obtain the density function of this R.V. as

$$ s_\ell(x)= \mathcal{F}^{-1} (\phi(t)^\ell) $$

(I didn't check, but i think it can be possible to solve this integral with countour integration as the $\phi(t)^l$ as a pole of order $ln$ at the origin)

Another possible approach : By the properties of the Fourier transform you obtain that $$ s_\ell(x)= g *_\ell g(x) $$ where $*_\ell$ is the convolution with itself $\ell$ times.

As in this article, the probability that the sum of $\ell$ uniformly random variable to be grater than one is given by

$$ P^{(1)}_\ell= \int_1^\ell s_{\ell}(x)- \int_1^{\ell-1} s_{\ell-1}(x) $$

and the average will be given by $$ E^1= \sum_{\ell=1}^\infty \ell P^{(1)}_\ell $$

Marco
  • 2,875
  • 1
  • 6
  • 22
1

Not a full answer...

Let $R(x)$ be the expected number of tries to get an accumulated value that exceeds $x$.

Then we can write the integral equation

$$R(x) = 1 + \int_0^x R(x-u) \,g(u)\, du = 1 + \int_0^x R(s) \,g(x-s) \,ds \tag 1$$

where $g(u) = n (1-u)^{n-1} [0\le u \le 1]$ is the density of the minimum of $n$ uniform rv.

We also have the boundary condition $R(0^+)=1$. And we are interested in $R(1)$.

I'm not sure if $(1)$ (a Volterra convolution) can be solved analytically ( perhaps trying a series expansion $R(x)=1+a_1 x + a_2 x^2 + \cdots $ ?).

leonbloy
  • 66,202