View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
joeu2004 joeu2004 is offline
external usenet poster
 
Posts: 2,059
Default RANDOM # around a MEAN with STANDARD DEVIATION

On Sep 12, 3:39 am, Bernd P wrote:
On average this might be true, but doesn't the OP need 36
numbers with a mean of 6 and a STDEV of 10 exactly?


I bristle at the word "exactly" in this context. But otherwise ....

Good point! I think it's a matter of interpretation. Mine et al: 36
random numbers from the distribution with a mean 6 and sd of 10; or
yours: 36 random numbers that have a mean of 6 and sd of 10.

For the latter, perhaps the following meets the requirement:

A1: =norminv(rand(), m, s)
A2: =2*m - A1

where "m" is 6 and "s" is 10, or references to cells with those
values.

Copy A1:A2 down through A36. That will produce a mean of 6. But it
does not necessarily produce an sd of 10. One fix: replace A35 with
the following array formula (commit with ctrl-shift-Enter):

=sqrt((s^2 - sum((A1:A34-m)^2/n))*n/2) + m

where "n" is 36 or a reference to a cell with that value.

That will generate 36 numbers with a mean of 6 and sd (STDEVP) of 10
"exactly", within the accuracy of binary computers.

But, someone argue, that is only 16 random numbers, not 36.

I do not believe we can generate exactly 36 random numbers and ensure
that they meet the criteria as you interpret them, namely: the 36
numbers have the required mean and sd.

Arguably, we could generate 34 random numbers and only 2 dependent
numbers that meet that criteria. But I think that runs the risk that
one or both of the 2 dependent numbers are extreme outliers. (And
that __still__ is not "36 random number" exactly.)

Alternatively, using my methodology, we could generate 74 numbers, 36
of which are random. But we must include all 74 numbers in the
solution in order to ensure that the criteria are met. That does not
sound like the solution the OP is looking for.