472,992 Members | 3,704 Online

# How can I get a number meet the Poisson Distribution

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!

Nov 13 '07 #1
4 2686
On Tue, 13 Nov 2007 04:00:34 -0800, cr4kb0y <zy******@126.comwrote:
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.
--
PGP key ID 0xEB7180EC
Nov 13 '07 #2
On Nov 13, 5:00 pm, cr4kb0y <zyfri...@126.comwrote:
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.
Nov 13 '07 #3
cr4kb0y wrote:
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>

Nov 13 '07 #4
On Tue, 13 Nov 2007 04:00:34 -0800, in comp.lang.c , cr4kb0y
<zy******@126.comwrote:
>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.

--
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
Nov 13 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.