#### Archived

This topic is now archived and is closed to further replies.

# Poisson Distribution and Instance :: Math

This topic is 5727 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi. How do you determine an instance of a Poisson Distribution? Given: A car passes through a deserted intersection on average every five minutes. average = 5 minutes Question: What is an estimate (instance) of the number of cars that passed through this intersection in a period of four week? I understand how to do the time conversion, but I do not understand how to get the Poisson instance when given the condition such as the one above. Thanks, Kuphryn

##### Share on other sites

int poisson(double lambda){
int value=0;
for(double r=instance_of_uniform_distribution(0,1);r>0;++value)
r-=poisson_probability(lambda, value);
return value;
}

##### Share on other sites
Okay. Thanks.

What function is instance_of_uniform_distribution()? Is that from C/C++ library? How about poisson_probability()?

Lastly, what does function poisson() return? If possible, please give an example with input data.

Kuphryn

##### Share on other sites
instance_of_uniform_distribution() and poisson_probability() are placeholders. You should provide those functions. Something like

  double instance_of_uniform_distribution(){	return (double)rand()/RAND_MAX;}double poisson_probability(double lambda, int value){	double v = exp(-lambda)*pow(lambda,value);	for(;value>1;--value)		v/=value;	return v;}[source]

##### Share on other sites
Nice!!!

Given: average = 5 minutes.
Time: t = 0

I assume poisson will return the time based on previous time.

t0 = 0
t1 = poisson(t0)
t2 = t1 + poisson(t1)
...

Correct? In other words, lamba is based on t-1.

Kuphryn

##### Share on other sites
Err... No.

The Poisson distribution gives you the number of cars in a given period of time. For instance, if a car passes on average every five minutes and you want to generate an instance of how many cars passed in four weeks, you should call poisson(4weeks/5minutes).

If you want to generate an instance of how long you have to wait for the next car to pass, you should use the exponential distribution.

Okay. Thanks.

Kuphryn

1. 1
2. 2
Rutin
23
3. 3
JoeJ
20
4. 4
5. 5

• 27
• 40
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631737
• Total Posts
3001944
×