Knowledge / Artificial Intelligence and Data Science / Probability distributions

Probability distributions

Artificial Intelligence and Data Science (B.E./B.Tech) · Mathematics and statistics for AI · free study notes for exams, placements and interviews

In short

A probability distribution is the rule that assigns probability to the values a random variable can take - a PMF for discrete variables, a PDF for continuous ones, and a CDF for both. It is the mathematical core of AI and data science: every loss function, every generative model, every noise assumption and every confidence statement rests on an assumed distribution. Indian university syllabi (AICTE model curriculum for AI&DS, UGC CBCS "Probability and Statistics") examine definitions, standard distributions with their means, variances and MGFs, and the Central Limit Theorem; GATE DA (Data Science and AI), GATE ST and CSIR/UGC-NET set numerical questions on exactly these. In interviews at Indian firms - TCS Research, Infosys, Wipro, Fractal, Mu Sigma, Flipkart, Swiggy, ZS Associates, banks and insurers - candidates are asked to pick the right distribution for a described situation and justify it.

Explained

Random variables, PMF, PDF, CDF

Expectation, variance and moments

Standard discrete distributions

Standard continuous distributions

Joint, marginal and conditional distributions

Limit theorems and approximations

How distributions drive AI and machine learning

Key points

Formulas and examples

Discrete: Σ p(x) = 1; E[X] = Σ x p(x); Var(X) = Σ x² p(x) − (E[X])²
Continuous: ∫f(x)dx = 1; E[X] = ∫x f(x)dx; Var(X) = E[X²] − μ²
Bernoulli(p): P(1) = p; mean p; var p(1−p); MGF = 1 − p + pet
Binomial(n,p): P(X=k) = C(n,k) pk (1−p)^{n−k}; mean np; var np(1−p); MGF = (1−p+pet)n
Poisson(λ): P(X=k) = e^{−λ} λk / k!; mean = var = λ; MGF = exp(λ(et − 1))
Geometric(p), trials to first success: P(X=k) = (1−p)^{k−1} p; mean 1/p; var (1−p)/p²
Hypergeometric: P(X=k) = C(K,k) C(N−K, n−k) / C(N,n); mean nK/N
Uniform(a,b): f = 1/(b−a); mean (a+b)/2; var (b−a)²/12
Exponential(λ): f = λe^{−λx}, x ≥ 0; F(x) = 1 − e^{−λx}; mean 1/λ; var 1/λ²; MGF = λ/(λ−t), t < λ
Gamma(k,λ): mean k/λ; var k/λ²; Weibull(k,λ): F(x) = 1 − exp(−(x/λ)k)
Normal(μ,σ²): f = (1/(σ√(2π))) exp(−(x−μ)²/(2σ²)); Z = (X−μ)/σ; MGF = exp(μt + σ²t²/2)
Beta(α,β): mean α/(α+β); var αβ/((α+β)²(α+β+1))
CLT: X̄ ≈ N(μ, σ²/n); Z = (X̄ − μ)/(σ/√n); standard error = σ/√n
Chebyshev: P(|X − μ| ≥ kσ) ≤ 1/k²; Markov: P(X ≥ a) ≤ E[X]/a (X ≥ 0)
Cov(X,Y) = E[XY] − E[X]E[Y]; ρ = Cov/(σ_X σ_Y); Var(X ± Y) = VarX + VarY ± 2Cov(X,Y)
Entropy H(X) = −Σ p(x) log p(x); KL D(P‖Q) = Σ p(x) log(p(x)/q(x))

Symbols: n = number of trials, p = success probability, λ = rate (events per unit interval for Poisson, per unit time for exponential, so units are 1/time), k = count or shape, μ = mean (same units as X), σ = standard deviation (units of X), σ² = variance (units of X squared), ρ = dimensionless correlation, C(n,k) = n!/(k!(n−k)!).

Example 1 - Binomial, a campus placement test. Each of 10 multiple-choice questions has 4 options; a student guesses all of them. p = 0.25, n = 10.

Example 2 - Poisson, a support desk. A Bengaluru helpdesk receives on average 3 calls per 10-minute slot; calls are independent. λ = 3.

Example 3 - Normal with standardisation, plus the empirical rule. Scores in an aptitude test are N(μ = 62, σ = 12).

Example 4 - Exponential, memorylessness and a machine. Time between breakdowns of a CNC machine is exponential with mean 200 hours, so λ = 1/200 = 0.005 per hour.

Example 5 - CLT and normal approximation to binomial. A food-delivery app's late-delivery rate is p = 0.20. In 400 orders, X = number late; np = 80, n(1−p) = 320, both ≥ 5.

DistributionTypeModelsMeanVariance
Bernoulli(p)DiscreteOne yes/no trialpp(1−p)
Binomial(n,p)DiscreteSuccesses in n trialsnpnp(1−p)
Poisson(λ)DiscreteRare counts per intervalλλ
Geometric(p)DiscreteTrials to first success1/p(1−p)/p²
Uniform(a,b)ContinuousEqual chance over a range(a+b)/2(b−a)²/12
Exponential(λ)ContinuousWaiting time, constant hazard1/λ1/λ²
Normal(μ,σ²)ContinuousSums, measurement errorμσ²
Log-normalContinuousPositive skewed (salary, claims)e^{μ+σ²/2}(e^{σ²}−1)e^{2μ+σ²}
Beta(α,β)ContinuousA proportion in (0,1)α/(α+β)αβ/((α+β)²(α+β+1))
import numpy as np
from scipy import stats

# Fit and compare: is the count data Poisson or over-dispersed?
x = np.random.poisson(3.0, size=5000)
print(x.mean(), x.var())            # both near 3 -> Poisson is plausible

# Tail probability of a normal, and a binomial exact value
print(1 - stats.norm.cdf(80, loc=62, scale=12))     # 0.0668
print(stats.binom.pmf(3, n=10, p=0.25))             # 0.2503

# Inverse-transform sampling from Exponential(lambda=0.005)
u = np.random.rand(10000)
t = -np.log(1 - u) / 0.005          # mean should be about 200 hours

Where it is used

Interview questions

Common mistakes

Related topics

Descriptive statistics · Statistical inference and estimation · Hypothesis testing · Bayesian statistics · Experiment design and A/B testing · Causal inference basics

Open in the Knowledge reader →Find jobs →