View Single Post
  #24   Report Post  
Posted to microsoft.public.excel.worksheet.functions
joeu2004 joeu2004 is offline
external usenet poster
 
Posts: 2,059
Default Adding Random Numbers

Both good points. I agree with you entirely.


On Jun 16, 3:36 pm, Harlan Grove wrote:
For smallish values of N, the normal distribution is a rough
approximation of the actual distribution of the sum.


Yes. I thought my sampling of 1000 was sufficiently demonstrative for
practical purposes. But you are correct to point out the risks.


=norminv(rand(), 23/2, sqrt(23/12))

[....]
Also, the normal distribution with mean 23/2 and standard deviation
23/2 has a finite probability of NEGATIVE values and values GREATER
THAN 23. If RAND() returns a number less than 0.00034, your formula
will return a negative number, and if RAND() returns a number greater
than 0.99966, your formula will return a number greater than 23.


Yes. For practical purposes, I should have written:

=max(0, min(23, norminv(rand(), 23/2, sqrt(23/12)) ))

That should cover the nearly "0.07%" probability that NORMINV() will
return values outside the expected limits, although arguably it alters
the normal distribution somewhat ;-).

Note: I am saying "0.07%" based on your assertions above -- that is,
the limits 0,00034 and 0.99966. In my experiments with Excel 2003,
the NORMINV() does not return negative until RAND() is something less
than 1E-16 , and NORMINV() did not exceed 23 even for 1 - 1E-16.

Thanks for posting those errata to my comments.


----- original posting -----

On Jun 16, 3:36*pm, Harlan Grove wrote:
joeu2004 wrote...

...=norminv(rand(), 23/2, sqrt(23/12))
...
According to the CLT, the sum is a normal distribution regardless of
the distribution of the individual random variables being summed. *The
distribution of the sum has a mean of N*m and a std dev of sqrt(N)*s,
where N is the number of random variables summed, and "m" and "s" are
the mean and std dev of each of the N random variables.


...

Not quite. The sum of iid random variables is ASYMPTOTICALLY normal.
Meaning, the distribution of the sum of N iid random variables becomes
normal as N approaches infinity. For smallish values of N, the normal
distribution is a rough approximation of the actual distribution of
the sum.

Also, the normal distribution with mean 23/2 and standard deviation
23/2 has a finite probability of NEGATIVE values and values GREATER
THAN 23. If RAND() returns a number less than 0.00034, your formula
will return a negative number, and if RAND() returns a number greater
than 0.99966, your formula will return a number greater than 23. Up to
the OP to decide whether this is OK or not.