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.
Printable View
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.Quote:
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.
Doesn't generate from poisson.Quote:
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;
}
eh? What is possion dist'n?Quote:
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.