1

Given a uniform probability distribution over $[0, 1]$, a number is randomly selected from this distribution. We have to find the expected number of trials such that the sum of the picked numbers $ >= $ 1.

I have been told that the answer to this question is $ e $ but I'm not sure how to solve this.

  • 1
    The probability for the sum of the numbers to be exactly $1$ is $0$. Perhaps you mean the expected number of trials for the sum to be at least $1$? – joriki Jul 25 '15 at 08:24
  • @joriki That is how I understood the question. "...such that the sum of the picked numbers is 1" –  Jul 25 '15 at 08:27
  • 1
    @zagadka313: I don't understand that comment. Why did you italicize "sum"? My question wasn't about the sum; I'm aware that we're talking about the sum. The problem lies in "is $1$" (which you quoted unchanged), which makes no sense and might be intended to mean "is at least $1$". – joriki Jul 25 '15 at 08:28
  • @jorki No - it's exactly 1. And how is it zero? If I picked 0.5 and 0.5 on two trials, the sum is 1. – Prasoon Shukla Jul 25 '15 at 08:28
  • 1
    @PrasoonShukla: Yes, and the probability for that is $0$. – joriki Jul 25 '15 at 08:29
  • Besides, I ran a small simulation in Python where I kept the numbers in the range 0.99 to 1.01 and the expected value (by doing a large number of experiments) is coming out to be around 2.3 so it would appear that the question is right and the answer of e is probably right as well. – Prasoon Shukla Jul 25 '15 at 08:30
  • @joriki, oh, so I misunderstood your comment! Sorry about that! –  Jul 25 '15 at 08:31
  • I am curious about this too. I only know basic probability. But I'm thinking that the reason Python would come out to that is because it doesn't have a truly continuous range to choose from, the precision is just limited on a computer. But this is just my intuition… –  Jul 25 '15 at 08:32
  • A friend suggested that probably the question should be that sum exceeds 1 (and not equal to 1) and the simulation gives me a result of 2.718 so it seems that is the actual question. I am updating the details in the question. – Prasoon Shukla Jul 25 '15 at 08:41

2 Answers2

3

Let $E(x)$ be the expected number of trials for reaching a sum of $\ge1$ starting from a sum of $x$. Then

$$ E(x)=1+\int_x^1E(t)\mathrm dt\;. $$

Differentiating with respect to $x$ yields

$$ E'(x)=-E(x)\;, $$

with the solutions $E(x)=c\mathrm e^{-x}$, and the condition $E(1)=1$ yields $c=\mathrm e$, so the solution is $E(x)=\mathrm e\cdot\mathrm e^{-x}=\mathrm e^{1-x}$, and the value $E(0)=\mathrm e$ is the desired probability.

joriki
  • 238,052
  • I don't quite understand how you arrive at that integral equation. Please explain it a bit. – Prasoon Shukla Jul 26 '15 at 06:22
  • 1
    @PrasoonShukla: If you start with a sum of $x\lt1$, you need at least $1$ number to get past $1$ -- that's what the $1$ represents. That number gets you up to some place in the interval $[x,1+x]$ (which contains $1$). If you end up with more than $1$, you're done. If you end up with $t\lt1$, you have to continue, and the expected number of trials in that continuation is by definition $E(t)$ -- so you have to integrate $E(t)$ (with the uniform density $1$ of your uniform distribution) from $x$ up to $1$, the entire region where you have to continue if you land there. – joriki Jul 26 '15 at 06:28
  • 1
    Ah okay. Thanks! – Prasoon Shukla Jul 30 '15 at 16:42
2

The expected number of trials is the sum over $k=0,1,\ldots$ of the probabilities that the experiment isn't over after $k$ numbers have been drawn. The probability for $k$ numbers to sum to less than $1$ is the volume of the $1/k!$-th part of the $k$-dimensional unit cube, i.e. $1/k!$, so the expected number of trials is $\sum_{k=0}^\infty1/k!=\mathrm e$.

joriki
  • 238,052