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

Home > Probability
Maximum sum (Posted on 2004-07-29) Difficulty: 3 of 5
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.8333 (6 votes)

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

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 inf
10      2 600000  0.00000333  300000
11      0 600000  0.00000000 inf
12      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
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (11)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information