How can I get a number meet the Poisson Distribution

C

cr4kb0y

hello all:
I have to program a function which can produce a Poisson
Distribution number,I have no idea about it,
anyone who can give some suggestions? thanks!
 
K

Keith Willis

I have to program a function which can produce a Poisson
Distribution number,I have no idea about it,
anyone who can give some suggestions? thanks!

Have you looked on Wikipedia? They might be able to help with your
homework.
 
U

Udai Kiran

hello all:
I have to program a function which can produce a Poisson
Distribution number,I have no idea about it,
anyone who can give some suggestions? thanks!

use gsl GNU Scientific Library it has function that can generate a
variety of random numbers

"unsigned int gsl_ran_poisson (const gsl rng * r, double mu)"

regards,
Udai.
http://s.udaykiran.googlepages.com
 
M

Martin Ambuhl

cr4kb0y said:
hello all:
I have to program a function which can produce a Poisson
Distribution number,I have no idea about it,
anyone who can give some suggestions? thanks!
<ot>
here's a hint for a recursive form:
freq(0, lambda) = exp(-lambda)
freq(n, lambda) = freq(n-1, lambda) * lambda / n
</ot>
 
M

Mark McIntyre

hello all:
I have to program a function which can produce a Poisson
Distribution number,I have no idea about it,
anyone who can give some suggestions?

This is an algorithms question.
First understand the algorithm - a decent textbook will help with
that.
Then write some code.
Then ask again here if your code doesn't work.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top