Random Variables · Poisson Distribution

Lesson 3

Nikolai Chukhin · Alexander S. Kulikov

The code below shows plots of the probability mass function for the Poisson-distributed random variable with \(\lambda=4, 9, 15\).

import matplotlib.pyplot as plt
from math import exp, factorial

for _lambda in (4, 9, 15):
    plt.plot([exp(-_lambda) * _lambda ** k / factorial(k) for k in range(30)], 'o-')
    plt.savefig('poisson_density.png')