Challenge - 5 Problems
Statistics Hypothesis Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Understanding Hypothesis Testing Purpose
Why do we use statistics to validate hypotheses in data science?
Attempts:
2 left
💡 Hint
Think about what statistics tells us about data and hypotheses.
✗ Incorrect
Statistics helps us understand how likely our observed data would be if the hypothesis were not true. It does not prove absolute truth but measures evidence strength.
❓ Predict Output
intermediate2:00remaining
Output of p-value calculation
What is the output of this Python code that calculates a p-value for a sample mean?
Data Analysis Python
import scipy.stats as stats sample_mean = 105 population_mean = 100 std_dev = 15 sample_size = 30 z_score = (sample_mean - population_mean) / (std_dev / (sample_size ** 0.5)) p_value = 2 * (1 - stats.norm.cdf(abs(z_score))) print(round(p_value, 4))
Attempts:
2 left
💡 Hint
Calculate z-score first, then find two-tailed p-value.
✗ Incorrect
The z-score is about 1.8257, so the two-tailed p-value is approximately 0.0455, indicating significance at 5% level.
❓ data_output
advanced2:00remaining
Result of Hypothesis Test on Sample Data
Given this sample data and a population mean of 50, what is the p-value from a one-sample t-test?
Data Analysis Python
import scipy.stats as stats sample = [52, 48, 51, 49, 53, 47, 50, 54, 46, 55] population_mean = 50 t_stat, p_value = stats.ttest_1samp(sample, population_mean) print(round(p_value, 4))
Attempts:
2 left
💡 Hint
Use the t-test formula for one sample against population mean.
✗ Incorrect
The t-test compares sample mean to population mean; the p-value of 0.0543 suggests borderline significance.
🔧 Debug
advanced2:00remaining
Identify the error in hypothesis test code
What error will this code raise when running a t-test?
Data Analysis Python
import scipy.stats as stats sample = [5, 7, 8, 6, 9] pop_mean = 7 result = stats.ttest_1samp(sample, pop_mean) print(result.pvalue)
Attempts:
2 left
💡 Hint
Check what ttest_1samp returns and how to access p-value.
✗ Incorrect
stats.ttest_1samp returns a tuple (statistic, pvalue), so accessing result.pvalue causes AttributeError.
🚀 Application
expert3:00remaining
Choosing correct hypothesis test for data
You have two independent groups with small sample sizes and unknown population variances. Which test should you use to validate if their means differ?
Attempts:
2 left
💡 Hint
Consider variance equality and sample independence.
✗ Incorrect
Welch's t-test does not assume equal variances and is suitable for small samples with unknown variances.