Formulas & Examples
All key formulas with worked examples
Q: Find mean of: 10, 20, 30, 40, 50
A: Mean = (10+20+30+40+50)/5 = 150/5 = 30
Q: Find variance of: 2, 4, 6 (mean=4)
A: Variance = [(2-4)² + (4-4)² + (6-4)²]/3 = [4+0+4]/3 = 8/3 = 2.67
Q: If variance = 16, find standard deviation
A: σ = √16 = 4
Q: TP=80, TN=90, FP=10, FN=20. Find accuracy.
A: Accuracy = (80+90)/(80+90+10+20) = 170/200 = 0.85 = 85%
Q: TP=80, FP=20. Find precision.
A: Precision = 80/(80+20) = 80/100 = 0.80 = 80%
Q: TP=80, FN=20. Find recall.
A: Recall = 80/(80+20) = 80/100 = 0.80 = 80%
Q: Precision=0.8, Recall=0.6. Find F1.
A: F1 = 2×(0.8×0.6)/(0.8+0.6) = 2×0.48/1.4 = 0.96/1.4 = 0.686
Q: TN=90, FP=10. Find specificity.
A: Specificity = 90/(90+10) = 90/100 = 0.90 = 90%
Q: x=70, mean=50, std=10. Standardize x.
A: x_scaled = (70-50)/10 = 20/10 = 2.0
Q: x=30, min=10, max=50. Scale x.
A: x_scaled = (30-10)/(50-10) = 20/40 = 0.5
Q: cov(X,Y)=15, σ_X=5, σ_Y=3. Find correlation.
A: ρ = 15/(5×3) = 15/15 = 1.0 (perfect positive)