6 Concentration Inequalities

6.1 Markov’s Inequality

For a non-negative (discrete or continuous) random variable XX, and t>0t > 0, P(X≥t)≤𝔼[X]tP(X \geq t) \leq \frac{\mathbb{E}[X]}{t}

Proof. 𝔼[X]=∫0∞xfX(x)dx=∫0txfX(x)dx+∫t∞xfX(x)dx[split integral at t]≥∫t∞xfX(x)dx[∵k≥0,𝒙≥𝟎,fX(x)≥0]≥∫t∞kfX(x)dx[because x ≥ t in the integral]=t∫t∞fX(x)dx=t⋅P(X≥t)\begin{align*} \mathbb{E}[X] &= \int_0^{\infty}xf_X(x)\:\mathrm{d}x \\ &= \int_0^{t}xf_X(x)\mathrm{d}x + \int_t^{\infty}xf_X(x)\:\mathrm{d}x && [\text{split integral at }t]\\ &\geq \int_t^{\infty}xf_X(x)\:\mathrm{d}x && [\because k\geq 0,\: \mathbf{x\geq 0},\: f_X(x)\geq 0]\\ &\geq \int_t^{\infty}kf_X(x)\:\mathrm{d}x && [\text{because x }\geq \text{ t in the integral}]\\ &= t\int_t^{\infty}f_X(x)\mathrm{d}x \\ &= t\cdot P(X\geq t) \end{align*}

Markov’s inequality

𝑿\mathbf{X} must be non-negative - Counterexample

Let XX be a discrete random variable such that X={100with probability 0.5−100with probability 0.5X = \begin{cases} 100 & \text{with probability } 0.5 \\ -100 & \text{with probability } 0.5 \end{cases}

EV is 𝔼[X]=∑x⋅P(X=x)=(100⋅0.5)+(−100⋅0.5)=50−50=0\begin{align*} \mathbb{E}[X] &= \sum x \cdot P(X=x) \\ &= (100 \cdot 0.5) + (-100 \cdot 0.5) \\ &= 50 - 50 \\ &= 0 \end{align*}

Let t=50t = 50. Using Markov’s inequality,

P(X≥50)≤𝔼[X]50P(X\geq 50) \leq \frac{\mathbb{E}[X]}{50} LHS=P(X≥50)=P(X=100)=0.5\text{LHS} = P(X\geq 50) = P(X = 100) = 0.5 RHS=𝔼[X]t=050=0\text{RHS} = \frac{\mathbb{E}[X]}{t} = \frac{0}{50} = 0 Hence, we get a contradiction (0.5≤00.5 \leq 0).
Takeaway: Negative numbers can skew the mean, making it aritficially small.

6.2 Chebyshev’s Inequality

For any random variable XX, and t>0t > 0, P(|X−𝔼[X]|≥t)≤𝕍[X]t2P \Bigl( |X-\mathbb{E}[X]| \geq t \Bigr) \leq \frac{\mathbb{V}[X]}{t^2}

Proof. P(|X−𝔼[X]|≥t)=P((X−𝔼[X])2≥t2)[∵t>0]≤𝔼[(X−𝔼[X])2]t2[Markov’s Inequality]=𝕍[X]t2\begin{align*} P \Bigl( |X - \mathbb{E}[X]| \geq t \Bigr) &= P\Bigl((X - \mathbb{E}[X])^2 \geq t^2 \Bigr) && [\because t>0] \\ &\leq \frac{\mathbb{E}[(X - \mathbb{E}[X])^2]}{t^2} && [\text{Markov's Inequality}] \\ &= \frac{\mathbb{V}[X]}{t^2} \end{align*}

Chebyshev’s inequality

6.2.1 Alternative form

Let t=kσt = k\sigma, k>0k > 0, σ=𝕍[X]\sigma = \sqrt{\mathbb{V}[X]}. P(|X−𝔼[X]|≥kσ)≤σ2(kσ)2=1k2P \Bigl( |X-\mathbb{E}[X]| \geq k\sigma \Bigr) \leq \frac{\sigma^2}{(k\sigma)^2} = \frac{1}{k^2} With k=2k=2, 1k2=14\frac{1}{k^2} = \frac{1}{4}, meaning 75% of data is within 2 standard deviations from the mean.

σ\sigma-form of Chebyshev’s inequality

6.2.2 Markov vs Chebyshev’s inequality

6.3 (Weak) Law of large numbers

Suppose X1,X2,…,XnX_1, X_2, \ldots, X_n are independent and identically distributed (iid) random variables, 𝔼[Xi]=μ,𝕍[Xi]=σ2,for i=1,…,n\mathbb{E}[X_i] = \mu,\quad \mathbb{V}[X_i] = \sigma^2,\quad \text{for } i = 1,\ldots,n The empirical average of outcomes is X¯n=1n∑i=1nXi\overline{X}_n = \frac{1}{n}\sum_{i=1}^n X_i Then 𝔼[X¯n]=μ,𝕍[X¯n]=nσ2n2=σ2n\mathbb{E}[\overline{X}_n] = \mu, \quad \mathbb{V}[\overline{X}_n] = \frac{n\sigma^2}{n^2} = \frac{\sigma^2}{n} [Variance decreases as we get more samples (n→∞n \to \infty)].
Using Chebyshev’s inequality, and for any ϵ>0\epsilon > 0, P(|X¯n−μ|≥ϵ)≤σ2nϵ2=σ2nϵ2P \Bigl(|\overline{X}_n - \mu| \geq \epsilon \Bigr) \leq \frac{\frac{\sigma^2}{n}}{\epsilon^2} = \frac{\sigma^2}{n\epsilon^2} limn→∞P(|X¯n−μ|≥ϵ)≤0\lim\limits_{n \to \infty} P \Bigl(|\overline{X}_n - \mu| \geq \epsilon \Bigr) \leq 0 Since probability cannot be less than 0, limn→∞P(|X¯n−μ|≥ϵ)≤0\lim\limits_{n \to \infty} P \Bigl(|\overline{X}_n - \mu| \geq \epsilon \Bigr) \leq 0 or limn→∞P(|X¯n−μ|<ϵ)=1\lim\limits_{n \to \infty} P \Bigl(|\overline{X}_n - \mu| < \epsilon \Bigr) = 1 Interpretation: For a large number nn, the calculated average X¯n\overline{X}_n converges to μ\mu with absolute certainty. This is because the variance decreases with increasing number of samples.

6.4 Hoeffding’s Inequality

For independent random variables X1,…,XnX_1, \ldots, X_n, with ai≤Xi≤bia_i \leq X_i \leq b_i, then P(|X¯n−𝔼[X¯n]|≥t)≤2exp⁡(−2n2t2∑i=1n(bi−ai)2)P \Bigl(|\overline{X}_n - \mathbb{E}[\overline{X}_n]| \geq t \Bigr) \leq 2\exp \left(-\frac{2n^2t^2}{\sum_{i=1}^n(b_i - a_i)^2}\right) Note:

Because of the exponenet term, Hoeffding’s inequality gives a tighter bound than Chebyshev’s inequality. (Chebyshev’s)O(1nt2)≫exp⁡(−O(nt2))(Hoeffding’s)(\text{Chebyshev's}) \quad O(\frac{1}{nt^2}) \quad \gg \quad \exp(-O(nt^2)) \quad (\text{Hoeffding's}) (assuming independence of variables).

6.4.0.1 Example

For iid random variables X1,…,XnX_1,\ldots,X_n following Bernoulli distribution, p=0.5p = 0.5,

(Chebyshev’s) 𝔼[X¯n]=0.5,𝕍[X¯n]=𝕍[X]n=p(1−p)n=14n\mathbb{E}[\overline{X}_n] = 0.5,\: \mathbb{V}[\overline{X}_n] = \frac{\mathbb{V}[X]}{n} = \frac{p(1-p)}{n} = \frac{1}{4n}, P(|X¯n−𝔼[X¯n]|≥t)≤𝕍[X¯n]t2=14nt2P\Bigl(|\overline{X}_n - \mathbb{E}[\overline{X}_n]|\geq t \Bigr) \leq \frac{\mathbb{V}[\overline{X}_n]}{t^2} = \frac{1}{4nt^2}

(Hoeffding’s) 0≤Xi≤1⇒∑i=1n(bi−ai)2=n0\leq X_i \leq 1 \Rightarrow \sum_{i=1}^n(b_i - a_i)^2 = n, P(|X¯n−𝔼[X¯n]|≥t)≤2exp⁡(−2n2t2n)=2exp⁡(−2nt2)P\Bigl(|\overline{X}_n - \mathbb{E}[\overline{X}_n]| \geq t\Bigr) \leq 2\exp\left(-\frac{2n^2t^2}{n}\right) = 2\exp(-2nt^2)

6.4.1 Markov v Chebyshev v Hoeffding

Feature Markov’s Chebyshev’s Hoeffding’s
Feature Markov Chebyshev Hoeffding

Requirements

Variable must be Non-Negative (X≥0X \ge 0). • Finite Mean (μ\mu) and Variance (σ2\sigma^2).
• Data can be unbounded or dependent.
• Variables must be Independent.
• Variables must be Bounded (a≤X≤ba \le X \le b).

Parameters Used

Mean (μ\mu). Mean (μ\mu) + Variance (σ2\sigma^2). Mean (μ\mu) + Bounds (a,ba, b) + Sample Size (nn).

What it Bounds

"Prob. that XX is huge?"
(One-sided tail)
"Prob. that XX is far from mean?"
(Two-sided distance)
"Prob. that average is far from mean?"
(Two-sided distance)

The Result

Loose (Linear Decay):
Error drops as 1t\frac{1}{t}.
(Weakest guarantee)
Medium (Polynomial Decay):
Error drops as 1t2\frac{1}{t^2} or 1n\frac{1}{n}.
(Solid, but conservative)
Tight (Exponential Decay):
Error drops as e−ne^{-n}.
(Strongest guarantee)

Best Use Case

When you know almost nothing (only the Mean) about the distribution. When data has high variance or "heavy tails" (e.g., income, stock market). When data is bounded (e.g., polls, test scores) and you need high confidence.

6.5 Central Limit Theorem

For a random variable XX with mean μ\mu and standard deviation σ\sigma, the standardisation of XX is the new random variable Z=X−μσZ = \frac{X - \mu}{\sigma} Note that ZZ has mean 0 and standard deviation 1. Note also that if XX has a Gaussian distribution, then the distribution of XX is the standard Gaussian distribution ZZ.

Suppose iid random variables X1,…,XnX_1, \ldots, X_n each with mean 𝔼[X]=μ\mathbb{E}[X]=\mu and 𝕍[X]=σ2\mathbb{V}[X]=\sigma^2. Let X¯n\overline{X}_n be the average such that X¯n=X1+…+Xnn=∑i=1nXin\overline{X}_n = \frac{X_1 + \ldots + X_n}{n} = \frac{\sum_{i=1}^nX_i}{n} The mean and variance are 𝔼[X¯n]=μ,𝕍[X¯n]=σ2n,σX¯n=σn\mathbb{E}[\overline{X}_n] = \mu,\quad \mathbb{V}[\overline{X}_n] = \frac{\sigma^2}{n},\quad \sigma_{\overline{X}_n} = \frac{\sigma}{\sqrt{n}} We can then standardise X¯n\overline{X}_n Zn=X¯n−μσ/nZ_n = \frac{\overline{X}_n - \mu}{\sigma / \sqrt{n}} By the Central Limit Theorem, limn→∞P(Zn≤t)=limn→∞P(n(X¯n−μ)σ≤t)=12π∫−∞texp⁡(−u22)du=Φ(t)\lim\limits_{n\to\infty}P(Z_n \leq t) = \lim\limits_{n\to\infty}P(\frac{\sqrt{n}(\overline{X}_n - \mu)}{\sigma}\leq t) = \frac{1}{\sqrt{2\pi}}\int_{-\infty}^t \exp(-\frac{u^2}{2})\:\mathrm{d}u = \Phi(t) This means that for large nn, ZnZ_n converges in distribution to the standard Gaussian distribution, and the probability that Zn≤tZ_n \leq t is just the area under the standard Gaussian PDF, from −∞→t-\infty \to t. So as n→∞n \to \infty, X¯n∼N(μ,σ2n),Zn∼N(0,1)\overline{X}_n \sim N(\mu, \frac{\sigma^2}{n}), \quad Z_n \sim N(0, 1)

Central Limit Theorem

6.5.1 Application of CLT - Normal approximation to binomial

Recall that for a Binomial random variable X∼B(n,p)X \sim B(n, p), P(X=k)=(nk)pk(1−p)n−kP(X=k) = \binom{n}{k} p^k (1-p)^{n-k} The problem is that computing this exact probability becomes extremely hard when nn and kk are large. The factorials inside the (nk)\binom{n}{k} term grow massively.
Instead, we can see the Binomial variable as a sum of individual Bernoulli trials.
We define the total successes as Sn=∑i=1nXiS_n = \sum_{i=1}^n X_i, where each individual trial Xi∈{0,1}X_i \in \{0, 1\}.
For each individual Bernoulli trial: 𝔼[Xi]=p,𝕍[Xi]=p(1−p)\mathbb{E}[X_i] = p,\quad \mathbb{V}[X_i] = p(1 - p) Because SnS_n is a sum of independent trials, we can apply the CLT. By standardising this sum, the distribution becomes approximately normal, as n→∞n \to \infty, Sn−npnp(1−p)≈𝒩(0,1)\frac{S_n - np}{\sqrt{np(1-p)}} \approx \mathcal{N}(0, 1) We can find the probability that number of successes falls within some lower and upper bounds. P(k≤Sn≤k′)=P(k−npnp(1−p)≤Sn−npnp(1−p)≤k′−npnp(1−p))≈P(k−npnp(1−p)≤Z≤k′−npnp(1−p))where Z∼𝒩(0,1)=Φ(k′−npnp(1−p))−Φ(k−npnp(1−p))\begin{align*} P(k \le S_n \le k') &= P\left(\frac{k - np}{\sqrt{np(1-p)}} \le \frac{S_n - np}{\sqrt{np(1-p)}} \le \frac{k' - np}{\sqrt{np(1-p)}}\right) \\ \\ &\approx P\left(\frac{k - np}{\sqrt{np(1-p)}} \le Z \le \frac{k' - np}{\sqrt{np(1-p)}}\right) \quad \text{where } Z \sim \mathcal{N}(0, 1) \\ \\ &= \Phi\left(\frac{k' - np}{\sqrt{np(1-p)}}\right) - \Phi\left(\frac{k - np}{\sqrt{np(1-p)}}\right) \end{align*} Example Flipping a fair coin n=40000n = 40000 times, what is the probability of getting between 19,600 and 20,400 heads?
Here, computing the exact binomial PMF is not feasible. We use the normal approximation.
Let SnS_n be the total number of heads. For a fair coin, the probability of heads is p=0.5p = 0.5. Sn∼B(40000,0.5)S_n \sim B(40000, 0.5) Calculating the mean and s.d. for each trial:

Thus, we have Sn≈𝒩(20000,1002)S_n \approx \mathcal{N}(20000, 100^2) Solving, P(19600≤Sn≤20400)=P(19600−20000100≤Sn−20000100≤20400−20000100)≈P(−4≤Z≤4)where Z∼𝒩(0,1)=Φ(4)−Φ(−4)≈1−0≈0.9999\begin{align*} P(19600 \le S_n \le 20400) &= P\left(\frac{19600 - 20000}{100} \le \frac{S_n - 20000}{100} \le \frac{20400 - 20000}{100}\right) \\ \\ &\approx P(-4 \le Z \le 4) \quad \text{where } Z \sim \mathcal{N}(0, 1) \\ &= \Phi(4) - \Phi(-4) \\ &\approx 1 - 0 \approx 0.9999 \end{align*}

Example A factory produces items with a defective probability pp. If we inspect nn items, what is the probability regarding the number of defective items?
Let SnS_n be the total number of defective items in the sample size of nn, then apply the equation above.

Example If an advertisement has a click through rate of pp, and the website gets nn unique visitors a day, what is the probability regarding the number of clicks?
Let SnS_n be the total number of ad clicks in the sample size of nn visitors, then apply the equation above.