Bird
0
0

What is the output of this code?

medium📝 Predict Output Q13 of 15
SciPy - Statistical Functions (scipy.stats) Basics
What is the output of this code?
from scipy.stats import poisson
rv = poisson(mu=3)
prob = rv.pmf(2)
print(round(prob, 3))
A0.2240
B0.224
C0.149
D0.050
Step-by-Step Solution
Solution:
  1. Step 1: Understand the pmf function with mu=3 and k=2

    The pmf gives the probability of exactly k=2 events when the average rate mu=3.
  2. Step 2: Calculate the Poisson pmf for k=2, mu=3

    Using formula: P(k=2) = (3^2 * e^-3) / 2! ≈ 0.224
  3. Final Answer:

    0.224 -> Option B
  4. Quick Check:

    Poisson pmf(2,3) ≈ 0.224 [OK]
Quick Trick: Use pmf(k) with mu to get exact event probability [OK]
Common Mistakes:
MISTAKES
  • Confusing pmf with cdf
  • Rounding incorrectly
  • Using wrong mu or k values

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SciPy Quizzes