Challenge - 5 Problems
Statistical Decision Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediateUnderstanding mean and median impact
What is the output of this MATLAB code that calculates mean and median of a dataset?
MATLAB
data = [1 2 2 3 100]; mean_val = mean(data); median_val = median(data); fprintf('Mean: %.2f, Median: %.2f\n', mean_val, median_val);
Attempts:
2 left
💡 Hint
Recall how mean sums all values and divides by count, median is the middle value after sorting.
✗ Incorrect
The mean sums all numbers (1+2+2+3+100=108) and divides by 5, giving 21.6. The median is the middle value in sorted order [1 2 2 3 100], which is 2.
❓ Predict Output
intermediateEffect of outliers on variance
What is the output of this MATLAB code that calculates variance of two datasets?
MATLAB
data1 = [10 12 11 13 12]; data2 = [10 12 11 13 120]; var1 = var(data1); var2 = var(data2); fprintf('Variance1: %.2f, Variance2: %.2f\n', var1, var2);
Attempts:
2 left
💡 Hint
Variance measures spread; a large outlier increases variance significantly.
✗ Incorrect
The first dataset has small spread, variance about 1.3. The second dataset has a large outlier (120), increasing variance drastically to about 2355.7.
🔧 Debug
advancedIdentify the error in hypothesis testing code
What error does this MATLAB code produce when running a t-test?
MATLAB
sample1 = [5.1 5.5 5.3 5.7]; sample2 = [5.0 5.2 5.4]; [h,p] = ttest2(sample1, sample2, 'Alpha', 0.05, 'Tail', 'right'); disp(['p-value: ' num2str(p)]);
Attempts:
2 left
💡 Hint
Check MATLAB documentation for correct parameter names in ttest2.
✗ Incorrect
There is no error in the code. ttest2 supports unequal sample sizes and the parameters 'Alpha' and 'Tail' are used correctly. It performs a right-tailed t-test and displays the p-value.
❓ Predict Output
advancedInterpreting correlation coefficient output
What is the output of this MATLAB code that calculates correlation coefficient?
MATLAB
x = [1 2 3 4 5]; y = [2 4 6 8 10]; r = corrcoef(x,y); fprintf('Correlation coefficient: %.2f\n', r(1,2));
Attempts:
2 left
💡 Hint
Correlation measures linear relationship; y is exactly twice x.
✗ Incorrect
Since y is exactly 2 times x, the correlation coefficient is 1, indicating perfect positive linear correlation.
🧠 Conceptual
expertWhy do statistical tools drive better decisions?
Which option best explains why statistical tools improve decision-making in data analysis?
Attempts:
2 left
💡 Hint
Think about how statistics help interpret data rather than replace judgment.
✗ Incorrect
Statistical tools help quantify data characteristics and variability, giving objective insights that reduce guesswork. They do not guarantee perfect predictions or remove the need for human judgment.
