Lesson 17 of 18
Poisson Distribution
The Poisson Distribution
The Poisson distribution models the number of events occurring in a fixed interval of time or space, when events happen independently at a constant average rate .
PMF
The probability of observing exactly events:
- Mean:
- Variance:
Real-World Examples
| Scenario | |
|---|---|
| Calls to a call centre per hour | e.g. 10 |
| Mutations per DNA strand | e.g. 0.001 |
| Accidents on a road per month | e.g. 2 |
| Emails received per minute | e.g. 3 |
Examples
For :
For :
Implementation
import math
def poisson_pmf(lam, k):
return round(math.exp(-lam) * lam**k / math.factorial(k), 4)
Relationship to Binomial
When is large and is small with , the binomial distribution approaches Poisson. This is why Poisson appears in rare-event scenarios.
Your Task
Implement poisson_pmf(lam, k) that returns for a Poisson distribution with rate , rounded to 4 decimal places.
Pyodide loading...
Loading...
Click "Run" to execute your code.