Multiply both sides by the marginal fX(x); the left side becomes the joint PDF of X and Z:
fX,Z(x,z)=fZ∣X(z∣x)fX(x)=fY(z−x)fX(x).
To get the marginal fZ, integrate over all possible x:
fZ(z)=∫−∞∞fX,Z(x,z)dx=∫−∞∞fX(x)fY(z−x)dx.
Why does the conditioning drop? I was unsure why we can remove “∣X=x”. Once X=x is fixed, the only random variable left in {Y≤z−x} is Y, and Y is independent of X, so conditioning on X=x does not change its distribution.
Proof by a thin strip.
P(z≤Z≤z+δ) is the probability that (X,Y) lands in the strip between the lines y=z−x and y=z+δ−x:
where the inner integral over an interval of width δ is approximated by a rectangle of height fY(z−x). Since also P(z≤Z≤z+δ)≈fZ(z)δ,
fZ(z)δ≈∫−∞∞fX(x)fY(z−x)δdx,
and dividing by δ and letting δ→0 gives (8.4).
The strip has negative slope because Z=X+Y means Y=Z−X. What we integrate over the strip is the joint density, so P(z≤Z≤z+δ) is the probability mass of the strip, not its area.
Example: Sum of Two Uniforms
Example 8.2 (Sum of two independent uniforms)
Let X,Y∼Uniform[0,1] be independent, so fX(x)=b−a1=1−01=1 on [0,1], and the same for fY. Find fZ for Z=X+Y.
and fZ(z)=0 otherwise. Check: the triangle has area 21⋅2⋅1=1.
Sliding overlap. As a function of x, fY(z−x) is a box on [z−1,z] that slides to the right as z increases. fZ(z) is the length of its overlap with the box [0,1]: it grows from 0 at z=0, is largest at z=1 (exact overlap), and shrinks back to 0 at z=2. The same flip-and-slide picture is how convolution is used in signal processing.
Bounding Tail Probabilities
Example 8.3 (How big must a buffer be?)
Over n time slots, Pi packets arrive in slot i, where P1,…,Pn∼Poisson(1) are i.i.d. A buffer holds 5n packets. How likely is it to overflow? We want to bound
P(i=1∑nPi>5n).
Theorem 8.2 (Markov’s inequality)
If X≥0 and a>0, then
P(X≥a)≤aE[X].
Proof.
Pointwise, X≥a1{X≥a}: if X≥a the right side is a≤X, and otherwise it is 0≤X. Taking expectations, E[X]≥aE[1{X≥a}]=aP(X≥a).
Let Sn=∑i=1nPi≥0. By linearity of expectation and E[Pi]=1 for Poisson(1),
Too loose. The bound 51 does not shrink as n grows, even though Sn/n stays close to its mean 1, far below 5, for large n. Markov only uses E[Sn].
The exponential trick. For t>0, the function x↦etx is strictly increasing, so the event is unchanged by applying it to both sides. Apply Markov to the nonnegative random variable etSn:
P(Sn>5n)=P(etSn>e5nt)≤e5ntE[etSn].(8.16)
Why etx? I was confused why this particular function. We want to apply a function T so that E[T(∑iPi)] splits into a product ∏iE[T(Pi)] by independence. That requires T(x+y)=T(x)T(y), which the exponential satisfies: T(x+y)=et(x+y)=etxety=T(x)T(y). The parameter t>0 is a scaling factor we are free to choose.
Since the Pi are independent and identically distributed,
For n=10: Markov gives 0.2, while this bound gives e−40.5≈2.7×10−18.
Is the bound ∝e−n? I was unsure about the rate. Any t>0 with g(t)<0 gives exponential decay eng(t); the best rate is 5ln5−4≈4.05, at t⋆=ln5. This method (Markov applied to etX, then optimizing over t) is called the Chernoff bound. The quantity E[etP] is the MGF of P, defined next.
Moment Generating Functions
Definition 8.2 (Moment generating function)
The moment generating function of a random variable X is
computing all the moments E[Xn] of a distribution;
sums of independent random variables: convolution becomes multiplication.
Theorem 8.3 (MGFs generate moments)
If MX(s)<∞ for all s in an open interval around 0, then for every n≥1,
MX(n)(0)=E[Xn].
Proof.
Here s is a constant inside the expectation and X is the random part, so dsdesX=XesX. Differentiating n times and moving the derivative inside the expectation (allowed because MX is finite near 0),
dsndnMX(s)=dsndnE[esX]=E[dsndnesX]=E[XnesX].
At s=0, e0⋅X=e0=1, so MX(n)(0)=E[XnesX]s=0=E[Xn].
Example 8.4 (MGF of the exponential)
Let X∼Exponential(λ): fX(x)=λe−λx for x∈[0,∞). Then
MX(s)=∫0∞esxλe−λxdx=λ∫0∞e(s−λ)xdx.
If s<λ, the exponent s−λ is negative and
MX(s)=λ[s−λ1e(s−λ)x]0∞=λ(0−s−λ1)=λ−sλ.
If s≥λ, the integrand e(s−λ)x≥1 for all x≥0, so the integral diverges:
MX(s)=⎩⎨⎧λ−sλ∞s<λ,s≥λ.
Moments.MX′(s)=(λ−s)2λ and MX′′(s)=(λ−s)32λ, so
If MX(s)=MY(s)<∞ for all s in some open interval (−ε,ε) around 0, then X and Y have the same distribution.
So if we recognize an MGF, we know the distribution. (The proof is beyond the scope of this course.)
Not finished in lecture. We ran out of time after starting the list of MGF properties. The main properties are filled in below.
Theorem 8.5 (Properties of MGFs)
MX(0)=1.
If Y=aX+b, then MY(s)=esbMX(as).
If X and Y are independent, then MX+Y(s)=MX(s)MY(s). More generally, for independent X1,…,Xn, MX1+⋯+Xn(s)=∏i=1nMXi(s), and (MX1(s))n if they are also identically distributed.
Proof.
MX(0)=E[e0⋅X]=E[1]=1.
MY(s)=E[es(aX+b)]=E[esbe(as)X]=esbE[e(as)X]=esbMX(as), since esb is a constant.
MX+Y(s)=E[es(X+Y)]=E[esXesY]=E[esX]E[esY]=MX(s)MY(s), using independence of esX and esY. The n-term version follows by induction.
Property 3 is the payoff: the density of X+Y requires a convolution integral, but its MGF is just a product.
MGF Proofs for Sums of Independent Random Variables
Lemma 8.1 (MGF of the Gaussian)
If X∼N(μ,σ2), then for all s∈R,
MX(s)=eμs+σ2s2/2.
Proof.
First let Z∼N(0,1). Complete the square in the exponent, z2−2sz=(z−s)2−s2: