🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
💼 Servicesℹ️ About✉️ ContactView Pricing Plansfrom $10

Statistics 101: Mean, Median, Variance and Distributions

Module 4: Statistics and ProbabilityDescriptive Statistics🟢 Free Lesson

Advertisement

Statistics 101: Mean, Median, Variance and Distributions

Why Statistics Matters for Data Science

Statistics is the mathematical foundation of machine learning. Every ML algorithm is essentially a statistical model optimizing some objective function. Without understanding statistics, you cannot truly understand why models work or fail.

The Statistics ?� ML Pipeline

DescriptiveStatisticsInferentialStatisticsProbabilityTheoryStatisticalLearningMachineLearningDeepLearning

1. Measures of Central Tendency

Central tendency describes the "center" or "typical value" of a dataset.

Mean (Arithmetic Average)

Formula:

Mean: Balance Point of DataMean = 11.5x̞ = (2+5+7+10+12+14+16+19) / 8 = 11.5

Median (Middle Value)

The median is the value separating the higher half from the lower half of a data sample.

Formula:

Median: The Middle Value2571012141619Median = (10+12)/2 = 11n=8 (even), so average the 4th and 5th values

Mode (Most Frequent)

Mode: Most Frequent Value372571Mode = Dog and Rabbit (bimodal, frequency = 7)

2. Measures of Spread (Dispersion)

Variance and Standard Deviation

Population Variance:

Sample Variance (Bessel's Correction):

Standard Deviation:

Variance: Average Squared Deviation from Meanμ = 10

σ² = (16 + 4 + 0 + 4 + 16 + 0) / 6 = 40/6 = 6.67

σ = ⇚6.67 = 2.58

Negative deviationPositive deviationOn the mean

3. The Normal Distribution (Gaussian)

The most important probability distribution in statistics and ML.

Probability Density Function (PDF):

Where:

  • = mean (location parameter)
  • = standard deviation (scale parameter)
  • = variance
Normal Distribution: The Bell Curveμμ - σμ + σ68.27%within ±1σ95.45%within ±2σ99.73%within ±3σμ-3σμ-2σμ-σμμ+σμ+2σμ+3σ

Standard Normal Distribution (Z-Score)

Z-Score Transformation:

This transforms any normal distribution to the standard normal with and .

Z-Score: How Many Standard Deviations from Mean?
IQ Scores: N(100, 15�)
100       70        130
? Z = (X-�)/s ? Standard Normal: N(0, 1)
0       -2        +2
IQ = 130 ? Z = (130-100)/15 = +2.0 (top 2.3%)

4. Central Limit Theorem (CLT)

The most important theorem in statistics – explains why the normal distribution appears everywhere.

Central Limit Theorem:

Given a population with mean and standard deviation , the sampling distribution of the sample mean approaches a normal distribution as sample size increases:

Standard Error:

Architecture Diagram
Central Limit Theorem in Action
Population
(any shape)
Take n samples
compute x̞
?�
n = 5
?�
n = 30
?�
n = 100

    Key Insight: As n increases, the sampling distribution becomes more normal


    σ̞ = σ/⇚n ?� Standard error decreases with ⇚n

Practical Impact
{item.n}

        SE = {item.se}

5. Skewness and Kurtosis

Skewness (Asymmetry)

Skewness: Measuring Distribution AsymmetrySymmetricSkew = 0Right SkewedSkew > 0Left SkewedSkew < 0

Mean > Median ?� Right Skewed | Mean < Median ?� Left Skewed

Kurtosis (Tail Weight)

Fisher's Kurtosis:

  • Mesokurtic (γ₂ = 0): Normal distribution
  • Leptokurtic (γ₂ > 0): Heavy tails, sharp peak
  • Platykurtic (γ₂ < 0): Light tails, flat peak

{Kurtosis: Comparing Tail Behavior Platykurtic (�4=2) Normal (�4=3) Leptokurtic (�4=8) Heavy tails ? Higher kurtosis = more outliers, fatter tails, sharper peak}


6. Covariance and Correlation

Covariance

Covariance:

  • Cov > 0: Variables move together (positive)
  • Cov < 0: Variables move opposite (negative)
  • Cov = 0: No linear relationship

Pearson Correlation Coefficient

Pearson's r:

Correlation: Different Values of rr = -1 (Perfect)r = -0.5r = 0 (None)r = +1 (Perfect)r = +0.7 (Strong Positive)

Note: Correlation measures LINEAR relationship only. Non-linear patterns need other metrics.


7. Confidence Intervals

Confidence Interval for Mean:

Common Confidence Levels:

Levelz-scoreArea in Tails
90%1.6455% each side
95%1.9602.5% each side
99%2.5760.5% each side
95% Confidence Interval Visualizationx̞ = 50386295%2.5%2.5%

We are 95% confident that the true mean lies between 38 and 62


Key Takeaways

  1. Mean, Median, Mode describe central tendency – choose based on data shape
  2. Variance/Standard Deviation quantify spread – foundation of all ML loss functions
  3. Normal Distribution – the bell curve underlies hypothesis testing and CLT
  4. CLT – sample means are normal regardless of population shape (n ��¥ 30)
  5. Correlation ��  Causation – always consider confounding variables
  6. Confidence Intervals – quantify uncertainty in estimates

Next: Probability, Bayes' Theorem and PDF/CDF

Build on these foundations with probability theory and Bayesian inference.

Need Expert Data Science Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement