






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Guide to David Draper’s Stats 131 Course at UCSC
Last Updated January 14, 2021 by Burleigh Charlton Generated from Joe Blitzstein’s probability template
cake
waffl e
S
V
C
S
V
C S
V
C
cake waffle cake waffle cake waffle
Let’s say we have a compound experiment (an experiment with multiple components). If the 1st component has n 1 possible outcomes, the 2nd component has n 2 possible outcomes,... , and the rth component has nr possible outcomes, then overall there are n 1 n 2... nr possibilities for the whole experiment.
7
6
5
8
4
2
9 3
1
The sampling table gives the number of possible samples of size k out of a population of size n, under various assumptions about how the sample is collected.
Order Matters Not Matter
With Replacement nk^
(n + k − 1
k
Without Replacement
n! (n − k)!
(n
k
If all outcomes are equally likely, the probability of an event A happening is:
Pnaive(A) =
number of outcomes favorable to A number of outcomes
Independent Events A and B are independent if knowing whether A occurred gives no information about whether B
occurred. More formally, A and B (which have nonzero probability) are independent if and only if one of the following equivalent statements holds: P (A ∩ B) = P (A)P (B) P (A|B) = P (A) P (B|A) = P (B)
Conditional Independence A and B are conditionally independent given C if P (A ∩ B|C) = P (A|C)P (B|C). Conditional independence does not imply independence, and independence does not imply conditional independence.
De Morgan’s Laws A useful identity that can make calculating probabilities of unions easier by relating them to intersections, and vice versa. Analogous results hold with more than two sets. (A ∪ B)c^ = Ac^ ∩ Bc (A ∩ B)c^ = Ac^ ∪ Bc
Joint Probability P (A ∩ B) or P (A, B) – Probability of A and B. Marginal (Unconditional) Probability P (A) – Probability of A. Conditional Probability P (A|B) = P (A, B)/P (B) – Probability of A, given that B occurred. Conditional Probability is Probability P (A|B) is a probability function for any fixed B. Any theorem that holds for probability also holds for conditional probability.
Intersections via Conditioning P (A, B) = P (A)P (B|A) P (A, B, C) = P (A)P (B|A)P (C|A, B) Unions via Inclusion-Exclusion P (A ∪ B) = P (A) + P (B) − P (A ∩ B) P (A ∪ B ∪ C) = P (A) + P (B) + P (C) − P (A ∩ B) − P (A ∩ C) − P (B ∩ C)
Dr. Hibbert Dr. Nick
heart
band-aid
It is possible to have P (A | B, C) < P (A | Bc, C) and P (A | B, Cc) < P (A | Bc, Cc) yet also P (A | B) > P (A | Bc).
Let B 1 , B 2 , B 3 , ...Bn be a partition of the sample space (i.e., they are disjoint and their union is the entire sample space).
P (A) = P (A|B 1 )P (B 1 ) + P (A|B 2 )P (B 2 ) + · · · + P (A|Bn)P (Bn) P (A) = P (A ∩ B 1 ) + P (A ∩ B 2 ) + · · · + P (A ∩ Bn)
For LOTP with extra conditioning, just add in another event B!
P (A|B) = P (A|B 1 , B)P (B 1 |B) + · · · + P (A|Bn, B)P (Bn|B) P (A|B) = P (A ∩ B 1 |B) + P (A ∩ B 2 |B) + · · · + P (A ∩ Bn|B)
Special case of LOTP with B and Bc^ as partition:
P (A) = P (A|B)P (B) + P (A|Bc)P (Bc) P (A) = P (A ∩ B) + P (A ∩ Bc)
B is often considered as the whole of the background knowledge, represented as B = B 1 , B 2 , B 3 , ..., Bn
Bayes’ Rule, and with extra conditioning (just add in B)
We can also write
Odds Form of Bayes’ Rule
P (Ac|B)
P (B|Ac)
P (Ac)
The posterior odds of A are the likelihood ratio times the prior odds.
Probability Mass Function (PMF) Gives the probability that a discrete random variable takes on the value x.
pX (x) = P (X = x)
0 1 2 3 4
x
pmf
l
l
l l
l
The PMF satisfies
pX (x) ≥ 0 and
x
pX (x) = 1
Cumulative Distribution Function (CDF) Gives the probability that a random variable is less than or equal to x.
FX (x) = P (X ≤ x)
0 1 2 3 4
x
cdf
l
l l
l l
l l
l l
l
The CDF is an non-decreasing, right-continuous function with
FX (x) → 0 as x → −∞ and FX (x) → 1 as x → ∞
Independence Intuitively, two random variables are independent if knowing the value of one gives no information about the other. Discrete r.v.s X and Y are independent if for all values of x and y
P (X = x, Y = y) = P (X = x)P (Y = y)
Expected Value (a.k.a. mean, expectation, or average) is a weighted average of the possible outcomes of our random variable. Mathematically, if x 1 , x 2 , x 3 ,... are all of the distinct possible values that X can take, the expected value of X is
E(X) =
i
xiP (X = xi)
X 3 2 6 10 1 1 5 4 ...
Y 4 2 8 23
X + Y 7 4 14 33
∑ xi + ∑ yi = ∑ ( xi + yi )
E ( X ) + E ( Y ) = E ( X + Y )
i= 1
n i= 1
n i= 1
n n^1 n^1 n^1
Linearity For any r.v.s X and Y , and constants a, b, c,
E(aX + bY + c) = aE(X) + bE(Y ) + c
Same distribution implies same mean If X and Y have the same distribution, then E(X) = E(Y ) and, more generally,
E(g(X)) = E(g(Y ))
Conditional Expected Value is defined like expectation, only conditioned on any event A.
E(X|A) =
x
xP (X = x|A)
Indicator Random Variable is a random variable that takes on the value 1 or 0. It is always an indicator of some event: if the event occurs, the indicator is 1; otherwise it is 0. They are useful for many problems about counting how many events of some kind occur. Write
IA =
1 if A occurs, 0 if A does not occur.
Note that I^2 A = IA, IAIB = IA∩B , and IA∪B = IA + IB − IAIB.
Distribution IA ∼ Bern(p) where p = P (A).
Fundamental Bridge The expectation of the indicator for event A is the probability of event A: E(IA) = P (A).
Var(X) = E (X − E(X))^2 = E(X^2 ) − (E(X))^2
SD(X) =
Var(X)
What’s the probability that a CRV is in an interval? Take the difference in CDF values (or use the PDF as described later). P (a ≤ X ≤ b) = P (X ≤ b) − P (X ≤ a) = FX (b) − FX (a)
For X ∼ N (μ, σ^2 ), this becomes
P (a ≤ X ≤ b) = Φ
b − μ σ
a − μ σ
What is the Probability Density Function (PDF)? The PDF f is the derivative of the CDF F. F ′(x) = f (x) A PDF is nonnegative and integrates to 1. By the fundamental theorem of calculus, to get from PDF back to CDF we can integrate:
F (x) =
∫ (^) x
−∞
f (t)dt
0.00−4 −2 0 2 4
x
0.0 −4 −2 0 2 4
0.^
x
CDF
To find the probability that a CRV takes on a value in an interval, integrate the PDF over that interval.
F (b) − F (a) =
∫ (^) b
a
f (x)dx
How do I find the expected value of a CRV? Analogous to the discrete case, where you sum x times the PMF, for CRVs you integrate x times the PDF.
E(X) =
−∞
xf (x)dx
Expected value of a function of an r.v. The expected value of X is defined this way:
E(X) =
x
xP (X = x) (for discrete X)
−∞
xf (x)dx (for continuous X)
The Law of the Unconscious Statistician (LOTUS) states that you can find the expected value of a function of a random variable, g(X), in a similar way, by replacing the x in front of the PMF/PDF by g(x) but still working with the PMF/PDF of X:
E(g(X)) =
x
g(x)P (X = x) (for discrete X)
E(g(X)) =
−∞
g(x)f (x)dx (for continuous X)
Covariance is the analog of variance for two random variables.
Cov(X, Y ) = E ((X − E(X))(Y − E(Y ))) = E(XY ) − E(X)E(Y )
Note that
Cov(X, X) = E(X^2 ) − (E(X))^2 = Var(X)
Correlation is a standardized version of covariance that is always between −1 and 1.
Corr(X, Y ) =
Cov(X, Y ) √ Var(X)Var(Y )
Covariance and Independence If two random variables are independent, then they are uncorrelated. The converse is not necessarily true (e.g., consider X ∼ N (0, 1) and Y = X^2 ).
X ⊥⊥ Y −→ Cov(X, Y ) = 0 −→ E(XY ) = E(X)E(Y )
Covariance and Variance The variance of a sum can be found by
Var(X + Y ) = Var(X) + Var(Y ) + 2Cov(X, Y )
Var(X 1 + X 2 + · · · + Xn) =
∑^ n
i=
Var(Xi) + 2
i<j
Cov(Xi, Xj )
If X and Y are independent then they have covariance 0, so
X ⊥⊥ Y =⇒ Var(X + Y ) = Var(X) + Var(Y )
If X 1 , X 2 ,... , Xn are identically distributed and have the same covariance relationships (often by symmetry), then
Var(X 1 + X 2 + · · · + Xn) = nVar(X 1 ) + 2
(n
2
Cov(X 1 , X 2 )
Covariance Properties For random variables W, X, Y, Z and constants a, b:
Cov(X, Y ) = Cov(Y, X) Cov(X + a, Y + b) = Cov(X, Y ) Cov(aX, bY ) = abCov(X, Y ) Cov(W + X, Y + Z) = Cov(W, Y ) + Cov(W, Z) + Cov(X, Y )
Correlation is location-invariant and scale-invariant For any constants a, b, c, d with a and c nonzero,
Corr(aX + b, cY + d) = Corr(X, Y )
One Variable Transformations Let’s say that we have a random variable X with PDF fX (x), but we are also interested in some function of X. We call this function Y = g(X). Also let y = g(x). If g is differentiable and strictly increasing (or strictly decreasing), then the PDF of Y is
fY (y) = fX (x)
∣∣^ dx dy
∣∣ = fX (g−^1 (y))
∣∣^ d dy
g−^1 (y)
The derivative of the inverse transformation is called the Jacobian.
Two Variable Transformations Similarly, let’s say we know the joint PDF of U and V but are also interested in the random vector (X, Y ) defined by (X, Y ) = g(U, V ). Let
∂(u, v) ∂(x, y)
( (^) ∂u ∂x
∂u ∂y ∂v ∂x
∂v ∂y
be the Jacobian matrix. If the entries in this matrix exist and are continuous, and the determinant of the matrix is never 0, then
fX,Y (x, y) = fU,V (u, v)
∂(u, v) ∂(x, y)
The inner bars tells us to take the matrix’s determinant, and the outer bars tell us to take the absolute value. In a 2 × 2 matrix, ∣ ∣ ∣ ∣
a b c d
∣ =^ |ad^ −^ bc|
Convolution Integral If you want to find the PDF of the sum of two independent CRVs X and Y , you can do the following integral:
fX+Y (t) =
−∞
fX (x)fY (t − x)dx
Example Let X, Y ∼ N (0, 1) be i.i.d. Then for each fixed t,
fX+Y (t) =
−∞
2 π
e−x
2 π
e−(t−x)
(^2) / 2 dx
By completing the square and using the fact that a Normal PDF integrates to 1, this works out to fX+Y (t) being the N (0, 2) PDF.
Definition We have a Poisson process of rate λ arrivals per unit time if the following conditions hold:
For example, the numbers of arrivals in the time intervals [0, 5], (5, 12), and [13, 23) are independent with Pois(5λ), Pois(7λ), Pois(10λ) distributions, respectively.
0 T 1 T 2 T 3 T 4 T 5
**+ +
Count-Time Duality Consider a Poisson process of emails arriving in an inbox at rate λ emails per hour. Let Tn be the time of arrival of the nth email (relative to some starting time 0) and Nt be the number of emails that arrive in [0, t]. Let’s find the distribution of T 1. The event T 1 > t, the event that you have to wait more than t hours to get the first email, is the same as the event Nt = 0, which is the event that there are no emails in the first t hours. So
P (T 1 > t) = P (Nt = 0) = e−λt^ −→ P (T 1 ≤ t) = 1 − e−λt Thus we have T 1 ∼ Expo(λ). By the memoryless property and similar reasoning, the interarrival times between emails are i.i.d. Expo(λ), i.e., the differences Tn − Tn− 1 are i.i.d. Expo(λ).
Definition Let’s say you have n i.i.d. r.v.s X 1 , X 2 ,... , Xn. If you arrange them from smallest to largest, the ith element in that list is the ith order statistic, denoted X(i). So X(1) is the smallest in the list and X(n) is the largest in the list.
Note that the order statistics are dependent, e.g., learning X(4) = 42 gives us the information that X(1), X(2), X(3) are ≤ 42 and X(5), X(6),... , X(n) are ≥ 42.
Distribution Taking n i.i.d. random variables X 1 , X 2 ,... , Xn with CDF F (x) and PDF f (x), the CDF and PDF of X(i) are:
FX(i) (x) = P (X(i) ≤ x) =
∑^ n
k=i
(n
k
F (x)k^ (1 − F (x))n−k
fX(i) (x) = n
(n − 1
i − 1
F (x)i−^1 (1 − F (x))n−if (x)
Uniform Order Statistics The jth order statistic of i.i.d. U 1 ,... , Un ∼ Unif(0, 1) is U(j) ∼ Beta(j, n − j + 1).
Conditioning on an Event We can find E(Y |A), the expected value of Y given that event A occurred. A very important case is when A is the event X = x. Note that E(Y |A) is a number. For example:
The expected value of a fair die roll, given that it is prime, is 1 3 ·^ 2 +^
1 3 ·^ 3 +^
1 3 ·^ 5 =^
10
Let Y be the number of successes in 10 independent Bernoulli trials with probability p of success. Let A be the event that the first 3 trials are all successes. Then
E(Y |A) = 3 + 7p
since the number of successes among the last 7 trials is Bin(7, p).
Let T ∼ Expo(1/10) be how long you have to wait until the shuttle comes. Given that you have already waited t minutes, the expected additional waiting time is 10 more minutes, by the memoryless property. That is, E(T |T > t) = t + 10.
Discrete Y Continuous Y
E(Y ) =
∑ y yP^ (Y^ =^ y)^ E(Y^ ) =^
∫ (^) ∞ −∞ yfY^ (y)dy E(Y |A) =
∑ y yP^ (Y^ =^ y|A)^ E(Y^ |A) =^
∫ (^) ∞ −∞ yf^ (y|A)dy
Conditioning on a Random Variable We can also find E(Y |X), the expected value of Y given the random variable X. This is a function of the random variable X. It is not a number except in certain special cases such as if X ⊥⊥ Y. To find E(Y |X), find E(Y |X = x) and then plug in X for x. For example:
If E(Y |X = x) = x^3 + 5x, then E(Y |X) = X^3 + 5X. Let Y be the number of successes in 10 independent Bernoulli trials with probability p of success and X be the number of successes among the first 3 trials. Then E(Y |X) = X + 7p. Let X ∼ N (0, 1) and Y = X^2. Then E(Y |X = x) = x^2 since if we know X = x then we know Y = x^2. And E(X|Y = y) = 0 since if we know Y = y then we know X = ±
y, with equal probabilities (by symmetry). So E(Y |X) = X^2 , E(X|Y ) = 0.
Properties of Conditional Expectation
Adam’s Law (a.k.a. Law of Total Expectation) can also be written in a way that looks analogous to LOTP. For any events A 1 , A 2 ,... , An that partition the sample space,
E(Y ) = E(Y |A 1 )P (A 1 ) + · · · + E(Y |An)P (An)
For the special case where the partition is A, Ac, this says
E(Y ) = E(Y |A)P (A) + E(Y |Ac)P (Ac)
Eve’s Law (a.k.a. Law of Total Variance)
Var(Y ) = E(Var(Y |X)) + Var(E(Y |X))
Let X 1 , X 2 , X 3... be i.i.d. with mean μ. The sample mean is
X¯n = X^1 +^ X^2 +^ X^3 +^ · · ·^ +^ Xn n
The Law of Large Numbers states that as n → ∞, X¯n → μ with probability 1. For example, in flips of a coin with probability p of Heads, let Xj be the indicator of the jth flip being Heads. Then LLN says the proportion of Heads converges to p (with probability 1).
We use ∼˙ to denote is approximately distributed. We can use the Central Limit Theorem to approximate the distribution of a random variable Y = X 1 + X 2 + · · · + Xn that is a sum of n i.i.d. random variables Xi. Let E(Y ) = μY and Var(Y ) = σ^2 Y. The CLT says Y ∼ N˙ (μY , σ Y^2 )
If the Xi are i.i.d. with mean μX and variance σ^2 X , then μY = nμX and σ Y^2 = nσ^2 X. For the sample mean X¯n, the CLT says
X¯n =^1 n
(X 1 + X 2 + · · · + Xn) ˙∼ N (μX , σ^2 X /n)
We use −D→ to denote converges in distribution to as n → ∞. The CLT says that if we standardize the sum X 1 + · · · + Xn then the distribution of the sum converges to N (0, 1) as n → ∞:
1 σ
n
(X 1 + · · · + Xn − nμX ) −D→ N (0, 1)
In other words, the CDF of the left-hand side goes to the standard Normal CDF, Φ. In terms of the sample mean, the CLT says √ n( X¯n − μX ) σX
(^1) 1/2^1 2 1/2 1/4 3
5/ 1/3 1/6 4
7/ 1/4 1/8 5
7/
A Markov chain is a random walk in a state space, which we will assume is finite, say { 1 , 2 ,... , M }. We let Xt denote which element of the state space the walk is visiting at time t. The Markov chain is the sequence of random variables tracking where the walk is at all points in time, X 0 , X 1 , X 2 ,.... By definition, a Markov chain must satisfy the Markov property, which says that if you want to predict where the chain will be at a future time, if we know the present state then the entire past history is irrelevant. Given the present, the past and future are conditionally independent. Symbolically,
P (Xn+1 = j|X 0 = i 0 , X 1 = i 1 ,... , Xn = i) = P (Xn+1 = j|Xn = i)
A state is either recurrent or transient. If you start at a recurrent state, then you will always return back to that state at some point in the future. nYou can check-out any time you like, but you can never leave. n
Otherwise you are at a transient state. There is some positive probability that once you leave you will never return. nYou don’t have to go home, but you can’t stay here. n A state is either periodic or aperiodic. If you start at a periodic state of period k, then the GCD of the possible numbers of steps it would take to return back is k > 1.
Otherwise you are at an aperiodic state. The GCD of the possible numbers of steps it would take to return back is 1.
Let the state space be { 1 , 2 ,... , M }. The transition matrix Q is the M × M matrix where element qij is the probability that the chain goes from state i to state j in one step:
qij = P (Xn+1 = j|Xn = i)
To find the probability that the chain goes from state i to state j in exactly m steps, take the (i, j) element of Qm.
q
(m) ij =^ P^ (Xn+m^ =^ j|Xn^ =^ i)
If X 0 is distributed according to the row vector PMF ~p, i.e., pj = P (X 0 = j), then the PMF of Xn is ~pQn.
A chain is irreducible if you can get from anywhere to anywhere. If a chain (on a finite state space) is irreducible, then all of its states are recurrent. A chain is periodic if any of its states are periodic, and is aperiodic if none of its states are periodic. In an irreducible chain, all states have the same period.
A chain is reversible with respect to ~s if siqij = sj qji for all i, j. Examples of reversible chains include any chain with qij = qji, with ~s = ( (^) M^1 , (^) M^1 ,... , (^) M^1 ), and random walk on an undirected network.
Let us say that the vector ~s = (s 1 , s 2 ,... , sM ) be a PMF (written as a row vector). We will call ~s the stationary distribution for the chain if ~sQ = ~s. As a consequence, if Xt has the stationary distribution, then all future Xt+1, Xt+2,... also have the stationary distribution. For irreducible, aperiodic chains, the stationary distribution exists, is unique, and si is the long-run probability of a chain being at state i. The expected number of steps to return to i starting from i is 1/si. To find the stationary distribution, you can solve the matrix equation (Q′^ − I)~s ′^ = 0. The stationary distribution is uniform if the columns of Q sum to 1. Reversibility Condition Implies Stationarity If you have a PMF ~s and a Markov chain with transition matrix Q, then siqij = sj qji for all states i, j implies that ~s is stationary.
4
3
1
2
5
If you have a collection of nodes, pairs of which can be connected by undirected edges, and a Markov chain is run by going from the current node to a uniformly random node that is connected to it by an edge, then this is a random walk on an undirected network. The stationary distribution of this chain is proportional to the degree sequence (this is the sequence of degrees, where the degree of a node is how many edges are attached to it). For example, the stationary distribution of random walk on the network shown above is proportional to (3, 3 , 2 , 4 , 2), so it’s ( 143 , 143 , 142 , 144 , 142 ).
Replace No Replace
Fixed # trials (n) Binomial HGeom (Bern if n = 1) Draw until r success NBin NHGeom (Geom if r = 1)
The Bernoulli distribution is the simplest case of the Binomial distribution, where we only have one trial (n = 1). Let us say that X is distributed Bern(p). We know the following:
Story A trial is performed with probability p of “success”, and X is the indicator of success: 1 means success, 0 means failure.
Example Let X be the indicator of Heads for a fair coin toss. Then X ∼ Bern( 12 ). Also, 1 − X ∼ Bern( 12 ) is the indicator of Tails.
0.00 0 2 4 6 8 10
x
pmf
l l
l
l
l
l l
l
l l (^) l 0 2 4 6 8 10
Bin(10,1/2)
Let us say that X is distributed Bin(n, p). We know the following:
Story X is the number of “successes” that we will achieve in n independent trials, where each trial is either a success or a failure, each with the same probability p of success. We can also write X as a sum of multiple independent Bern(p) random variables. Let X ∼ Bin(n, p) and Xj ∼ Bern(p), where all of the Bernoullis are independent. Then
X = X 1 + X 2 + X 3 + · · · + Xn
Example If Jeremy Lin makes 10 free throws and each one independently has a 34 chance of getting in, then the number of
free throws he makes is distributed Bin(10, 34 ).
Properties Let X ∼ Bin(n, p), Y ∼ Bin(m, p) with X ⊥⊥ Y.
Redefine success n − X ∼ Bin(n, 1 − p)
Sum X + Y ∼ Bin(n + m, p) Conditional X|(X + Y = r) ∼ HGeom(n, m, r)
Binomial-Poisson Relationship Bin(n, p) is approximately Pois(np) if p is small. Binomial-Normal Relationship Bin(n, p) is approximately N (np, np(1 − p)) if n is large and p is not near 0 or 1.
Let us say that X is distributed Geom(p). We know the following: Story X is the number of “failures” that we will achieve before we achieve our first success. Our successes have probability p.
Example If each pokeball we throw has probability 101 to catch Mew, the number of failed pokeballs will be distributed Geom( 101 ).
Equivalent to the Geometric distribution, except that it includes the first success in the count. This is 1 more than the number of failures. If X ∼ FS(p) then E(X) = 1/p.
Let us say that X is distributed NBin(r, p). We know the following: Story X is the number of “failures” that we will have before we achieve our rth success. Our successes have probability p. Example Thundershock has 60% accuracy and can faint a wild Raticate in 3 hits. The number of misses before Pikachu faints Raticate with Thundershock is distributed NBin(3, 0 .6).
Let us say that X is distributed HGeom(w, b, n). We know the following: Story In a population of w desired objects and b undesired objects, X is the number of “successes” we will have in a draw of n objects, without replacement. The draw of n objects is assumed to be a simple random sample (all sets of n objects are equally likely).
Examples Here are some HGeom examples.
Let’s say that we have only b Weedles (failure) and w Pikachus (success) in Viridian Forest. We encounter n Pokemon in the forest, and X is the number of Pikachus in our encounters.
The number of Aces in a 5 card hand.
You have w white balls and b black balls, and you draw n balls. You will draw X white balls.
You have w white balls and b black balls, and you draw n balls without replacement. The number of white balls in your sample is HGeom(w, b, n); the number of black balls is HGeom(b, w, n).
Capture-recapture A forest has N elk, you capture n of them, tag them, and release them. Then you recapture a new sample of size m. How many tagged elk are now in the new sample? HGeom(n, N − n, m)
Let us say that X is distributed Pois(λ). We know the following: Story There are rare events (low probability events) that occur many different ways (high possibilities of occurences) at an average rate of λ occurrences per unit space or time. The number of events that occur in that unit of space or time is X.
Example A certain busy intersection has an average of 2 accidents per month. Since an accident is a low probability event that can happen many different ways, it is reasonable to model the number of accidents in a month at that intersection as Pois(2). Then the number of accidents that happen in two months at that intersection is distributed Pois(4). Properties Let X ∼ Pois(λ 1 ) and Y ∼ Pois(λ 2 ), with X ⊥⊥ Y.
n, (^) λλ^1 1 +λ 2
Let us say that the vector X~ = (X 1 , X 2 , X 3 ,... , Xk ) ∼ Multk (n, ~p) where ~p = (p 1 , p 2 ,... , pk ). Story We have n items, which can fall into any one of the k buckets independently with the probabilities p~ = (p 1 , p 2 ,... , pk ). Example Let us assume that every year, 100 students in the Harry Potter Universe are randomly and independently sorted into one of four houses with equal probability. The number of people in each of the houses is distributed Mult 4 (100, ~p), where ~p = (0. 25 , 0. 25 , 0. 25 , 0 .25). Note that X 1 + X 2 + · · · + X 4 = 100, and they are dependent. Joint PMF For n = n 1 + n 2 + · · · + nk ,
P ( X~ = ~n) =
n! n 1 !n 2!... nk!
pn 1 1 pn 2 2... p
nk k
Marginal PMF, Lumping, and Conditionals Marginally, Xi ∼ Bin(n, pi) since we can define “success” to mean category i. If you lump together multiple categories in a Multinomial, then it is still Multinomial. For example, Xi + Xj ∼ Bin(n, pi + pj ) for i 6 = j since we can define “success” to mean being in category i or j. Similarly, if k = 6 and we lump categories 1-2 and lump categories 3-5, then
(X 1 + X 2 , X 3 + X 4 + X 5 , X 6 ) ∼ Mult 3 (n, (p 1 + p 2 , p 3 + p 4 + p 5 , p 6 ))
Conditioning on some Xj also still gives a Multinomial:
X 1 ,... , Xk− 1 |Xk = nk ∼ Multk− 1
n − nk ,
p 1 1 − pk
pk− 1 1 − pk
Variances and Covariances We have Xi ∼ Bin(n, pi) marginally, so Var(Xi) = npi(1 − pi). Also, Cov(Xi, Xj ) = −npipj for i 6 = j.
See the univariate Uniform for stories and examples. For the 2D Uniform on some region, probability is proportional to area. Every point in the support has equal density, of value (^) area of region^1. For the 3D Uniform, probability is proportional to volume.
A vector X~ = (X 1 , X 2 ,... , Xk ) is Multivariate Normal if every linear combination is Normally distributed, i.e., t 1 X 1 + t 2 X 2 + · · · + tk Xk is Normal for any constants t 1 , t 2 ,... , tk. The parameters of the Multivariate Normal are the mean vector ~μ = (μ 1 , μ 2 ,... , μk ) and the covariance matrix where the (i, j) entry is Cov(Xi, Xj ).
Properties The Multivariate Normal has the following properties.
Any subvector is also MVN.
If any two elements within an MVN are uncorrelated, then they are independent.
The joint PDF of a Bivariate Normal (X, Y ) with N (0, 1) marginal distributions and correlation ρ ∈ (− 1 , 1) is
fX,Y (x, y) =
2 πτ
exp
2 τ 2
(x^2 + y^2 − 2 ρxy)
with τ =
1 − ρ^2.
Standard Normal Φ
Exponential(λ) F (x) = 1 − e−λx, for x ∈ (0, ∞)
Uniform(0,1) F (x) = x, for x ∈ (0, 1)
A convolution of n random variables is simply their sum. For the following results, let X and Y be independent.
( (^) n 2 ,^
1 2
2 a^2 for E(X) = μ, Var(X) = σ^2
1 + r + r^2 + · · · + rn−^1 =
n∑− 1
k=
rk^ =
1 − rn 1 − r
1 + r + r^2 + · · · =
1 − r
if |r| < 1
ex^ =
n=
xn n!
= 1 + x +
x^2 2!
x^3 3!
x n
)n
You can sometimes solve complicated-looking integrals by pattern-matching to a gamma or beta integral: ∫ (^) ∞
0
xt−^1 e−x^ dx = Γ(t)
0
xa−^1 (1 − x)b−^1 dx =
Γ(a)Γ(b) Γ(a + b)
Also, Γ(a + 1) = aΓ(a), and Γ(n) = (n − 1)! if n is a positive integer.
n
≈ log n + 0. 577...
n! ≈
2 πn
( (^) n
e
)n
Medians and Quantiles Let X have CDF F. Then X has median m if F (m) ≥ 0 .5 and P (X ≥ m) ≥ 0 .5. For X continuous, m satisfies F (m) = 1/2. In general, the ath quantile of X is min{x : F (x) ≥ a}; the median is the case a = 1/2.
log Statisticians generally use log to refer to natural log (i.e., base e).
i.i.d r.v.s Independent, identically-distributed random variables.
A textbook has n typos, which are randomly scattered amongst its n pages, independently. You pick a random page. What is the probability that it has no typos? Answer: There is a
1 − (^1) n
probability that any specific
typo isn’t on your page, and thus a
n
)n probability
that there are no typos on your page. For n large, this is approximately e−^1 = 1/e. A monkey is pecking at a typewriter, producing each character independently and uniformly at random from the 26 letters of the English alphabet. Is it more likely to type the word EARTH or HEART first? (“Word” here means “contiguous substring of its typing output”.) Answer: HEART I roll a standard six-sided die (uniform distribution over 1-6) until I get 6. What’s the expected number of rolls I made, conditioned on the event that all rolls were even numbers? How about the general case with a die of 2n sides. Answer: For a dice with 2n sides, the expectation is 2n/(n+1)
In a group of n people, what is the expected number of distinct birthdays (month and day)? What is the expected number of birthday matches? Answer: Let X be the number of distinct birthdays and Ij be the indicator for the jth day being represented.
E(Ij ) = 1 − P (no one born on day j) = 1 − (364/365)n
By linearity, E(X) = 365 (1 − (364/365)n). Now let Y be the number of birthday matches and Ji be the indicator that the ith pair of people have the same birthday. The probability that any two specific people share a birthday is 1/365, so
E(Y ) =
(n
2
This problem is commonly known as the hat-matching problem. There are n people at a party, each with hat. At the end of the party, they each leave with a random hat. What is the expected number of people who leave with the right hat? Answer: Each hat has a 1/n chance of going to the right person. By linearity, the average number of hats that go to their owners is n(1/n) = 1.
This problem is commonly known as the coupon collector problem. There are n coupon types. At each draw, you get a uniformly random coupon type. What is the expected number of coupons needed until you have a complete set? Answer: Let N be the number of coupons needed; we want E(N ). Let N = N 1 + · · · + Nn, where N 1 is the draws to get our
−∞ F^ (X)dx, because^ F^ (X) is a random variable. It does not make sense to write P (X), because X is not an event.
Command What it does help(distributions) shows documentation on distributions dbinom(k,n,p) PMF P (X = k) for X ∼ Bin(n, p) pbinom(x,n,p) CDF P (X ≤ x) for X ∼ Bin(n, p) qbinom(a,n,p) ath quantile for X ∼ Bin(n, p) rbinom(r,n,p) vector of r i.i.d. Bin(n, p) r.v.s dgeom(k,p) PMF P (X = k) for X ∼ Geom(p) dhyper(k,w,b,n) PMF P (X = k) for X ∼ HGeom(w, b, n) dnbinom(k,r,p) PMF P (X = k) for X ∼ NBin(r, p) dpois(k,r) PMF P (X = k) for X ∼ Pois(r) dbeta(x,a,b) PDF f (x) for X ∼ Beta(a, b) dchisq(x,n) PDF f (x) for X ∼ χ^2 n dexp(x,b) PDF f (x) for X ∼ Expo(b) dgamma(x,a,r) PDF f (x) for X ∼ Gamma(a, r) dlnorm(x,m,s) PDF f (x) for X ∼ LN (m, s^2 ) dnorm(x,m,s) PDF f (x) for X ∼ N (m, s^2 ) dt(x,n) PDF f (x) for X ∼ tn dunif(x,a,b) PDF f (x) for X ∼ Unif(a, b)
The table above gives R commands for working with various named distributions. Commands analogous to pbinom, qbinom, and rbinom work for the other distributions in the table. For example, pnorm, qnorm, and rnorm can be used to get the CDF, quantiles, and random generation for the Normal. For the Multinomial, dmultinom can be used for calculating the joint PMF and rmultinom can be used for generating random vectors. For the Multivariate Normal, after installing and loading the mvtnorm package dmvnorm can be used for calculating the joint PDF and rmvnorm can be used for generating random vectors.
Introduction to Probability Book (http://bit.ly/introprobability) Quora Probability FAQ (http://bit.ly/probabilityfaq)
R Studio (https://www.rstudio.com)
Real Analysis and Probability, Richard Dudley Probability, Albert Shiryaev
A Course in Probability Theory, Kai Lai Chung Probability Theory, S. R. S. Varadhan Stochastic Processes, S. R. S. Varadhan