I'm looking for a random number generator that can gives me random numbers in Possion dist'n. Can any one give a recomdation?
thanks.
I'm looking for a random number generator that can gives me random numbers in Possion dist'n. Can any one give a recomdation?
thanks.
Code:#include <time.h> #include <stdio.h> #define MAX 100 int main() { int x; srand((unsigned)time()); x=rand()%MAX; printf("The random number is %d",x); return 0; }
Have a look at the book Seminumerical Algorithms by Knuth.Originally posted by w/ possion?
I'm looking for a random number generator that can gives me random numbers in Possion dist'n. Can any one give a recomdation?
thanks.
If you want to generate poisson with mean m_u note :
If U(1)....U(n)... are i.i.d uniform on [0,1]
and m is the smallest integer such that
U(1)*........U(m)<= exp(-m_u)
then m-1 is poisson.
Last edited by pinko_liberal; 02-28-2003 at 03:09 AM.
The one who says it cannot be done should never interrupt the one who is doing it.
Doesn't generate from poisson.Originally posted by _Cl0wn_
Code:#include <time.h> #include <stdio.h> #define MAX 100 int main() { int x; srand((unsigned)time()); x=rand()%MAX; printf("The random number is %d",x); return 0; }
The one who says it cannot be done should never interrupt the one who is doing it.
eh? What is possion dist'n?I'm looking for a random number generator that can gives me random numbers in Possion dist'n. Can any one give a recomdation?
thanks.