>Does that work if i were also asked to generate it given mean. What i
>am trying to do is to generate jobs in an exponentially distributed
>fashion given the mean.
>like "The inter-arrival time of jobs is exponentially distributed with
>mean of ...".
>> >I was trying to find out the function in 'C' that would return me the
>> >exponential distribution value, given lambda as the argument. Can you
>> >please help me get to know the same.
>> Let uniform() be your favorite random number generator that returns
>> a random float/double in the range 0.0 < uniform() < 1.0.
>> Then I think -lambda*log(uniform()) will be exponentially distributed.
>> At least that is what some old code of my does.
bellenot 3289> maple
|\^/| Maple 6 (SUN SPARC SOLARIS)
._|\| |/|_. Copyright (c) 2000 by Waterloo Maple Inc.
\ MAPLE / All rights reserved. Maple is a registered trademark of
<____ ____> Waterloo Maple Inc.
| Type ? for help.
Quote:> # So the density is exp(-x/lambda)/lambda -- compute the mean
bytes used=1000248, alloc=851812, time=0.16
Quote:> # Solve for -lambda*log(uniform())
-ln(-P + 1) lambda~
So lambda is the mean in this case.
bellenot <At/> math.fsu.edu