EECS 126 (UC Berkeley) · Spring 2026 · February 17, 2026
Reading: Bertsekas & Tsitsiklis, §5.1; supplementary notes on concentration inequalities.
These are my personal notes from Professor Kannan Ramchandran’s EECS 126 (Probability and Random Processes) course at UC Berkeley.
Topics: Markov’s inequality, Chebyshev’s inequality, the Chernoff bound, Jensen’s inequality, Hoeffding’s inequality, and a first look at the law of large numbers and the central limit theorem. Each bound trades more information about X for a tighter estimate of a tail probability.
Markov’s Inequality
Theorem 9.1 (Markov’s inequality)
If X≥0 and a>0, then
P(X≥a)≤aE[X].(9.1)
Proof.
Compare X with the random variable a1{X≥a} pointwise:
if X≥a: a1{X≥a}=a≤X;
if X<a: a1{X≥a}=0≤X, since X≥0.
So X≥a1{X≥a} always. Taking expectations, and using E[1A]=P(A),
E[X]≥aE[1{X≥a}]=aP(X≥a).
Dividing by a>0 gives (9.1).
For x≥0, the line x lies above the step a1{x≥a}; averaging both sides gives Markov.
Example 9.1 (Markov for an exponential)
Let X∼Exponential(1), so E[X]=1 (Lecture 8) and P(X≥a)=∫a∞e−xdx=[−e−x]a∞=e−a. Markov gives
P(X≥a)≤a1.
At a=5: Markov gives 0.2, while the exact value is e−5≈0.0067.
Markov cannot be improved using only the mean. Fix m=E[X] and a≥m. The random variable
X={a0w.p. am,w.p. 1−am
has E[X]=a⋅am=m and P(X≥a)=am=aE[X], so (9.1) holds with equality. To do better, we need more information about X.
Chebyshev’s Inequality
Theorem 9.2 (Chebyshev’s inequality)
If X has mean μ and variance σ2, then for every c>0,
P(∣X−μ∣≥c)≤c2σ2.
With c=kσ:
P(∣X−μ∣≥kσ)≤k21.
Proof.
Both sides of ∣X−μ∣≥c are nonnegative, so squaring does not change the event: {∣X−μ∣≥c}={(X−μ)2≥c2}. Apply Markov to the nonnegative random variable (X−μ)2 with a=c2:
P(∣X−μ∣≥c)=P((X−μ)2≥c2)≤c2E[(X−μ)2]=c2σ2.
The parabola (cx−μ)2 lies above the indicator; averaging both sides gives Chebyshev. It uses the variance, not just the mean.
Example 9.2 (Chebyshev for a uniform)
Let X∼Uniform[0,1]. Then μ=21, E[X2]=∫01x2dx=31, and
σ2=E[X2]−μ2=31−41=121.
With c=0.4, the exact value is P(∣X−21∣≥0.4)=P(X≤0.1)+P(X≥0.9)=0.1+0.1=0.2, while
P(∣X−21∣≥0.4)≤(0.4)21/12=12⋅0.161=1.921≈0.52.
Example 9.3 (Polling with Chebyshev)
To estimate the fraction p of voters who support a candidate, poll n people independently. Let Xi∼Bernoulli(p) indicate support and Mn=n1∑i=1nXi. How large must n be so that P(∣Mn−p∣≥0.01)≤0.05?
E[Mn]=p and Var(Mn)=np(1−p) (Lecture 4 and Lecture 10). Since p is unknown, bound the variance:
p(1−p)=41−(p−21)2≤41.
By Chebyshev with c=ε,
P(∣Mn−p∣≥ε)≤nε2p(1−p)≤4nε21.
Setting 4nε21≤δ with ε=0.01, δ=0.05:
n≥4ε2δ1=4(0.01)2(0.05)1=0.000021=50,000.
The Chernoff Bound
Theorem 9.3 (Chernoff bound)
For every b and every s>0,
P(X≥b)≤e−sbMX(s),MX(s)=E[esX],
and therefore
P(X≥b)≤s>0mine−sbMX(s).
For the lower tail, P(X≤b)≤mins<0e−sbMX(s).
Proof.
For s>0, x↦esx is strictly increasing, so {X≥b}={esX≥esb}. Apply Markov to the nonnegative random variable esX:
P(X≥b)=P(esX≥esb)≤esbE[esX]=e−sbMX(s).
This holds for every s>0, so it holds for the minimizing s. For s<0, x↦esx is strictly decreasing, so {X≤b}={esX≥esb}, and the same argument gives the lower-tail bound.
For any s>0, the exponential es(x−b) lies above the indicator 1{x≥b}; averaging gives P(X≥b)≤e−sbMX(s), and we choose s to make the curve hug the indicator as tightly as possible.
Example 9.4 (Gaussian tail)
Let Z∼N(0,1), so MZ(s)=es2/2 (Lecture 8). For t>0,
P(Z≥t)≤s>0mine−st+s2/2.
The exponent h(s)=2s2−st has h′(s)=s−t=0 at s⋆=t, and h(t)=2t2−t2=−2t2. Therefore
P(Z≥t)≤e−t2/2.
Compare with Chebyshev, which gives P(Z≥t)≤P(∣Z∣≥t)≤t21:
Chebyshev decays polynomially; Chernoff decays like the true tail, up to a smaller factor.
Example 9.5 (Chernoff for coin flips)
Let Sn∼Binomial(n,p), a sum of n independent Bernoulli(p) flips, so MSn(s)=(1−p+pes)n: each flip has E[esXi]=(1−p)e0+pes, and the MGF of an independent sum is the product (Lecture 8). For p<q<1,
A function g is convex if for all x,y and λ∈[0,1],
g(λx+(1−λ)y)≤λg(x)+(1−λ)g(y):(9.23)
every chord lies above the graph. If g is differentiable, convexity is equivalent to every tangent line lying below the graph:
g(x)≥g(c)+g′(c)(x−c)for all x,c.(9.24)
g is concave if −g is convex. Examples: x2, esx, ∣x∣ are convex; lnx and x are concave on (0,∞).
Theorem 9.4 (Jensen’s inequality)
If g is convex, then
g(E[X])≤E[g(X)].
If g is concave, the inequality reverses: g(E[X])≥E[g(X)].
Proof.
Take the tangent line (9.24) at c=E[X] and substitute x=X:
g(X)≥g(E[X])+g′(E[X])(X−E[X]).
Take expectations. g(E[X]) and g′(E[X]) are constants, and E[X−E[X]]=0:
E[g(X)]≥g(E[X])+g′(E[X])⋅0=g(E[X]).
(For a convex g that is not differentiable, the same argument works with any supporting line through (E[X],g(E[X])).) For concave g, apply the result to −g.
For X equal to x1 or x2 with probability 21 each, E[g(X)] is the midpoint of the chord, which lies above g(E[X]) on the curve.
Example 9.6 (Consequences of Jensen)
g(x)=x2 (convex): (E[X])2≤E[X2], i.e. Var(X)=E[X2]−(E[X])2≥0.
g(x)=esx (convex): esE[X]≤MX(s), so an MGF is never smaller than esE[X].
g(x)=lnx (concave): E[lnX]≤lnE[X]. For X uniform on positive numbers {x1,…,xn},
n1i=1∑nlnxi≤ln(n1i=1∑nxi)⟹(i=1∏nxi)1/n≤n1i=1∑nxi,
the arithmetic–geometric mean inequality.
In the St. Petersburg game (Lecture 5), E[log2W]=2 is finite even though E[W]=∞, consistent with E[log2W]≤log2E[W].
Hoeffding’s Inequality
Chernoff requires the MGF. For bounded random variables, we can bound the MGF without knowing the distribution.
Lemma 9.1 (Hoeffding’s lemma)
If a≤X≤b and E[X]=0, then for every s∈R,
E[esX]≤es2(b−a)2/8.
Proof.
Since E[X]=0, we have a≤0≤b. Write x∈[a,b] as the convex combination x=λa+(1−λ)b with λ=b−ab−x. By convexity of esx (9.23),
esx≤b−ab−xesa+b−ax−aesb.
Substitute x=X and take expectations, using E[X]=0:
E[esX]≤b−abesa−b−aaesb.
Let p=b−a−a∈[0,1] and h=s(b−a), so sa=−ph and sb=h−ph. The right side becomes
Let C=∑i(bi−ai)2. Each centered term Xi−E[Xi] has mean 0 and lies in an interval of length bi−ai. By Chernoff, independence (Lecture 8), and Hoeffding’s lemma, for s>0,
Minimize the exponent: −t+4sC=0 at s⋆=C4t, giving
−C4tt+C216t2⋅8C=−C4t2+C2t2=−C2t2.
For the sample mean, {Mn−μ≥ε}={Sn−nμ≥nε}, so take t=nε and C=n(b−a)2: C2t2=n(b−a)22n2ε2=(b−a)22nε2. The lower tail is the same bound applied to −Xi, and adding the two tails gives the factor 2.
Example 9.7 (Polling with Hoeffding)
Return to polling: Xi∈[0,1], so b−a=1. By (9.36),
P(∣Mn−p∣≥ε)≤2e−2nε2≤δ⟺n≥2ε2ln(2/δ).
With ε=0.01, δ=0.05:
n≥2(0.01)2ln40=0.00023.689≈18,445,
compared with 50,000 from Chebyshev. The two bounds as functions of n (with ε=0.05):
Chebyshev decays like n1; Hoeffding decays exponentially in n.
A First Look at the LLN and the CLT
Law of large numbers. For i.i.d. Xi with mean μ and variance σ2, Chebyshev gives
P(∣Mn−μ∣≥ε)≤nε2σ2⟶0,
which is the weak law of large numbers (proved in full in Lecture 10).
Central limit theorem.Zn=σn(Mn−μ) is approximately N(0,1) for large n (Lecture 10), so
P(∣Mn−μ∣≥ε)=P(∣Zn∣≥σεn)≈2(1−Φ(σεn)).
For polling, σ2≤41, and 2(1−Φ(1.96))=0.05, so we need σεn≥1.96:
n≥ε2(1.96)2σ2,which holds for every p oncen≥4(0.01)2(1.96)2=9,604.
This is an approximation, not a guaranteed bound like Chebyshev or Hoeffding.