Challenge - 5 Problems
Poisson Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of Poisson PMF Calculation
What is the output of this code that calculates the Poisson probability mass function (PMF) for k=3 events with an average rate (lambda) of 2?
SciPy
from scipy.stats import poisson result = poisson.pmf(3, 2) print(round(result, 4))
Attempts:
2 left
💡 Hint
Recall the Poisson PMF formula: P(k; λ) = (λ^k * e^-λ) / k!
✗ Incorrect
The Poisson PMF for k=3 and λ=2 is (2^3 * e^-2) / 3! = 8 * e^-2 / 6 ≈ 0.1804.
❓ data_output
intermediate2:00remaining
Number of Events with High Probability
Using a Poisson distribution with λ=4, how many events (k) have a probability mass function (PMF) value greater than 0.1? Use k values from 0 to 10.
SciPy
from scipy.stats import poisson pmf_values = [poisson.pmf(k, 4) for k in range(11)] count = sum(p > 0.1 for p in pmf_values) print(count)
Attempts:
2 left
💡 Hint
Calculate PMF for k=0 to 10 and count how many exceed 0.1.
✗ Incorrect
PMF values for k=2 to 6 exceed 0.1, so the count is 5.
❓ visualization
advanced3:00remaining
Plotting Poisson PMF for Different Lambda Values
Which option produces a plot showing Poisson PMF curves for λ=2, 4, and 6 over k=0 to 10?
SciPy
import matplotlib.pyplot as plt from scipy.stats import poisson import numpy as np k = np.arange(0, 11) lambdas = [2, 4, 6] for lam in lambdas: plt.plot(k, poisson.pmf(k, lam), marker='o', label=f'λ={lam}') plt.xlabel('Number of events (k)') plt.ylabel('PMF') plt.title('Poisson PMF for different λ') plt.legend() plt.grid(True) plt.show()
Attempts:
2 left
💡 Hint
Check if all λ values are plotted and curves shift right with increasing λ.
✗ Incorrect
The correct plot shows three distinct PMF curves for λ=2, 4, and 6, each peaking near their λ value.
🧠 Conceptual
advanced1:30remaining
Understanding Poisson Distribution Assumptions
Which statement correctly describes a key assumption of the Poisson distribution?
Attempts:
2 left
💡 Hint
Think about how events happen in a Poisson process.
✗ Incorrect
Poisson assumes events happen independently and at a constant average rate.
🔧 Debug
expert1:30remaining
Identify the Error in Poisson PMF Calculation Code
What error does this code produce when calculating Poisson PMF for k=3 and λ='2' (string instead of number)?
SciPy
from scipy.stats import poisson result = poisson.pmf(3, '2') print(result)
Attempts:
2 left
💡 Hint
Check the data type of lambda parameter and how pow() behaves with strings.
✗ Incorrect
Passing a string instead of a number causes a TypeError during power calculation inside PMF.