Challenge - 5 Problems
Probability Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of PDF calculation for normal distribution
What is the output of this code snippet that calculates the probability density function (PDF) of a normal distribution at x=0?
SciPy
from scipy.stats import norm result = norm.pdf(0, loc=0, scale=1) print(round(result, 4))
Attempts:
2 left
💡 Hint
Recall the formula for the PDF of a standard normal distribution at zero.
✗ Incorrect
The PDF of a standard normal distribution at 0 is 1 divided by the square root of 2π, approximately 0.3989.
❓ data_output
intermediate2:00remaining
Cumulative distribution function values for uniform distribution
What is the output array of cumulative distribution function (CDF) values for a uniform distribution between 0 and 10 at points [0, 5, 10, 15]?
SciPy
from scipy.stats import uniform import numpy as np points = np.array([0, 5, 10, 15]) cdf_values = uniform.cdf(points, loc=0, scale=10) print(np.round(cdf_values, 2))
Attempts:
2 left
💡 Hint
CDF of uniform distribution increases linearly from 0 to 1 over the scale.
✗ Incorrect
The uniform CDF at 0 is 0, at 5 is 0.5, at 10 is 1, and beyond 10 remains 1.
❓ visualization
advanced3:00remaining
Plot PDF and CDF of exponential distribution
Which option produces the correct plot showing both the PDF and CDF of an exponential distribution with rate 1 over the range 0 to 5?
SciPy
import numpy as np import matplotlib.pyplot as plt from scipy.stats import expon x = np.linspace(0, 5, 100) plt.plot(x, expon.pdf(x), label='PDF') plt.plot(x, expon.cdf(x), label='CDF') plt.legend() plt.show()
Attempts:
2 left
💡 Hint
Remember the shape of exponential PDF and CDF functions.
✗ Incorrect
The exponential PDF starts at 1 and decreases exponentially; the CDF starts at 0 and increases to 1.
🧠 Conceptual
advanced2:00remaining
Understanding the relationship between PDF and CDF
Which statement correctly describes the relationship between the probability density function (PDF) and the cumulative distribution function (CDF) of a continuous random variable?
Attempts:
2 left
💡 Hint
Think about how cumulative probability accumulates from the density.
✗ Incorrect
The CDF at x is the total probability up to x, which is the integral of the PDF up to x.
🔧 Debug
expert2:00remaining
Identify the error in this code calculating normal distribution CDF
What error does this code produce when trying to calculate the CDF of a normal distribution at x=1?
SciPy
from scipy.stats import norm result = norm.cdf(1, mean=0, std=1) print(result)
Attempts:
2 left
💡 Hint
Check the parameter names for scipy.stats.norm.cdf.
✗ Incorrect
The correct parameter names are 'loc' for mean and 'scale' for standard deviation, not 'mean' or 'std'.