All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Maximum sum (Posted on 2004-07-29)
What's the probability that n random numbers from [0,1] will sum less than 1?

(For purists: "uniformly distributed, independent" random numbers are assumed.)

 See The Solution Submitted by Federico Kereki Rating: 3.6000 (5 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 simulation results | Comment 1 of 9

Simulation seems to indicate the answer is 1/n!.  I don't have a proof of why this is the case.  Here are the results:

` n  sum<1 # trials  fraction  reciprocal  3  99943 600000  0.16657166  6.003422 4  24846 600000  0.04141000  24.14876 5   4969 600000  0.00828167  120.7486 6    858 600000  0.00143000  699.3007 7    121 600000  0.00020167  4958.678 8     18 600000  0.00003000  33333.33 9      0 600000  0.00000000 inf10      2 600000  0.00000333  30000011      0 600000  0.00000000 inf12      0 600000  0.00000000 inf`

With the exception of the larger values of n where the scarcity of successes results in erratic results, the reciprocal of the fraction of trials that are successes is close to the factorial of n.

RANDOMIZE TIMER
CLS
FOR n = 3 TO 12
ctr = 0
FOR tr = 1 TO 600000
t = 0
FOR i = 1 TO n
t = t + RND(1)
NEXT i
IF t < 1 THEN ctr = ctr + 1
NEXT tr
PRINT USING "## ###### ###### ##.######## "; n; ctr; tr - 1; ctr / (tr - 1); ' as loop leaves tr advanced by 1
IF ctr > 0 THEN
PRINT (tr - 1) / ctr
ELSE
PRINT "inf"
END IF
NEXT n

 Posted by Charlie on 2004-07-29 08:52:40

 Search: Search body:
Forums (0)