Bird
0
0

You want to model a uniform distribution for daily temperatures between 10°C and 20°C. Which code correctly calculates the probability that temperature is less than 15°C?

hard📝 Application Q15 of 15
SciPy - Statistical Functions (scipy.stats) Basics
You want to model a uniform distribution for daily temperatures between 10°C and 20°C. Which code correctly calculates the probability that temperature is less than 15°C?
Arv = uniform(loc=10, scale=5) prob = rv.cdf(15)
Brv = uniform(loc=10, scale=20) prob = rv.cdf(15)
Crv = uniform(loc=0, scale=10) prob = rv.cdf(15)
Drv = uniform(loc=10, scale=10) prob = rv.cdf(15)
Step-by-Step Solution
Solution:
  1. Step 1: Set correct loc and scale for temperature range

    Range is 10 to 20, so loc=10 and scale=20-10=10.
  2. Step 2: Calculate CDF at 15

    CDF at 15 is (15 - loc)/scale = (15-10)/10 = 0.5, which is the probability temperature is less than 15.
  3. Final Answer:

    rv = uniform(loc=10, scale=10) prob = rv.cdf(15) -> Option D
  4. Quick Check:

    prob = (15-10)/10 = 0.5 [OK]
Quick Trick: CDF = (x - loc) / scale inside range [OK]
Common Mistakes:
MISTAKES
  • Using wrong scale length
  • Setting loc to zero incorrectly
  • Calculating CDF outside range without adjustment

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SciPy Quizzes