Writing

Machine Learning Math Foundations (3) — Probability

Preface: probability can feel abstract; use samples to approach truth, and master basics like mean and variance.

Preface: probability can feel abstract; use samples to approach truth, and master basics like mean and variance.

Permutations and Combinations

Foundation for formulas. Permutation:

image

Combination:

image

Classical Probability

Event A: a elementary outcomes favor A, b do not.

image

Joint Probability

Both events occur: P(AB).

Conditional Probability

Probability of A given B has occurred:

image

Corollary: n events occurring together:

image

Law of Total Probability

Sample space Ω partitioned by events A₁, A₂, …, A_n as in the figure:

image

For any event B, the law of total probability:

image

Also called the result probability formula (B is usually the outcome event).

Bayes’ Formula

Provable from conditional probability:

image

If A₁, A₂, …, A_n partition Ω and P(B) > 0:

image

Also called the cause probability formula—finding causes given B has occurred.

Independent Events

A and B unrelated—independent:

image

Random Variables

Concrete events A, B as variables and functions over sample space. Examples: dice roll X = number shown; cars passing an intersection 8:00–9:00, Y = count—Y is a random variable.

Discrete Random Variables

image

  • Bernoulli distribution: image Notation: image Parameter: one trial; p = success probability. (2) Binomial: probability of k successes in n trials: image Notation: image (3) Poisson: limit of binomial as n → ∞: image Parameter: image (4) Geometric: trials until first success in Bernoulli trials: image (5) Hypergeometric: N items, M defective, draw n; X = defect count in sample: image ## Continuous Random Variables CDF F(x), PDF f(x). (1) Uniform: image Notation: image Exponential: X ~ Exp(λ), mean 1/λ, variance 1/λ²: image image (3) Normal: image For general normal, convert to standard normal first. ## Expectation and Variance

After studying, prove expectations and variances of each distribution for deeper understanding.

  • Expectation (mean): probability-weighted average—sum of outcomes times probabilities. Often denoted: image Variance measures spread from the mean: image Common distributions: image Covariance (cov): overall error between two variables.

  • Correlation (corr): degree of linear relationship.

  • Central and raw moments: E(X) is first raw moment; Var(X) is second central moment; Cov(X,Y) is second mixed central moment.

  • Kurtosis: peakedness of the distribution.

  • Skewness: left or right skew.

Three Basic Theorems

  • Chebyshev’s inequality: X with mean μ, variance σ²; for any ε > 0: image Meaning: smaller variance → event {|X − μ|

image

Since f(x) > 0, log preserves monotonicity:

image

You might also like: my pandas notes for ML, my matplotlib notes for ML, my NumPy notes for ML