Live data from Hacker News

How many draws of a random number [0,1] are needed to sum to 1

bayesianthink.blogspot.com

41–42 of 42 posts

Re: How many draws of a random number [0,1] are needed to sum to 1

#41

Here's a more elementary solution. Let's say we draw n times. What's the probability that we get a number at least 1? Well, we want to exclude the cases where we get a number less than 1, so we want the volume of the unit cube (n-tuples of numbers from 0 to 1) minus the volume of the region below the standard simplex (standard simplex is stuff that sums to 1, we're excluding stuff that sums to less than 1.) Now the v…

That's right, this is the simplest way to show it.

Nope, there's an even simpler way.

Say f(x) is the expected value of the number of draws to get to value x. Then f(x) = 1 + integral_0^x f(x)

Hence f'(x) = f(x), so f(x) = c exp(x) The constant is of course 1, and f(1) = exp(1).

Re: How many draws of a random number [0,1] are needed to sum to 1

#42
post #41

Earlier quoted context omitted.

That's right, this is the simplest way to show it.

Nope, there's an even simpler way. Say f(x) is the expected value of the number of draws to get to value x. Then f(x) = 1 + integral_0^x f(x) Hence f'(x) = f(x), so f(x) = c exp(x) The constant is of course 1, and f(1) = exp(1).

Why is f(x) = 1 + integral_0^x f(x)?
Post reply on HN