Bayes' Rule and Law of Total Probability: C C C C C 1 2 3
Bayes' Rule and Law of Total Probability: C C C C C 1 2 3
1 Simpson’s Paradox
c c c c
Expected Value, Linearity, and Symmetry
P (A | B, C) < P (A | B , C) and P (A | B, C ) < P (A | B , C ) Expected Value (aka mean, expectation, or average) can be thought
Compiled by William Chen (http://wzchen.com) with contributions c of as the “weighted average” of the possible outcomes of our
yet still, P (A | B) > P (A | B )
from Sebastian Chiu, Yuan Jiang, Yuqi Hou, and Jessy Hwang. random variable. Mathematically, if x1 , x2 , x3 , . . . are all of the
Material based off of Joe Blitzstein’s (@stat110) lectures possible values that X can take, the expected value of X can be
(http://stat110.net) and Blitzstein/Hwang’s Intro to Probability Bayes’ Rule and Law of Total Probability calculated as follows:
textbook (http://bit.ly/introprobability). Licensed under CC P
Law of Total Probability with partitioning set B1 , B2 , B3 , ...Bn and E(X) = xi P (X = xi )
BY-NC-SA 4.0. Please share comments, suggestions, and errors at i
http://github.com/wzchen/probability_cheatsheet. with extra conditioning (just add C!)
Note that for any X and Y , a and b scaling coefficients and c is
P (A) = P (A|B1 )P (B1 ) + P (A|B2 )P (B2 ) + ...P (A|Bn )P (Bn ) our constant, the following property of Linearity of
Last Updated February 28, 2015
P (A) = P (A ∩ B1 ) + P (A ∩ B2 ) + ...P (A ∩ Bn ) Expectation holds:
P (A|C) = P (A|B1 , C)P (B1 , C) + ...P (A|Bn , C)P (Bn |C)
Counting E(aX + bY + c) = aE(X) + bE(Y ) + c
P (A|C) = P (A ∩ B1 |C) + P (A ∩ B2 |C) + ...P (A ∩ Bn |C) If two Random Variables have the same distribution, even
Multiplication Rule - Let’s say we have a compound experiment when they are dependent by the property of Symmetry their
(an experiment with multiple components). If the 1st Law of Total Probability with B and Bc (special case of a partitioning
expected values are equal.
component has n1 possible outcomes, the 2nd component has set), and with extra conditioning (just add C!)
Conditional Expected Value is calculated like expectation, only
n2 possible outcomes, and the rth component has nr possible c c
P (A) = P (A|B)P (B) + P (A|B )P (B ) conditioned on any event A.
outcomes, then overall there are n1 n2 . . . nr possibilities for the
c P
whole experiment. P (A) = P (A ∩ B) + P (A ∩ B ) E(X|A) = xP (X = x|A)
x
c c
Sampling Table - The sampling tables describes the different ways P (A|C) = P (A|B, C)P (B|C) + P (A|B , C)P (B |C)
to take a sample of size k out of a population of size n. The c
Indicator Random Variables
column names denote whether order matters or not. P (A|C) = P (A ∩ B|C) + P (A ∩ B |C) Indicator Random Variables is random variable that takes on
Bayes’ Rule, and with extra conditioning (just add C!) either 1 or 0. The indicator is always an indicator of some
Matters Not Matter
n + k − 1 event. If the event occurs, the indicator is 1, otherwise it is 0.
k They are useful for many problems that involve counting and
With Replacement n P (A ∩ B) P (B|A)P (A)
k P (A|B) = = expected value.
n! n P (B) P (B)
Without Replacement Distribution IA ∼ Bern(p) where p = P (A)
(n − k)! k
P (A ∩ B|C) P (B|A, C)P (A|C) Fundamental Bridge The expectation of an indicator for A is the
P (A|B, C) = =
Naı̈ve Definition of Probability - If the likelihood of each P (B|C) P (B|C) probability of the event. E(IA ) = P (A). Notation:
outcome is equal, the probability of any event happening is:
Odds Form of Bayes’ Rule, and with extra conditioning (just add C!) (
number of favorable outcomes 1 A occurs
P (Event) = P (A|B) P (B|A) P (A) IA =
number of outcomes = 0 A does not occur
P (Ac |B) P (B|Ac ) P (Ac )
Probability and Thinking Conditionally Poisson, Continuous RVs, LotUS, UoU
P (A|B, C) P (B|A, C) P (A|C)
=
Independence P (Ac |B, C) P (B|Ac , C) P (Ac |C) Continuous Random Variables
Independent Events - A and B are independent if knowing one What’s the prob that a CRV is in an interval? Use the CDF (or
gives you no information about the other. A and B are
Random Variables and their Distributions the PDF, see below). To find the probability that a CRV takes
independent if and only if one of the following equivalent on a value in the interval [a, b], subtract the respective CDFs.
statements hold:
PMF, CDF, and Independence P (a ≤ X ≤ b) = P (X ≤ b) − P (X ≤ a) = F (b) − F (a)
Probability Mass Function (PMF) (Discrete Only) gives the
P (A ∩ B) = P (A)P (B) probability that a random variable takes on the value X. Note that for an r.v. with a normal distribution,
P (A|B) = P (A) P (a ≤ X ≤ b) = P (X ≤ b) − P (X ≤ a)
PX (x) = P (X = x)
b−µ a−µ
Conditional Independence - A and B are conditionally Cumulative Distribution Function (CDF) gives the probability =Φ − Φ
independent given C if: P (A ∩ B|C) = P (A|C)P (B|C). σ2 σ2
that a random variable takes on the value x or less
Conditional independence does not imply independence, and What is the Cumulative Density Function (CDF)? It is the
independence does not imply conditional independence. FX (x0 ) = P (X ≤ x0 ) following function of x.
F (x) = P (X ≤ x)
Unions, Intersections, and Complements Independence - Intuitively, two random variables are independent if
De Morgan’s Laws - Gives a useful relation that can make knowing one gives you no information about the other. X and What is the Probability Density Function (PDF)? The PDF,
calculating probabilities of unions easier by relating them to Y are independent if for ALL values of x and y: f (x), is the derivative of the CDF.
intersections, and vice versa. De Morgan’s Law says that the 0
P (X = x, Y = y) = P (X = x)P (Y = y) F (x) = f (x)
complement is distributive as long as you flip the sign in the Or alternatively,
middle. Z x
c
(A ∪ B) ≡ A ∩ B
c c Expected Value and Indicators F (x) = f (t)dt
−∞
c
(A ∩ B) ≡ A ∪ B
c c Note that by the fundamental theorem of calculus,
Distributions Z b
Probability Mass Function (PMF) (Discrete Only) is a function F (b) − F (a) = f (x)dx
Joint, Marginal, and Conditional Probabilities that takes in the value x, and gives the probability that a a
Joint Probability - P (A ∩ B) or P (A, B) - Probability of A and B. random variable takes on the Pvalue x. The PMF is a Thus to find the probability that a CRV takes on a value in an
Marginal (Unconditional) Probability - P (A) - Probability of A positive-valued function, and x P (X = x) = 1
interval, you can integrate the PDF, thus finding the area
under the density curve.
Conditional Probability - P (A|B) - Probability of A given B PX (x) = P (X = x)
How do I find the expected value of a CRV? Where in discrete
occurred.
Cumulative Distribution Function (CDF) is a function that cases you sum over the probabilities, in continuous cases you
Conditional Probability is Probability - P (A|B) is a probability takes in the value x, and gives the probability that a random integrate over the densities.
as well, restricting the sample space to B instead of Ω. Any variable takes on the value at most x.
Z ∞
theorem that holds for probability also holds for conditional E(X) = xf (x)dx
F (x) = P (X ≤ x) −∞
probability.
Law of the Unconscious Statistician (LotUS) Moment Generating Functions Marginal Distributions
Expected Value of Function of RV Normally, you would find the MGF For any random variable X, this expected value and function of Review: Law of Total Probability
P Says for an event A and partition
expected value of X this way: dummy variable t; B1 , B2 , ...Bn : P (A) = i P (A ∩ Bi )
tX To find the distribution of one (or more) random variables from a joint
MX (t) = E(e )
E(X) = Σx xP (X = x) distribution, sum or integrate over the irrelevant random variables.
is the moment generating function (MGF) of X if it exists
Getting the Marginal PMF from the Joint PMF
Z ∞ for a finitely-sized interval centered around 0. Note that the
E(X) = xf (x)dx MGF is just a function of a dummy variable t. X
−∞
P (X = x) = P (X = x, Y = y)
Why is it called the Moment Generating Function? Because y
LotUS states that you can find the expected value of a function
the kth derivative of the moment generating function evaluated
of a random variable g(X) this way: Getting the Marginal PDF from the Joint PDF
0 is the kth moment of X!
Z
E(g(X)) = Σx g(x)P (X = x) 0 k
µk = E(X ) = MX (0)
(k)
fX (x) = fX,Y (x, y)dy
Z ∞ y
E(g(X)) = g(x)f (x)dx This is true by Taylor Expansion of etX
−∞
∞ ∞
Independence of Random Variables
tX
X E(X k )tk X µ0k tk Review: A and B are independent if and only if either
What’s a function of a random variable? A function of a random MX (t) = E(e )= =
variable is also a random variable. For example, if X is the k! k! P (A ∩ B) = P (A)P (B) or P (A|B) = P (A).
k=0 k=0
number of bikes you see in an hour, then g(X) = 2X could be Similar conditions apply to determine whether random variables are
the number of bike wheels you see in an hour. Both are random Or by differentiation under the integral sign and then plugging independent - two random variables are independent if their joint
variables. in t = 0 distribution function is simply the product of their marginal
distributions, or that the a conditional distribution of is the same as
What’s the point? You don’t need to know the PDF/PMF of g(X) (k) dk tX dk tX k tX its marginal distribution.
MX (t) = E(e ) = E( k e ) = E(X e )
to find its expected value. All you need is the PDF/PMF of X. dtk dt In words, random variables X and Y are independent for all x, y, if
(k) k 0X k 0 and only if one of the following hold:
MX (0) = E(X e ) = E(X ) = µk
Variance, Expectation and Independence, and ex • Joint PMF/PDF/CDFs are the product of the Marginal PMF
MGF of linear combinations If we have Y = aX + c, then • Conditional distribution of X given Y is the same as the
Taylor Series marginal distribution of X
∞ t(aX+c) ct (at)X ct
x
X xn MY (t) = E(e ) = e E(e ) = e MX (at)
e = Multivariate LotUS
n=0
n! P
Uniqueness of the MGF. If it exists, the MGF uniquely defines Review: E(g(X))
R∞ = x g(x)P (X = x), or
2
Var(X) = E(X ) − [E(X)]
2 the distribution. This means that for any two random variables E(g(X)) = −∞ g(x)fX (x)dx
X and Y , they are distributed the same (their CDFs/PDFs are For discrete random variables:
If X and Y are independent, then equal) if and only if their MGF’s are equal. You can’t have XX
different PDFs when you have two random variables that have E(g(X, Y )) = g(x, y)P (X = x, Y = y)
E(XY ) = E(X)E(Y ) the same MGF. x y
Summing Independent R.V.s by Multiplying MGFs. If X and For continuous random variables:
Universality of Uniform Y are independent, then Z ∞ Z ∞
When you plug any random variable into its own CDF, you get a E(g(X, Y )) = g(x, y)fX,Y (x, y)dxdy
t(X+Y ) tX tY
Uniform[0,1] random variable. When you put a Uniform[0,1] into an M(X+Y ) (t) = E(e ) = E(e )E(e ) = MX (t) · MY (t) −∞ −∞
inverse CDF, you get the corresponding random variable. For example,
M(X+Y ) (t) = MX (t) · MY (t)
let’s say that a random variable X has a CDF Covariance and Transformations
−x The MGF of the sum of two random variables is the product of
F (x) = 1 − e the MGFs of those two random variables. Covariance and Correlation
Covariance is the two-random-variable equivalent of Variance,
By the Universality of the the Uniform, if we plug in X into this
function then we get a uniformly distributed random variable. Joint PDFs and CDFs defined by the following:
or, letting X be the number of free throws that he makes, Multinomial Let us say that the vector 3. If we have that Z ∼ Pois(λ), and we randomly and
X is a Binomial Random Variable distributed Bin(10, 34 ). ~ = (X1 , X2 , X3 , . . . , Xk ) ∼ Multk (n, p independently “accept” every item in Z with probability p,
X ~) where
then the number of accepted items Z1 ∼ Pois(λp), and the
Binomial Coefficient n
k is a function of n and k and is read
p
~ = (p1 , p2 , . . . , pk ).
number of rejected items Z2 ∼ Pois(λq), and Z1 ⊥
⊥ Z2 .
n choose k, and means out of n possible indistinguishable
Story - We have n items, and then can fall into any one of the
objects, how many ways can I possibly choose k of them? Convolutions of Random Variables
k buckets independently with the probabilities
The formula for the binomial coefficient is:
p
~ = (p1 , p2 , . . . , pk ). A convolution of n random variables is simply their sum.
n n!
= Example - Let us assume that every year, 100 students in the 1. X ∼ Pois(λ1 ), Y ∼ Pois(λ2 ),
k k!(n − k)! Harry Potter Universe are randomly and independently X ⊥
⊥ Y −→ X + Y ∼ Pois(λ1 + λ2 )
sorted into one of four houses with equal probability. The 2. X ∼ Bin(n1 , p), Y ∼ Bin(n2 , p),
Geometric Let us say that X is distributed Geom(p). We know the
number of people in each of the houses is distributed X ⊥⊥ Y −→ X + Y ∼ Bin(n1 + n2 , p) Note that Binomial can
following:
Mult4 (100, p
~), where p~ = (.25, .25, .25, .25). Note that thus be thought of as a sum of iid Bernoullis.
Story X is the number of “failures” that we will achieve X1 + X2 + · · · + X4 = 100, and they are dependent.
3. X ∼ Gamma(n1 , λ), Y ∼ Gamma(n2 , λ),
before we achieve our first success. Our successes have Multinomial Coefficient The number of permutations of n X ⊥⊥ Y −→ X + Y ∼ Gamma(n1 + n2 , λ) Note that Gamma
probability p. objects where you have n1 , n2 , n3 . . . , nk of each of the can thus be thought of as a sum of iid Expos.
1
Example If each pokeball we throw has a 10 probability to different variants is the multinomial coefficient.
4. X ∼ NBin(r1 , p), Y ∼ NBin(r2 , p),
catch Mew, the number of failed pokeballs will be n n!
1 = X ⊥
⊥ Y −→ X + Y ∼ NBin(r1 + r2 , p)
distributed Geom( 10 ). n1 n2 . . . n k n1 !n2 ! . . . nk !
5. All of the above are approximately normal when λ, n, r are
First Success Equivalent to the geometric distribution, except it Joint PMF - For n = n1 + n2 + · · · + nk large by the Central Limit Theorem.
counts the total number of “draws” until the first success. This
is 1 more than the number of failures. If X ∼ F S(p) then ~ =~
n
n n n 6. Z1 ∼ N (µ1 , σ12 ), Z2 ∼ N (µ2 , σ22 ),
P (X n) = p 1 p 2 . . . pk k
E(X) = 1/p. n1 n2 . . . nk 1 2 ⊥ Z2 −→ Z1 + Z2 ∼ N (µ1 + µ2 , σ12 + σ22 )
Z1 ⊥
Special Cases of Random Variables Classic Problems Orderings of i.i.d. random variables
1. Bin(1, p) ∼ Bern(p) I call 2 UberX’s and 3 Lyfts at the same time. If the time it takes for
the rides to reach me is i.i.d., what is the probability that all the Lyfts
2. Beta(1, 1) ∼ Unif(0, 1)
Birthday Matches will arrive first? Answer - since the arrival times of the five cars are
In a group of n people, what is the expected number of distinct i.i.d., all 5! orderings of the arrivals are equally likely. There are 3!2!
3. Gamma(1, λ) ∼ Expo(λ) birthdays (month and day). What is the expected number of birthday orderings that involve the Lyfts arriving first, so the probability that
4. χ2n ∼ Gamma n 1
matches? Answer - Let X be the number of distinct birthdays, and 3!2!
2, 2 = 1/10 . Alternatively, there are 53
let Ij be the indicator for whether the j th days is represented. the Lyfts arrive first is
5!
5. NBin(1, p) ∼ Geom(p)
E(Ij ) = 1 − P (no one born day j) = 1 − (364/365)
n ways to choose 3 of the 5 slots for the Lyfts to occupy, where each of
the choices are equally likely. 1 of those choices have all 3 of the Lyfts
Reasoning by Representation n
5
By linearity, E(X) = 365 (1 − (364/365) ) . Now let Y be the arriving first, thus the probability is 1/ = 1/10
1. X ∼ Gamma(a, λ), Y ∼ Gamma(b, λ), 3
X
X ⊥
⊥ Y −→ X+Y ∼ Beta(a, b) number of birthday matches and let Ji be the indicator that the ith
pair of people have the same birthday. The probability that any two Expectation of Negative Hypergeometric
2. Bin(n, p) → Pois(λ) as n → ∞, p → 0, np = λ. n What is the expected number of cards that you draw before you pick
people share a birthday is 1/365 so E(Y ) = /365 . your first Ace in a shuffled deck? Answer - Consider a non-Ace.
3. U(j) ∼ Beta(j, n − j + 1) 2
Denote this to be card j. Let Ij be the indicator that card j will be
4. For any X with CDF F (x), F (X) ∼ U drawn before the first Ace. Note that if j is before all 4 of the Aces in
Coupon Collector the deck, then Ij = 1. The probability that this occurs is 1/5, because
There are n total coupons, and each draw, you get a random coupon. out of 5 cards (the 4 Aces and the not Ace), the probability that the
Formulas What is the expected number of coupons needed until you have a not Ace comes first is 1/5. 1/5 here is the probability that any specific
complete set? Answer - Let N be the number of coupons needed; we non-Ace will appear before all of the Aces in the deck. (e.g. the
want E(N ). Let N = N1 + · · · + Nn , N1 is the draws to draw our first probability that the Jack of Spades appears before all of the Aces).
In general, remember that PDFs integrated (and PMFs summed) over
distinct coupon, N2 is the additional draws needed to draw our second Thus let X be the number of cards that is drawn before the first Ace.
support equal 1.
distinct coupon and so on. By the story of First Success, Then X = I1 + I2 + ... + I48 , where each indicator correspond to one
N2 ∼ F S((n − 1)/n) (after collecting first toy type, there’s (n − 1)/n of the 48 not Aces. Thus,
Geometric Series chance you’ll get something new). Similarly, N3 ∼ F S((n − 2)/n), and
n−1
E(X) = E(I1 ) + E(I2 ) + ... + E(I48 ) = 48/5 = 9.6
2 n−1
X k 1 − rn Nj ∼ F S((n − j + 1)/n). By linearity,
a + ar + ar + · · · + ar = ar = a .
k=0
1−r
n
n n n X1 Minimum and Maximum of Random Variables
x E(N ) = E(N1 ) + · · · + E(Nn ) = + + ··· + = n
Exponential Function (e ) n n−1 1 j=1
j What is the CDF of the maximum of n independent
Uniformly-distributed random variables? Answer - Note that
∞
xn x2 x3 x n
x
X
e = =1+x+ + + · · · = lim 1+ P (min(X1 , X2 , . . . , Xn ) ≥ a) = P (X1 ≥ a, X2 ≥ a, . . . , Xn ≥ a)
n! 2! 3! n→∞ n Which is approximately n log(n) by Euler’s approximation for
n=1
harmonic sums. Similarily,
Gamma and Beta Distributions P (max(X1 , X2 , . . . , Xn ) ≤ a) = P (X1 ≤ a, X2 ≤ a, . . . , Xn ≤ a)
You can often solve integrals with the following Example Problems We will use that principal to find the CDF of U(n) , where
U(n) = max(U1 , U2 , . . . , Un ) where Ui ∼ Unif(0, 1) (iid).
Z ∞ Z 1 Γ(a)Γ(b)
t−1 −x a−1 b−1 P (max(U1 , U2 , . . . , Un ) ≤ a) = P (U1 ≤ a, U2 ≤ a, . . . , Un ≤ a)
x e dx = Γ(t) x (1 − x) dx = Contributions from Sebastian Chiu
0 0 Γ(a + b)
= P (U1 ≤ a)P (U2 ≤ a) . . . P (Un ≤ a)
Where Γ(n) = (n − 1)! if n is a positive integer First Step Conditioning n
= a
In every time period, Bobo the amoeba can die, live, or split into two
Bayes’ Billiards (special case of Beta) amoebas with probabilities 0.25, 0.25, and 0.5, respectively. All of Pattern Matching withex Taylor Series
Bobo’s offspring have the same probabilities. Find P (D), the 1
Z 1 1
k n−k probability that Bobo’s lineage eventually dies out. Answer - We use For X ∼ Pois(λ), find E . Answer - By LOTUS,
x (1 − x) dx = n X+1
0 (n + 1) law of probability, and define the events B0 , B1 . and B2 where Bi
k
means that Bobo has split into i amoebas. We note that P (D|B0 ) = 1 ∞ ∞
1 e−λ λk e−λ X λk+1 e−λ λ
since his lineage has died, P (D|B1 ) = P (D), and P (D|B2 ) = P (D)2 1 X
Euler’s Approximation for Harmonic Sums since both lines of his lineage must die out in order for Bobo’s lineage
E
X+1
=
k+1 k!
=
λ k=0 (k + 1)!
=
λ
(e − 1)
k=0
1 1 1 to die out.
1+ + + ··· + ≈ log n + 0.57721 . . . Adam and Eve’s Laws
2 3 n
P (D) = 0.25P (D|B0 ) + 0.25P (D|B1 ) + 0.5P (D|B2 ) William really likes speedsolving Rubik’s Cubes. But he’s pretty bad
Stirling’s Approximation 2 at it, so sometimes he fails. On any given day, William will attempt
= 0.25 + 0.25P (D) + 0.5P (D)
√
n
n N ∼ Geom(s) Rubik’s Cubes. Suppose each time, he has a
n! ∼ 2πn independent probability p of solving the cube. Let T be the number of
e Solving the quadratic equation, we get that P (D) = 0.5 or 1. We
Rubik’s Cubes he solves during a day. Find the mean and variance of
dismiss 1 as an extraneous solution since the expected number of
T . Answer - Note that T |N ∼ Bin(N, p). As a result, we have by
Miscellaneous Definitions Bobos increase every generation. Thus our answer is P (D) = 0.5 Adam’s Law that
p(1 − s)
Medians A continuous random variable X has median m if Calculating Probability E(T ) = E(E(T |N )) = E(N p) =
P (X ≤ m) = 50% s
A discrete random variable X has median m if A textbook has n typos, which are randomly scattered amongst its n
Similarly, by Eve’s Law, we have that
P (X ≤ m) ≥ 50% and P (X ≥ m) ≥ 50% pages. You pick a random page, what is the probability that it has no
1 Var(T ) = E(Var(T |N )) + Var(E(T |N )) = E(N p(1 − p)) + Var(N p)
typos? Answer - There is a 1 − n probability that any specific
Log Statisticians generally use log to refer to ln typo isn’t on your page, and thus a 1 − n1 n
probability that there
are no typos on your page. For n large, this is approximately p(1 − p)(1 − s) p2 (1 − s) p(1 − s)(p + s(1 − p))
i.i.d random variables Independent, identically-distributed random = + =
variables. e −1 x
= 1/e by a definition of e . s s2 s2
MGF - Distribution Matching Markov Chains, continued 7. Calculating Covariance If it’s a count of something, break it
(Referring to the Rubik’s Cube question above) Find the MGF of T . William and Sebastian play a modified game of Settlers of Catan, up into a sum of indicator random variables. If you’re trying to
What is the name of this distribution and its parameter(s)? Answer - where every turn they randomly move the robber (which will start on calculate the covariance between two components of a
By Adam’s Law, we have that the center tile) on a game board to one of the adjacent hexagons. multinomial distribution, Xi , Xj , then the covariance is
(refer to a picture of the game board if confused) −npi pj .
∞
tT tT t N
X t n n 8. If X and Y are i.i.d., have you considered using symmetry?
E(e ) = E(E(e |N )) = E((pe + q) ) = s (pe + 1 − p) (1 − s) a) Is this Markov Chain irreducible? Is it aperiodic? Answer - 9. Calculating Probabilities of Orderings of Random
n=0 Variables Have you considered looking at order statistics? -
Yes to both The Markov Chain is irreducible because it can get
s s Remember any ordering of i.i.d. random variables is equally
= = from anywhere to anywhere else. The Markov Chain is also
1 − (1 − s)(pet + 1 − p) s + (1 − s)p − (1 − s)pet aperiodic because the robber can return back to a square in likely.
10. Is this the birthday problem? Is this a multinomial problem?
Intuitively, we would expect that T is distributed Geometrically 2, 3, 4, 5, . . . moves. Those numbers have a GCD of 1, so the chain 11. Determining Independence Use the definition of
because T is just a filtered version of N , which itself is Geometrically is aperiodic. independence. Think of extreme cases to see if you can find a
distributed. The MGF of a Geometric random variable X ∼ Geom(θ) b) What is the stationary distribution of this Markov Chain? Answer counterexample.
is - Since this is a random walk on an undirected graph, the 12. Does something look like Simpson’s Paradox? make sure you’re
tX θ stationary distribution is proportional to the degree sequence. The looking at 3 events.
E(e ) =
1 − (1 − θ)et degree for the corner pieces is 3, the degree for the edge pieces is 4, 13. Find the PDF. If the question gives you two r.v., where you
So, we would want to try to get our MGF into this form to identify and the degree for the center pieces is 6. To normalize this degree know the PDF of one r.v. and the other r.v. is a function of the
what θ is. Taking our original MGF, it would appear that dividing by sequence, we divide by its sum. The sum of the degrees is first one, then the problem wants you to use a transformation
s + (1 − s)p would allow us to do this. Therefore, we have that 6(3) + 6(4) + 7(6) = 72. Thus the stationary probability of being of variables (Jacobian). You can also find the pdf by
on a corner is 3/84 = 1/28, on an edge is 4/84 = 1/21, and in the differentiating the CDF.
s center is 6/84 = 1/14. 14. Do a painful integral. If your integral looks painful, see if
s s+(1−s)p
E(etT ) = = (1−s)p c) What fraction of the time will the robber be in the desert in this
you can write your integral in terms of a PDF (like Gamma or
s + (1 − s)p − (1 − s)pet 1 − s+(1−s)p et Beta), so that the integral equals 1.
game? Answer - From above, 1/14 . 15. Before moving on. Plug in some simple and extreme cases to
make sure that your answer makes sense.
By pattern-matching, it thus follows that T ∼ Geom(θ) where d) Say the robber starts on the desert. What is the expected amount
of moves it will take for the robber to return? Answer - Since Biohazards
s this chain is irreducible and aperiodic, to get the expected time to
θ= return we can just invert the stationary probability. Thus on Section author: Jessy Hwang
s + (1 − s)p
average it will take 14 turns for the robber to return to the desert. 1. Don’t misuse the native definition of probability - When
MGF - Finding Momemts answering “What is the probability that in a group of 3 people,
Find E(X 3 ) for X ∼ Expo(λ) using the MGF of X. Answer - The
Problem Solving Strategies no two have the same birth month?”, it is not correct to treat
λ the people as indistinguishable balls being placed into 12 boxes,
MGF of an Expo(λ) is M (t) = λ−t . To get the third moment, we can Contributions from Jessy Hwang, Yuan Jiang, Yuqi Hou since that assumes the list of birth months { January, January,
take the third derivative of the MGF and evaluate at t = 0: January} is just as likely as the list { January, April, June},
1. Getting Started. Start by defining events and/or defining
6 random variables. (”Let A be the event that I pick the fair when the latter is fix times more likely.
3 2. Don’t confuse unconditional and conditional
E(X ) = coin”; “Let X be the number of successes.”) Clear notion =
λ3 probabilities, or go in circles with Baye’s Rule -
clear thinking! Then decide what it is that you’re supposed to P (B|A)P (A)
But a much nicer way to use the MGF here is via pattern recognition: be finding, in terms of your location (“I want to find P (A|B) = P (B)
. It is not correct to say “P (B) = 1
note that M (t) looks like it came from a geometric series: P (X = 3|A)”). Try simple and extreme cases. To make an because we know that B happened.”; P(B) is the probability
abstract experiment more concrete, try drawing a picture or before we have information about whether B happened. It is
∞ n ∞
1 X t X n! tn making up numbers that could have happened. Pattern not correct to use P (A|B) in place of P (A) on the right-hand
= =
1− λ t
λ λn n! recognition: does the structure of the problem resemble side.
n=0 n=0
something we’ve seen before. 3. Don’t assume independence without justification - In the
n 2. Calculating Probability of an Event. Use combinatorics if matching problem, the probability that card 1 is a match and
The coefficient of tn! here is the nth moment of X, so we have
the naive definition of probability applies. Look for symmetries card 2 is a match is not 1/n2 . - The Binomial and
E(X n ) = λn!
n for all nonnegative integers n. So again we get the same or something to condition on, then apply Bayes’ rule or LoTP. Hypergeometric are often confused; the trials are independent
answer. Is the probability of the complement easier to find? in the Binomial story and not independent in the
3. Finding the distribution of a random variable. Check the Hypergeometric story due to the lack of replacement.
Markov Chains support of the random variable: what values can it take on? 4. Don’t confuse random variables, numbers, and events. -
Suppose Xn is a two-state Markov chain with transition matrix Use this to rule out distributions that don’t fit. - Is there a Let X be a r.v. Then f (X) is a r.b. for any function f . In
0 1 story for one of the named distributions that fits the problem particular, X 2 , |X|, F (X), and IX>3 are r.v.s.
at hand? - Can you write the random variable as a function of P (X 2 < X|X ≥ 0), E(X), Var(X), and f (E(X)) are numbers.
0 1−α α a r.v. with a known distribution, say Y = g(X)? Then work
Q= X = 2Rand F (X) ≥ −1 are events. It does not make sense to
1 β 1−β directly from the definition of PDF or PMF, expressing ∞
write −∞ F (X)dx because F (X) is a random variable. It does
Find the stationary distribution ~
s = (s0 , s1 ) of Xn by solving ~
sQ = ~
s, P (Y ≤ y) or P (Y = y) in terms of events involving X only. - not make sense to write P (X) because X is not an event.
and show that the chain is reversible under this stationary For PDFs, find the CDF first and then differentiate. - If you’re 5. A random variable is not the same thing as its
distribution. Answer - By solving ~ sQ = ~ s, we have that trying to find the joint distribution of two independent random distribution - To get the PDF of X 2 , you can’t just square the
variables, just multiple their marginal probabilities - Do you PDF of X. The right way is to use one variable transformations
s0 = s0 (1 − α) + s1 β and s1 = s0 (α) + s0 (1 − β) need the distribution? If the question only asks for the - To get the PDF of X + Y , you can’t just add the PDF of X
expected value of X, you might be able to find this without and the PDF of Y . The right way is to compute the
And by solving this system of linear equations it follows that
knowing the entire distirbution of X. See the next item. convolution.
4. Calculating Expectation. If it has a named distribution, 6. E(g(X)) does not equal g(E(X)) in general. - See the St.
β α
~
s= , check out the table of distributions. If its a function of a r.v. Petersburg paradox for an extreme example. - The right way to
α+β α+β with a named distribution, try LotUS. If its a count of find E(g(X)) is with LotUS.
something, try breaking it up into indicator random variables.
To show that this chain is reversible under this stationary distribution,
we must show si qij = sj qji for all i, j. This is done if we can show
If you can condition on something, consider using Adam’s law.
Also consider the variance formula.
Recommended Resources
s0 q01 = s1 q10 . Indeed, 5. Calculating Variance. Consider independence, named • Introduction to Probability (http://bit.ly/introprobability)
distributions, and LotUS. If it’s a count of something, break it • Stat 110 Online (http://stat110.net)
αβ • Stat 110 Quora Blog (https://stat110.quora.com/)
s0 q01 = = s1 q10 up into a sum of indicator random variables. If you can
α+β condition on something, consider using Eve’s Law. • Stat 110 Course Notes (mxawng.com/stuff/notes/stat110.pdf)
6. Calculating E(X 2 ) - Do you already know E(X) or Var(X)? • Quora Probability FAQ (http://bit.ly/probabilityfaq)
thus our chain is reversible under the stationary distribution. • LaTeX File (github.com/wzchen/probability cheatsheet)
Remember that Var(X) = E(X 2 ) − E(X)2 .
Distributions
Distribution PDF and Support EV Variance MGF
Bernoulli P (X = 1) = p
Bern(p) P (X = 0) = q p pq q + pet
P (X = k) = n
k
Binomial k
p (1 − p)n−k
Bin(n, p) k ∈ {0, 1, 2, . . . n} np npq (q + pet )n
Geometric P (X = k) = q k p
p
Geom(p) k ∈ {0, 1, 2, . . . } q/p q/p2 1−qet
, qet <1
P (X = n) = r+n−1
r n
Negative Binom. r−1
p q
p
NBin(r, p) n ∈ {0, 1, 2, . . . } rq/p rq/p2 ( 1−qe r t
t ) , qe < 1
w+b
P (X = k) = w b /
Hypergeometric k n−k n
nw w+b−n µ µ
HGeom(w, b, n) k ∈ {0, 1, 2, . . . , n} µ= b+w
n (1
w+b−1 n
− n
) −
−λ k
e λ
Poisson P (X = k) = k!
t
Pois(λ) k ∈ {0, 1, 2, . . . } λ λ eλ(e −1)
1
Uniform f (x) = b−a
a+b (b−a)2 etb −eta
Unif(a, b) x ∈ (a, b) 2 12 t(b−a)
2 2
f (x) = √1 e−(x − µ) /(2σ )
Normal σ 2π
σ 2 t2
N (µ, σ 2 ) x ∈ (−∞, ∞) µ σ2 etµ+ 2
Inequalities
Cauchy-Schwarz Markov Chebychev Jensen
2
σX
p E|X|
|E(XY )| ≤ E(X 2 )E(Y 2 ) P (X ≥ a) ≤ P (|X − µX | ≥ a) ≤ g convex: E(g(X)) ≥ g(E(X))
a a2
g concave: E(g(X)) ≤ g(E(X))