There is a perl function "exp" - that is, the natural exponential function. A 
Gaussian bell curve is defined by a function like:

y(x) = A*exp( ((x-s)/t)^2)

The exact functional form I just typed might be incorrect, look up the exact 
function in any basic math, science, or statistics text. Look it up online.

The parameter "A" is an amplitude scaling function or variable, x is a domain 
ordinate, t is something that gets called "time constant" in the science world, 
and s is (as my rusty memory produces) a mean or central value for the 
distribution. The exponent term, that is, the squared term, produces the 
standard deviation.

Use that standard deviation to control the distribution around the mean, that 
is, the "narrow" or "broad" aspect of the bell-shaped curve.

The point is, it is easy to *implement* the function in perl. The exact usage of 
the bell curve in producing a distribution can be understood better than my 
rusty memory can produce by about 20 minutes of examination of any text or even 
likely any of a number of web sites out there.

Best of luck, you should'nt need much -

-~.-~.-~.-~.-~.-~.-~.-~.-~.-~
-~
-~  Cliff Frensley
-~  [EMAIL PROTECTED]
-~  Seattle, WA
-~
-~
-.

On Tue, 28 Jan 2003, Russ Foster wrote:

> Want to give any hints on how to accomplish this in Perl?
> 
> -----Original Message-----
> From: Cliff [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, January 28, 2003 11:04 AM
> To: Russ Foster
> Cc: '[EMAIL PROTECTED]'
> Subject: Re: Bell Curves and Random numbers
> 
> 
> Ultimately, the distribution is shaped and determined by your distribution 
> function.
> 
> In your bell curve, you need to reduce the size of the standard deviation,
> that 
> is, sigma in the exponent. You can do that fairly simply by simply making
> the 
> guassian standard deviation sigma an input parameter into your randomizing 
> function.
> 
> The smaller the standard deviation, the tighter the bell curve. Definately
> not a 
> perl specific question.
> 
> -~.-~.-~.-~.-~.-~.-~.-~.-~.-~
> -~
> -~  Cliff Frensley
> -~  [EMAIL PROTECTED]
> -~  Seattle, WA
> -~
> -~
> -.
> 
> On Tue, 28 Jan 2003, Russ Foster wrote:
> 
> > I'm looking to generate a bunch of random information to be used for
> > testing.
> > 
> > Right now, my script accepts three parameters, quantity, a central point,
> > and a deviation range and then generates [quantity] numbers ranging from
> > [central point - deviation range] to [central point + deviation range].
> > 
> > so it looks like this:
> > 
> > perl GenNumbers.pl 10 100 5
> > 95
> > 102
> > 99
> > 100
> > .
> > .
> > 101
> > 
> > Unfortunately this generates a rather flat distribution--numbers evenly
> > distributed from 95-105. Ideally, I'd like the majority of numbers to be
> > "closer" to the central point, with relatively few at the extremes.
> > 
> > Any ideas on how to go about doing this?
> > 
> > Now that I've written this up, I suppose it may be more of a math question
> > and Perl related. The only statistic related modules I can find are more
> > formulae based and don't help in generating numbers.
> > 
> > If it matters, I'm using perl v5.6.1 for Cygwin. I do have access to
> > ActiveState perl if it's necessary.
> > 
> > Thanks.
> > 
> > -r
> > 
> > Russell J Foster
> > Senior Systems Engineer
> > Subject, Wills, and Company
> > _______________________________________________
> > Perl-Win32-Admin mailing list
> > [EMAIL PROTECTED]
> > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> > 
> 
> _______________________________________________
> Perl-Win32-Admin mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to