Bird
0
0

Which code correctly creates this distribution and calculates the probability of temperature being exactly 20°C?

hard📝 Application Q8 of 15
SciPy - Statistical Functions (scipy.stats) Basics
You want to model a uniform distribution for daily temperatures ranging from 15°C to 25°C. Which code correctly creates this distribution and calculates the probability of temperature being exactly 20°C?
Arv = uniform(loc=15, scale=10) prob = rv.pdf(20)
Brv = uniform(loc=15, scale=25) prob = rv.pdf(20)
Crv = uniform(loc=0, scale=10) prob = rv.pdf(20)
Drv = uniform(loc=15, scale=10) prob = rv.cdf(20)
Step-by-Step Solution
Solution:
  1. Step 1: Set loc and scale for 15 to 25 range

    loc=15, scale=25-15=10.
  2. Step 2: Calculate probability density at 20°C

    Use PDF method to get probability density at 20.
  3. Final Answer:

    rv = uniform(loc=15, scale=10) prob = rv.pdf(20) -> Option A
  4. Quick Check:

    PDF at 20 in range 15-25 [OK]
Quick Trick: Use PDF for exact value probability in uniform [OK]
Common Mistakes:
MISTAKES
  • Using CDF instead of PDF for exact value
  • Setting wrong scale value
  • Starting loc at 0 incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SciPy Quizzes