Docsity

Probability & Statistics, Exams of Calculus

Partial preview of the text

Download Probability & Statistics and more Exams Calculus in PDF only on Docsity!

Probability & Statistics

Author: Jose 胡冠洲 @ ShanghaiTech & Staff of Harvard STAT-

Probability & Statistics Full-ver. Cheatsheet Harvard Stat-110 Cheatsheet Harvard Stat-110 Review Notes

Full-ver. Cheatsheet

See below (page 2-3).

Harvard Stat-110 Cheatsheet

See below (page 4-13).

Harvard Stat-110 Review Notes

See below (page 14-122).

.Bb .BbiX SJ6 1 o` S:6 J:

"2`MUpV P (X = 1) = p, P (X = 0) = q p pq pt + q pet^ + q

"BMUn, pV

( n x

) p x q n−x

  • x ∈ [0, n] np npq (pt + q) n (pe t + q) n

>:2QKUw, b, nV

( w x )(^

b n−x ) (w n+ b)

  • 0 ≤ k ≤ w, 0 ≤ n − k ≤ b nw w+b f f f

:2QKUpV q k p- x ≥ 0

q p

q p^2

p 1 −qt

p 1 −qet

6aUpV q k− 1 p- x ≥ 1

p

q p^2

pt 1 −qt

pet 1 −qet L"BMUr, pV

( n+r− 1 r− 1

) pr^ qn- n ≥ 0 r q p r q p^2 ( p 1 −qt )r^ ( p 1 −qet^ )r

SQBbUλV e−λλk k!

  • k ≥ 0 λ λ eλ(t−1)^ eλ(e

t−1)

*QMi .BbiX S.6 *.6 1 o` J:

lMB7Ua, bV

b−a -^ a < x < b^ · · ·^

x−a b−a -^ a < x < b^ · · ·^

a+b 2

(b−a)^2 12

etb−eta t(b−a)

N (0, 1)

√^1

2 π

e −z^2 / ∫ (^) z −∞

√^1

2 π

e −t^2 / dt y R e

t^2 2

N (μ, σ

)

σ

2 π

e −(z−μ)^2 /(2σ^2 ) ∫ (^) z −∞

σ

2 π

e −(t−μ)^2 /(2σ^2 ) dt μ σ

e μt+ 12 σ^2 t^2

1tTQUλV λe −λx

  • x > 0 1 − e −λx - x > 0

λ

λ^2

λ λ−t "2iUa, bV

β(a,b) xa−^1 (1 − x)b−^1 f a a+b f f

:KKUa, λV

Γ(a) (λy) a e −λy 1 y f a λ

a λ^2 f

"v2bǶ _mH2 Y /Bb Y +QMi

X /Bb

P (X=x|Y =y)P (Y =y) P (X=x)

P (X=x|Y =y)fY (y) P (X=x)

X +QMi

fX (x|Y =y)P (Y =y) fX (x)

fX|Y (x|y)fY (y) fX (x)

GPhS Y /Bb Y +QMi

X /Bb

∑ y P^ (X^ =^ x|Y^ =^ y)P^ (Y^ =^ y)^

∫ (^) ∞ −∞ P (X = x|Y = y)fY (y)dy

X +QMi

∑ y fX^ (x|Y^ =^ y)P^ (Y^ =^ y)^

∫ (^) ∞ −∞ fX|Y (x|y)fY (y)dy

*QmMiBM; P/2 LQ P/2

_2TH+2 n k

( n+k− 1 n− 1

)

LQ _2TH+2 n · · · (n − k + 1)

( n k

)

"Qb2@1Bbi2BM , x 1 + · · · + xr = n, xi > 0 -

( n− 1 r− 1

) FBM/bX

A/2MiBiB2b , n

(n− 1 k− 1

) = k

(n k

)

(m+n k

)

∑k j=

(m j

)( (^) n k−j

)

.2}MBiBQMb

Ç SJ6, P (X = x) @ LQMM2;iBp2c amKb iQ R

Ç DQBMi SJ6, P (X = x, Y = y) = P (X = x|Y = y)P (Y = y)

Ç K`;BMH SJ6, P (X = x) =

∑ y P^ (X^ =^ x, Y^ =^ y)

Ç S.6, fX (x) = F

X (x)^ @ LQMM2;iBp2c BMi2;`i2b iQ R

Ç DQBMi S.6, fX,Y (x, y) =

∂^2

∂x∂y FX,Y (x, y)

Ç K`;BMH S.6, fX (x) =

∫ (^) ∞ −∞ fX,Y^ (x, y)dy

Ç *.6, FX (x) = P (X ≤ x) @ LQM/2+`2bBM;c _B;?i@+QMiBMmQmbc HBKx→−∞ F (x) = 0- HBKx→∞ F (x) = 1

Ç DQBMi *.6, FX,Y (x, y) = P (X ≤ x, Y ≤ y)

Ç +X2X, E(Y |A) =

∑ yP (Y = y|A) f

∫ (^) ∞ −∞ yf^ (y|A)dy

Ç +X2X, E(Y |X) rBi? E(Y |X = x) = g(x)

Ç +XpX, V ar(Y |X) = E((Y − E(Y |X))^2 |X) = E(Y 2 |X) − (E(Y |X))^2

1tT2+iiBQM f J2M

Ç RX E(X) =

∑ x xP^ (X^ =^ x)

kX bm`pBpH, E(X) =

∫ (^0) −∞(G(x)^ −^ 1)dx^ +^

∫ (^) ∞ 0 G(x)dx

jX GPhla, E(g(X)) =

∑ x g(x)P^ (X^ =^ x)

9X BM/B+iQb, X = I 1 + I 2 + · · · + In UQ Qi?2TiBiBQMbV- i?2M

E(X) = p 1 + p 2 + · · · + pn

8X #v S:6 f J:6, E(X) = g

X (1)^ Q`^ E(X) =^ M^

X (0)

eX k.@G, E(g(X, Y )) =

∑ x

∑ y g(x, y)P^ (X^ =^ x, Y^ =^ y)

dX GPh1, E(X) =

∑n i= E(Y |Ai)P (Ai)

3X /KǶb Gr

Ç SQT2iB2b,

RX GBM2`Biv

kX JQMQiQMB+Biv, X ≥ Y rXTX R ⇒ E(X) ≥ E(Y )

o`BM+

Ç RX V ar(X) = E((X − E(X))

) = E(X

) − (E(X))

≥ 0

kX GPhla, E(X

) =

∑ x x

P (X = x)

jX BM/Bb, X = I 1 + I 2 + · · · + In- i?2M E(

( X 2

) ) =

∑ i:2QKUw, b, nV ⇔ >:2QKUn, w + b − n, wV

Ç Z ∼ N (0, 1) ⇒ φ(z) = φ(−z)

Ç Z ∼ N (0, 1) ⇒ Φ(z) = 1 − Φ(−z)

Ç Z ∼ N (0, 1) ⇒ −Z ∼ N (0, 1)

Probability Cheatsheet v2.

Compiled by William Chen (http://wzchen.com) and Joe Blitzstein, with contributions from Sebastian Chiu, Yuan Jiang, Yuqi Hou, and Jessy Hwang. Material based on Joe Blitzstein’s (@stat110) lectures (http://stat110.net) and Blitzstein/Hwang’s Introduction to Probability textbook (http://bit.ly/introprobability). Licensed under CC BY-NC-SA 4.0. Please share comments, suggestions, and errors at http://github.com/wzchen/probability_cheatsheet.

Last Updated December 12, 2015

Counting

Multiplication Rule

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 n (^) r possible outcomes, then overall there are n 1 n 2... n (^) r possibilities for the whole experiment.

Sampling Table

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 n k^

⇣n + k 1

k

Without Replacement

n! (n k)!

⇣n

k

Naive Definition of Probability

If all outcomes are equally likely, the probability of an event A happening is:

P (^) naive (A) =

number of outcomes favorable to A number of outcomes

Thinking Conditionally

Independence 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.

Unions, Intersections, and Complements 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 = A c \ B c

(A \ B) c = A c [ B c

Joint, Marginal, and Conditional 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.

Probability of an Intersection or Union 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)

  • P (A \ B \ C).

Simpson’s Paradox

Dr. Hibbert Dr. Nick

heart

band-aid

It is possible to have P (A | B, C) < P (A | B c^ , C) and P (A | B, C c^ ) < P (A | B c^ , C c^ ) yet also P (A | B) > P (A | B c^ ).

Law of Total Probability (LOTP) Let B 1 , B 2 , B 3 , ...B (^) n 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|B (^) n )P (B (^) n ) P (A) = P (A \ B 1 ) + P (A \ B 2 ) + · · · + P (A \ B (^) n )

For LOTP with extra conditioning, just add in another event C!

P (A|C) = P (A|B 1 , C)P (B 1 |C) + · · · + P (A|B (^) n , C)P (B (^) n |C) P (A|C) = P (A \ B 1 |C) + P (A \ B 2 |C) + · · · + P (A \ B (^) n |C)

Special case of LOTP with B and B c^ as partition:

P (A) = P (A|B)P (B) + P (A|B c )P (B c ) P (A) = P (A \ B) + P (A \ B c )

Bayes’ Rule Bayes’ Rule, and with extra conditioning (just add in C!)

P (A|B) =

P (B|A)P (A)

P (B)

P (A|B, C) =

P (B|A, C)P (A|C)

P (B|C)

We can also write

P (A|B, C) =

P (A, B, C)

P (B, C)

P (B, C|A)P (A)

P (B, C)

Odds Form of Bayes’ Rule

P (A|B) P (A c^ |B)

P (B|A)

P (B|A c^ )

P (A)

P (A c^ )

The posterior odds of A are the likelihood ratio times the prior odds.

Random Variables and their Distributions

PMF, CDF, and Independence Probability Mass Function (PMF) Gives the probability that a discrete random variable takes on the value x.

p (^) X (x) = P (X = x)

0 1 2 3 4

x

pmf

●

●

● ●

●

The PMF satisfies

p (^) X (x) 0 and

X

x

p (^) X (x) = 1

Cumulative Distribution Function (CDF) Gives the probability that a random variable is less than or equal to x.

F (^) X (x) = P (X  x)

0 1 2 3 4

x

cdf

●

● ●

● ●

● ●

● ●

●

The CDF is an increasing, right-continuous function with

F (^) X (x)! 0 as x! 1 and F (^) X (x)! 1 as x! 1

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 and Indicators

Expected Value and Linearity

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) =

P

i

x (^) i P (X = x (^) i )

X

3 2 6 10 1 1 5 4 ...

Y

4 2 8 23

  • 0 9 1 ...

X + Y

7 4 14 33

  • 1 14 5 ...

∑ 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) =

P

x

xP (X = x|A)

Indicator Random Variables 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

I A =

1 if A occurs, 0 if A does not occur.

Note that I (^) A^2 = I (^) A , I (^) A I (^) B = I (^) A\B , and I (^) A[B = I (^) A + I (^) B I (^) A I (^) B.

Distribution I (^) A ⇠ Bern(p) where p = P (A). Fundamental Bridge The expectation of the indicator for event A is the probability of event A: E(I (^) A ) = P (A).

Variance and Standard Deviation

Var(X) = E (X E(X)) 2 = E(X 2 ) (E(X)) 2

SD(X) =

q Var(X)

Continuous RVs, LOTUS, UoU

Continuous Random Variables (CRVs)

What’s the probability that a CRV is in an interval? Take the di↵erence in CDF values (or use the PDF as described later).

P (a  X  b) = P (X  b) P (X  a) = F (^) X (b) F (^) X (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 0 (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) =

Z (^) x

f (t)dt

0.00 − 4 − 2 0 2 4

x

PDF

− 4 − 2 0 2 4

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) =

Z (^) 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) =

Z 1

xf (x)dx

LOTUS

Expected value of a function of an r.v. The expected value of X is defined this way:

E(X) =

X

x

xP (X = x) (for discrete X)

E(X) =

Z 1

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

x

g(x)P (X = x) (for discrete X)

E(g(X)) =

Z 1

g(x)f (x)dx (for continuous X)

What’s a function of a random variable? A function of a random variable is also a random variable. For example, if X is the number of bikes you see in an hour, then g(X) = 2X is the number of bike wheels you see in that hour and h(X) =

X

2

= X(X 2 1)is the number of pairs of bikes such that you see both of those bikes in that hour.

What’s the point? You don’t need to know the PMF/PDF of g(X) to find its expected value. All you need is the PMF/PDF of X.

Universality of Uniform (UoU)

When you plug any CRV into its own CDF, you get a Uniform(0,1) random variable. When you plug a Uniform(0,1) r.v. into an inverse CDF, you get an r.v. with that CDF. For example, let’s say that a random variable X has CDF

F (x) = 1 e x^ , for x > 0

By UoU, if we plug X into this function then we get a uniformly distributed random variable.

F (X) = 1 e X ⇠ Unif(0, 1)

Similarly, if U ⇠ Unif(0, 1) then F ^1 (U ) has CDF F. The key point is that for any continuous random variable X, we can transform it into a Uniform random variable and back by using its CDF.

Moments and MGFs

Moments

Moments describe the shape of a distribution. Let X have mean μ and standard deviation , and Z = (X μ)/ be the standardized version of X. The kth moment of X is μ (^) k = E(X k^ ) and the kth standardized moment of X is m (^) k = E(Z k ). The mean, variance, skewness, and kurtosis are important summaries of the shape of a distribution.

Mean E(X) = μ (^1)

Variance Var(X) = μ 2 μ (^21)

Skewness Skew(X) = m (^3)

Kurtosis Kurt(X) = m 4 3

Poisson Process

Definition We have a Poisson process of rate arrivals per unit time if the following conditions hold:

  1. The number of arrivals in a time interval of length t is Pois(t).
  2. Numbers of arrivals in disjoint time intervals are independent.

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 T (^) n be the time of arrival of the nth email (relative to some starting time 0) and N (^) t 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 N (^) t = 0, which is the event that there are no emails in the first t hours. So

P (T 1 > t) = P (N (^) t = 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 di↵erences T (^) n T (^) n 1 are i.i.d. Expo().

Order Statistics

Definition Let’s say you have n i.i.d. r.v.s X 1 , X 2 ,... , X (^) n. 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 ,... , X (^) n with CDF F (x) and PDF f (x), the CDF and PDF of X (^) (i) are:

F (^) X(i) (x) = P (X (^) (i)  x) =

X^ n

k=i

⇣n

k

F (x) k^ (1 F (x)) nk

f (^) X(i) (x) = n

⇣n 1 i 1

F (x) i^1 (1 F (x)) ni^ f (x)

Uniform Order Statistics The jth order statistic of i.i.d. U 1 ,... , U (^) n ⇠ Unif(0, 1) is U (^) (j) ⇠ Beta(j, n j + 1).

Conditional Expectation

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 ) =

P y yP^ (Y^ =^ y)^ E(Y^ ) =^

R (^1) 1 yfY^ (y)dy E(Y |A) = P y yP^ (Y^ =^ y|A)^ E(Y^ |A) =^

R (^1) 1 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 = ±

p y, with equal probabilities (by symmetry). So E(Y |X) = X 2 , E(X|Y ) = 0.

Properties of Conditional Expectation

  1. E(Y |X) = E(Y ) if X ?? Y
  2. E(h(X)W |X) = h(X)E(W |X) (taking out what’s known) In particular, E(h(X)|X) = h(X).
  3. E(E(Y |X)) = E(Y ) (Adam’s Law, a.k.a. Law of Total 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 |A (^) n )P (A (^) n )

For the special case where the partition is A, A c^ , this says

E(Y ) = E(Y |A)P (A) + E(Y |A c )P (A c )

Eve’s Law (a.k.a. Law of Total Variance)

Var(Y ) = E(Var(Y |X)) + Var(E(Y |X))

MVN, LLN, CLT

Law of Large Numbers (LLN)

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 + · · · + X (^) n n

The Law of Large Numbers states that as n! 1, X¯ (^) n! μ with probability 1. For example, in flips of a coin with probability p of Heads, let X (^) j be the indicator of the jth flip being Heads. Then LLN says the proportion of Heads converges to p (with probability 1).

Central Limit Theorem (CLT)

Approximation using CLT

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 + · · · + X (^) n that is a sum of n i.i.d. random variables X (^) i. Let E(Y ) = μ (^) Y and Var(Y ) = (^) Y^2. The CLT says

Y ⇠˙ N (μ (^) Y , (^2) Y )

If the X (^) i are i.i.d. with mean μ (^) X and variance (^2) X , then μ (^) Y = nμ (^) X and (^2) Y = n (^2) X. For the sample mean X¯ (^) n , the CLT says

X¯ (^) n =

n

(X 1 + X 2 + · · · + X (^) n ) ˙⇠ N (μ (^) X , (^2) X /n)

Asymptotic Distributions using CLT

We use D ! to denote converges in distribution to as n! 1. The CLT says that if we standardize the sum X 1 + · · · + X (^) n then the distribution of the sum converges to N (0, 1) as n! 1:

1

p n

(X 1 + · · · + X (^) n 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 p n( X¯ (^) n μ (^) X ) X

D ! N (0, 1)

Markov Chains

Definition

1 1 2 1/

1/2 3 1/

5/ 1/3 4 1/

7/ 1/4 5 1/

7/

A Markov chain is a random walk in a state space, which we will assume is finite, say { 1 , 2 ,... , M }. We let X (^) t 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. In symbols,

P (X (^) n+1 = j|X 0 = i 0 , X 1 = i 1 ,... , X (^) n = i) = P (X (^) n+1 = j|X (^) n = i)

State Properties 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. ♪You can check-out any time you like, but you can never leave. ♪
  • Otherwise you are at a transient state. There is some positive probability that once you leave you will never return. ♪You don’t have to go home, but you can’t stay here. ♪ 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.

Transition Matrix

Let the state space be { 1 , 2 ,... , M }. The transition matrix Q is the M ⇥ M matrix where element q (^) ij is the probability that the chain goes from state i to state j in one step:

q (^) ij = P (X (^) n+1 = j|X (^) n = 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 Q m^.

q (^) ij(m )= P (X (^) n+m = j|X (^) n = i)

If X 0 is distributed according to the row vector PMF ~p, i.e., p (^) j = P (X 0 = j), then the PMF of X (^) n is ~pQn^.

Chain Properties

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 s (^) i q (^) ij = s (^) j q (^) ji for all i, j. Examples of reversible chains include any chain with q (^) ij = q (^) ji , with ~s = ( (^) M^1 , (^) M^1 ,... , (^) M^1 ), and random walk on an undirected network.

Stationary Distribution

Let us say that the vector ~s = (s 1 , s 2 ,... , s (^) M ) 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 X (^) t has the stationary distribution, then all future X (^) t+1 , X (^) t+2 ,... also have the stationary distribution.

For irreducible, aperiodic chains, the stationary distribution exists, is unique, and s (^) i 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/s (^) i.

To find the stationary distribution, you can solve the matrix equation (Q 0 I)~s 0 = 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 s (^) i q (^) ij = s (^) j q (^) ji for all states i, j implies that ~s is stationary.

Random Walk on an Undirected Network

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 , 143 , 144 , 142 ).

Continuous Distributions

Uniform Distribution Let us say that U is distributed Unif(a, b). We know the following: Properties of the Uniform For a Uniform distribution, the probability of a draw from any interval within the support is proportional to the length of the interval. See Universality of Uniform and Order Statistics for other properties. Example William throws darts really badly, so his darts are uniform over the whole room because they’re equally likely to appear anywhere. William’s darts have a Uniform distribution on the surface of the room. The Uniform is the only distribution where the probability of hitting in any specific region is proportional to the length/area/volume of that region, and where the density of occurrence in any one specific spot is constant throughout the whole support.

Normal Distribution

Let us say that X is distributed N (μ, 2 ). We know the following: Central Limit Theorem The Normal distribution is ubiquitous because of the Central Limit Theorem, which states that the sample mean of i.i.d. r.v.s will approach a Normal distribution as the sample size grows, regardless of the initial distribution. Location-Scale Transformation Every time we shift a Normal r.v. (by adding a constant) or rescale a Normal (by multiplying by a constant), we change it to another Normal r.v. For any Normal X ⇠ N (μ, 2 ), we can transform it to the standard N (0, 1) by the following transformation:

Z =

X μ

⇠ N (0, 1)

Standard Normal The Standard Normal, Z ⇠ N (0, 1), has mean 0 and variance 1. Its CDF is denoted by .

Exponential Distribution Let us say that X is distributed Expo(). We know the following: Story You’re sitting on an open meadow right before the break of dawn, wishing that airplanes in the night sky were shooting stars, because you could really use a wish right now. You know that shooting stars come on average every 15 minutes, but a shooting star is not “due” to come just because you’ve waited so long. Your waiting time is memoryless; the additional time until the next shooting star comes does not depend on how long you’ve waited already. Example The waiting time until the next shooting star is distributed Expo(4) hours. Here = 4 is the rate parameter, since shooting stars arrive at a rate of 1 per 1/4 hour on average. The expected time until the next shooting star is 1/ = 1/4 hour. Expos as a rescaled Expo(1) Y ⇠ Expo()! X = Y ⇠ Expo(1) Memorylessness The Exponential Distribution is the only continuous memoryless distribution. The memoryless property says that for X ⇠ Expo() and any positive numbers s and t, P (X > s + t|X > s) = P (X > t) Equivalently, X a|(X > a) ⇠ Expo() For example, a product with an Expo() lifetime is always “as good as new” (it doesn’t experience wear and tear). Given that the product has survived a years, the additional time that it will last is still Expo(). Min of Expos If we have independent X (^) i ⇠ Expo( (^) i ), then min(X 1 ,... , X (^) k ) ⇠ Expo( 1 + 2 + · · · + (^) k ). Max of Expos If we have i.i.d. X (^) i ⇠ Expo(), then max(X 1 ,... , X (^) k ) has the same distribution as Y 1 + Y 2 + · · · + Y (^) k , where Y (^) j ⇠ Expo(j) and the Y (^) j are independent.

Gamma Distribution

0 5 10 15 20

Gamma(3, 1)

x

PDF

0 5 10 15 20

Gamma(3, 0.5)

x

PDF

0 5 10 15 20

Gamma(10, 1)

x

PDF

0 5 10 15 20

Gamma(5, 0.5)

x

PDF

Let us say that X is distributed Gamma(a, ). We know the following:

Story You sit waiting for shooting stars, where the waiting time for a star is distributed Expo(). You want to see n shooting stars before you go home. The total waiting time for the nth shooting star is Gamma(n, ). Example You are at a bank, and there are 3 people ahead of you. The serving time for each person is Exponential with mean 2 minutes. Only one person at a time can be served. The distribution of your waiting time until it’s your turn to be served is Gamma(3, 12 ).

Beta Distribution

0.0 0.2 0.4 0.6 0.8 1.

0

1

2

3

4

5

Beta(0.5, 0.5)

x

PDF

0.0 0.2 0.4 0.6 0.8 1.

0.^ 0.^ 1.^

Beta(2, 1)

x

PDF

0.0 0.2 0.4 0.6 0.8 1.

Beta(2, 8)

x

PDF

0

1

2

3

0.0 0.2 0.4 0.6 0.8 1.

2.^ 2.^

Beta(5, 5)

x

PDF

Conjugate Prior of the Binomial In the Bayesian approach to statistics, parameters are viewed as random variables, to reflect our uncertainty. The prior for a parameter is its distribution before observing data. The posterior is the distribution for the parameter after observing data. Beta is the conjugate prior of the Binomial because if you have a Beta-distributed prior on p in a Binomial, then the posterior distribution on p given the Binomial data is also Beta-distributed. Consider the following two-level model:

X|p ⇠ Bin(n, p) p ⇠ Beta(a, b)

Then after observing X = x, we get the posterior distribution

p|(X = x) ⇠ Beta(a + x, b + n x)

Order statistics of the Uniform See Order Statistics. Beta-Gamma relationship If X ⇠ Gamma(a, ), Y ⇠ Gamma(b, ), with X ?? Y then

Distribution Properties

Important CDFs

Standard Normal

Exponential() F (x) = 1 e x^ , for x 2 (0, 1 )

Uniform(0,1) F (x) = x, for x 2 (0, 1)

Convolutions of Random Variables

A convolution of n random variables is simply their sum. For the following results, let X and Y be independent.

  1. X ⇠ Pois( 1 ), Y ⇠ Pois( 2 ) ! X + Y ⇠ Pois( 1 + 2 )
  2. X ⇠ Bin(n 1 , p), Y ⇠ Bin(n 2 , p) ! X + Y ⇠ Bin(n 1 + n 2 , p). Bin(n, p) can be thought of as a sum of i.i.d. Bern(p) r.v.s.
  3. X ⇠ Gamma(a 1 , ), Y ⇠ Gamma(a 2 , ) ! X + Y ⇠ Gamma(a 1 + a 2 , ). Gamma(n, ) with n an integer can be thought of as a sum of i.i.d. Expo() r.v.s.
  4. X ⇠ NBin(r 1 , p), Y ⇠ NBin(r 2 , p) ! X + Y ⇠ NBin(r 1 + r 2 , p). NBin(r, p) can be thought of as a sum of i.i.d. Geom(p) r.v.s.
  5. X ⇠ N (μ 1 , 21 ), Y ⇠ N (μ 2 , 22 ) ! X + Y ⇠ N (μ 1 + μ 2 , 21 + 22 )

Special Cases of Distributions

  1. Bin(1, p) ⇠ Bern(p)
  2. Beta(1, 1) ⇠ Unif(0, 1)
  3. Gamma(1, ) ⇠ Expo()
  4. (^2) n ⇠ Gamma

(^) n 2 ,^

1 2

  1. NBin(1, p) ⇠ Geom(p)

Inequalities

  1. Cauchy-Schwarz |E(XY )| 

p E(X 2 )E(Y 2 )

  1. Markov P (X a)  E|X| a for^ a >^0
  2. Chebyshev P (|X μ| a) 

2 a^2 for E(X) = μ, Var(X) = 2

  1. Jensen E(g(X)) g(E(X)) for g convex; reverse if g is concave

Formulas

Geometric Series

1 + r + r 2 + · · · + r n^1 =

nX 1

k=

r k^ =

1 r n 1 r

1 + r + r 2 + · · · =

1 r

if |r| < 1

Exponential Function (e x )

e x^ =

X^1

n=

x n n!

= 1 + x +

x 2 2!

x 3 3!

  • · · · = lim n!

x n

◆ (^) n

Gamma and Beta Integrals

You can sometimes solve complicated-looking integrals by pattern-matching to a gamma or beta integral: Z (^1)

0

x t 1 e x dx = (t)

Z 1

0

x a 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.

Euler’s Approximation for Harmonic Sums

n

⇡ log n + 0. 577...

Stirling’s Approximation for Factorials

n! ⇡

p 2 ⇡n

n e

◆ (^) n

Miscellaneous Definitions

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.

Example Problems

Contributions from Sebastian Chiu

Calculating Probability

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 ✓ 1

n

◆ (^) n probability that there are no typos on your page. For n

large, this is approximately e ^1 = 1/e.

Linearity and Indicators (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 I (^) j be the indicator for the jth day being represented.

E(I (^) j ) = 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 J (^) i 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

Linearity and Indicators (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.

Linearity and First Success 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 + · · · + N (^) n , where N 1 is the draws to get our first new coupon, N 2 is the additional draws needed to draw our second new coupon and so on. By the story of the First Success, N 2 ⇠ FS((n 1)/n) (after collecting first coupon type, there’s (n 1)/n chance you’ll get something new). Similarly, N 3 ⇠ FS((n 2)/n), and N (^) j ⇠ FS((n j + 1)/n). By linearity,

E(N ) = E(N 1 ) + · · · + E(N (^) n ) =

n n

n n 1

n 1

= n

X^ n

j=

j

This is approximately n(log(n) + 0.577) by Euler’s approximation.

Orderings of i.i.d. random variables I call 2 UberX’s and 3 Lyfts at the same time. If the time it takes for the rides to reach me are i.i.d., what is the probability that all the Lyfts will arrive first? Answer: Since the arrival times of the five cars are i.i.d., all 5! orderings of the arrivals are equally likely. There are 3!2! orderings that involve the Lyfts arriving first, so the probability

that the Lyfts arrive first is

= 1/10. Alternatively, there are

3

ways to choose 3 of the 5 slots for the Lyfts to occupy, where each of the choices are equally likely. One of these choices has all 3 of the

Lyfts arriving first, so the probability is 1 /

Expectation of Negative Hypergeometric What is the expected number of cards that you draw before you pick your first Ace in a shu✏ed deck (not counting the Ace)? Answer: Consider a non-Ace. Denote this to be card j. Let I (^) j be the indicator that card j will be drawn before the first Ace. Note that I (^) j = 1 says that j is before all 4 of the Aces in the deck. The probability that this occurs is 1/5 by symmetry. Let X be the number of cards drawn before the first Ace. Then X = I 1 + I 2 + ... + I 48 , where each indicator corresponds to one of the 48 non-Aces. Thus,

E(X) = E(I 1 ) + E(I 2 ) + ... + E(I 48 ) = 48/5 = 9. 6.

Minimum and Maximum of RVs What is the CDF of the maximum of n independent Unif(0,1) random variables? Answer: Note that for r.v.s X 1 , X 2 ,... , X (^) n , P (min(X 1 , X 2 ,... , X (^) n ) a) = P (X 1 a, X 2 a,... , Xn a) Similarly, P (max(X 1 , X 2 ,... , X (^) n )  a) = P (X 1  a, X 2  a,... , Xn  a) We will use this principle to find the CDF of U (^) (n) , where U (^) (n) = max(U 1 , U 2 ,... , Un ) and U (^) i ⇠ Unif(0, 1) are i.i.d. P (max(U 1 , U 2 ,... , U (^) n )  a) = P (U 1  a, U 2  a,... , Un  a) = P (U 1  a)P (U 2  a)... P (U (^) n  a)

= a n

for 0 < a < 1 (and the CDF is 0 for a  0 and 1 for a 1).

Pattern-matching with e x Taylor series

For X ⇠ Pois(), find E

X + 1

. Answer: By LOTUS,

E

X + 1

X^1

k=

k + 1

e ^ k k!

e

X^1

k=

k+ (k + 1)!

e

(e 1)

Adam’s Law and Eve’s Law

William really likes speedsolving Rubik’s Cubes. But he’s pretty bad at it, so sometimes he fails. On any given day, William will attempt N ⇠ Geom(s) Rubik’s Cubes. Suppose each time, he has probability p of solving the cube, independently. Let T be the number of Rubik’s Cubes he solves during a day. Find the mean and variance of T. Answer: Note that T |N ⇠ Bin(N, p). So by Adam’s Law,

E(T ) = E(E(T |N )) = E(N p) =

p(1 s) s

Similarly, by Eve’s Law, we have that

Var(T ) = E(Var(T |N )) + Var(E(T |N )) = E(N p(1 p)) + Var(N p)

p(1 p)(1 s) s

p 2 (1 s) s 2

p(1 s)(p + s(1 p)) s 2

MGF – Finding Moments

Find E(X 3 ) for X ⇠ Expo() using the MGF of X. Answer: The MGF of an Expo() is M (t) = (^) t. To get the third moment, we can take the third derivative of the MGF and evaluate at t = 0:

E(X

3 ) =

But a much nicer way to use the MGF here is via pattern recognition: note that M (t) looks like it came from a geometric series:

1 1 (^) t

X^1

n=

t

◆ (^) n

X^1

n=

n! n

t n n!

The coecient of t n n! here is the^ nth moment of^ X, so we have E(X n^ ) = (^) nn! for all nonnegative integers n.

Markov chains (1)

Suppose X (^) n is a two-state Markov chain with transition matrix

Q =

Find the stationary distribution ~s = (s 0 , s 1 ) of X (^) n by solving ~sQ = ~s, and show that the chain is reversible with respect to ~s. Answer: The equation ~sQ = ~s says that

s 0 = s 0 (1 ↵) + s 1 and s 1 = s 0 (↵) + s 0 (1 )

By solving this system of linear equations, we have

~s =

To show that the chain is reversible with respect to ~s, we must show s (^) i q (^) ij = s (^) j q (^) ji for all i, j. This is done if we can show s 0 q 01 = s 1 q 10. And indeed,

s 0 q 01 =

= s 1 q (^10)

Markov chains (2)

William and Sebastian play a modified game of Settlers of Catan, where every turn they randomly move the robber (which starts on the center tile) to one of the adjacent hexagons.

Robber

(a) Is this Markov chain irreducible? Is it aperiodic? Answer: Yes to both. The Markov chain is irreducible because it can get from anywhere to anywhere else. The Markov chain is aperiodic because the robber can return back to a square in 2 , 3 , 4 , 5 ,... moves, and the GCD of those numbers is 1. (b) What is the stationary distribution of this Markov chain? Answer: Since this is a random walk on an undirected graph, the stationary distribution is proportional to the degree sequence. The degree for the corner pieces is 3, the degree for the edge pieces is 4, and the degree for the center pieces is 6. To normalize this degree sequence, we divide by its sum. The sum of the degrees is 6(3) + 6(4) + 7(6) = 84. Thus the stationary probability of being on a corner is 3/84 = 1/28, on an edge is 4/84 = 1/21, and in the center is 6/84 = 1/14. (c) What fraction of the time will the robber be in the center tile in this game, in the long run? Answer: By the above, 1 /.

(d) What is the expected amount of moves it will take for the robber to return to the center tile? Answer: Since this chain is irreducible and aperiodic, to get the expected time to return we can just invert the stationary probability. Thus on average it will take 14 turns for the robber to return to the center tile.

Problem-Solving Strategies

Contributions from Jessy Hwang, Yuan Jiang, Yuqi Hou

  1. Getting started. Start by defining relevant events and random variables. (“Let A be the event that I pick the fair coin”; “Let X be the number of successes.”) Clear notion is important for clear thinking! Then decide what it is that you’re supposed to be finding, in terms of your notation (“I want to find P (X = 3|A)”). Think about what type of object your answer should be (a number? A random variable? A PMF? A PDF?) and what it should be in terms of. Try simple and extreme cases. To make an abstract experiment more concrete, try drawing a picture or making up numbers that could have happened. Pattern recognition: does the structure of the problem resemble something we’ve seen before?
  2. Calculating probability of an event. Use counting principles if the naive definition of probability applies. Is the probability of the complement easier to find? Look for symmetries. Look for something to condition on, then apply Bayes’ Rule or the Law of Total Probability.
  3. Finding the distribution of a random variable. First make sure you need the full distribution not just the mean (see next item). Check the support of the random variable: what values can it take on? Use this to rule out distributions that don’t fit. Is there a story for one of the named distributions that fits the problem at hand? Can you write the random variable as a function of an r.v. with a known distribution, say Y = g(X)? 4. Calculating expectation. If it has a named distribution, check out the table of distributions. If it’s a function of an r.v. with a named distribution, try LOTUS. If it’s a count of something, try breaking it up into indicator r.v.s. If you can condition on something natural, consider using Adam’s law. 5. Calculating variance. Consider independence, named distributions, and LOTUS. If it’s a count of something, break it up into a sum of indicator r.v.s. If it’s a sum, use properties of covariance. If you can condition on something natural, consider using Eve’s Law. 6. Calculating E(X 2 ). Do you already know E(X) or Var(X)? Recall that Var(X) = E(X 2 ) (E(X)) 2. Otherwise try LOTUS. 7. Calculating covariance. Use the properties of covariance. If you’re trying to find the covariance between two components of a Multinomial distribution, X (^) i , X (^) j , then the covariance is np (^) i p (^) j for i 6 = j. 8. Symmetry. If X 1 ,... , X (^) n are i.i.d., consider using symmetry. 9. Calculating probabilities of orderings. Remember that all n! ordering of i.i.d. continuous random variables X 1 ,... , X (^) n are equally likely.
  4. Determining independence. There are several equivalent definitions. Think about simple and extreme cases to see if you can find a counterexample.
  5. Do a painful integral. If your integral looks painful, see if you can write your integral in terms of a known PDF (like Gamma or Beta), and use the fact that PDFs integrate to 1?
  6. Before moving on. Check some simple and extreme cases, check whether the answer seems plausible, check for biohazards.

Biohazards

Contributions from Jessy Hwang

  1. Don’t misuse the naive definition of probability. When answering “What is the probability that in a group of 3 people, no two have the same birth month?”, it is not correct to treat the people as indistinguishable balls being placed into 12 boxes, since that assumes the list of birth months {January, January, January} is just as likely as the list {January, April, June}, even though the latter is six times more likely.
  2. Don’t confuse unconditional, conditional, and joint probabilities. In applying P (A|B) = P (B|A)P (A) P (B) , it is^ not correct to say “P (B) = 1 because we know B happened”; P (B) is the prior probability of B. Don’t confuse P (A|B) with P (A, B).
  3. Don’t assume independence without justification. In the matching problem, the probability that card 1 is a match and card 2 is a match is not 1/n 2. Binomial and Hypergeometric are often confused; the trials are independent in the Binomial story and dependent in the Hypergeometric story.
  4. Don’t forget to do sanity checks. Probabilities must be between 0 and 1. Variances must be 0. Supports must make sense. PMFs must sum to 1. PDFs must integrate to 1.
  5. Don’t confuse random variables, numbers, and events. Let X be an r.v. Then g(X) is an r.v. for any function g. In particular, X 2 , |X|, F (X), and I (^) X> 3 are r.v.s. P (X 2 < X|X 0), E(X), Var(X), and g(E(X)) are numbers. X = 2 and F (X) 1 are events. It does not make sense to write

R 1

1 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.

Table of Distributions

Distribution PMF/PDF and Support Expected Value Variance MGF

Bernoulli

Bern(p)

P (X = 1) = p

P (X = 0) = q = 1 p p pq q + pe t

Binomial

Bin(n, p)

P (X = k) =

n

k

p k^ q nk

k 2 { 0 , 1 , 2 ,... n} np npq (q + pe t^ ) n

Geometric

Geom(p)

P (X = k) = q k^ p

k 2 {0, 1, 2,... } q/p q/p 2

p

1 qet^ , qe^

t < 1

Negative Binomial

NBin(r, p)

P (X = n) =

r+n 1

r 1

p r^ q n

n 2 {0, 1, 2,... } rq/p rq/p 2 ( p

1 qet^

) r^ , qe t^ < 1

Hypergeometric

HGeom(w, b, n)

P (X = k) =

⇣ (^) w k

⌘⇣ (^) b nk

⌘

⇣ w+b n

⌘

k 2 { 0 , 1 , 2 ,... , n} μ =

nw b+w

w+bn w+b 1

n

μ

n (1^ ^

μ

n )^ messy

Poisson

Pois()

P (X = k) = e

(^) k k!

k 2 {0, 1, 2,... } e (e^

t (^) 1)

Uniform

Unif(a, b)

f (x) = b^1 a

x 2 (a, b) a+ 2 b

(ba) 2 12

e tb^ e ta t(ba)

Normal

N (μ, 2 )

f (x) =

1

p 2 ⇡

e ^ (x^ ^ μ)

(^2) /(2 (^2) )

x 2 (1, 1 ) μ 2 e tμ+^

^2 t^2 2

Exponential

Expo()

f (x) = e x

x 2 (0, 1 )

1

1 2

t , t <^

Gamma

Gamma(a, )

f (x) =

1

(a) (x)^

a e x 1

x

x 2 (0, 1 ) a ^ a

2

t

⌘ a

, t <

Beta

Beta(a, b)

f (x) =

(a+b)

(a)(b) x^

a 1 (1 x) b 1

x 2 (0, 1) μ =

a a+b

μ(1μ)

(a+b+1) messy

Log-Normal

LN (μ, 2 )

1 x

p 2 ⇡

e (log^ xμ)^

(^2) /(2 2 )

x 2 (0, 1 ) ✓ = e μ+^

(^2) / 2

✓ 2 (e ^

2

1) doesn’t exist

Chi-Square

2 n

1 2 n/^2 (n/2)

x n/^2 ^1 e x/^2

x 2 (0, 1 ) n 2 n (1 2 t) n/^2 , t < 1 / 2

Student-t

t n

p((n+1)/2)

n⇡(n/2) (1 +^ x^

2 /n) (n+1)/ 2

x 2 (1, 1 ) 0 if n > 1 nn 2 if n > 2 doesn’t exist

Stat 110 Final Review, Fall 2011

Prof. Joe Blitzstein

1 General Information

The final will be on Thursday 12/15, from 2 PM to 5 PM. No books, notes, computers,

cell phones, or calculators are allowed, except that you may bring four pages of

standard-sized paper (8.5” x 11”) with anything you want written (or typed) on

both sides. There will be approximately 8 problems, equally weighted. The material

covered will be cumulative since probability is cumulative.

To study, I recommend solving lots and lots of practice problems! It’s a good

idea to work through as many of the problems on this handout as possible without

looking at solutions (and then discussing with others and looking at solutions to

check your answers and for any problems where you were really stuck), and to take

at least two of the practice finals under timed conditions using only four pages of

notes. Carefully going through class notes, homeworks, and handouts (especially this

handout and the midterm review handout) is also important, as long as it is done

actively (intermixing reading, thinking, solving problems, and asking questions).

2 Topics

  • Combinatorics: multiplication rule, tree diagrams, binomial coecients, per-

mutations and combinations, sampling with/without replacement when order

does/doesn’t matter, inclusion-exclusion, story proofs.

  • Basic Probability: sample spaces, events, axioms of probability, equally likely

outcomes, inclusion-exclusion, unions, intersections, and complements.

  • Conditional Probability: definition and meaning, writing P (A 1 \ A 2 \ · · · \ An )

as a product, Bayes’ Rule, Law of Total Probability, thinking conditionally,

prior vs. posterior probability, independence vs. conditional independence.

  • Random Variables: definition and interpretations, stories, discrete vs. contin-

uous, distributions, CDFs, PMFs, PDFs, MGFs, functions of a r.v., indicator

r.v.s, memorylessness of the Exponential, universality of the Uniform, Poisson

approximation, Poisson processes, Beta as conjugate prior for the Binomial.

sums (convolutions), location and scale.

1

3 Important Distributions

3.1 Table of Distributions

The table below will be provided on the final (included as the last page). This is

meant to help avoid having to memorize formulas for the distributions (or having to

take up a lot of space on your pages of notes). Here 0 < p < 1 and q = 1 p. The

parameters for Gamma and Beta are positive real numbers; n, r, and w are positive

integers, as is b for the Hypergeometric.

Name Param. PMF or PDF Mean Variance

Bernoulli p P (X = 1) = p, P (X = 0) = q p pq

Binomial n, p

n

k

p

k

q

nk

, for k 2 { 0 , 1 ,... , n} np npq

Geometric p q

k

p, for k 2 { 0 , 1 , 2 ,... } q/p q/p

NegBinom r, p

r+n 1

r 1

p

r

q

n

, n 2 { 0 , 1 , 2 ,... } rq/p rq/p

Hypergeom w, b, n

(

w k )(^

b nk ) (

w+b n )^

, for k 2 { 0 , 1 ,... , n} μ =

nw

w+b

(

w+bn

w+b 1

)n

n

(1

n

)

Poisson

e ^ k

k!

, for k 2 { 0 , 1 , 2 ,... }

Uniform a < b

ba

, for x 2 (a, b)

a+b

(ba) 2

Normal μ,

p

e

(xμ) 2 /(2 2 )

μ

Exponential e

x

, for x > 0 1 / 1 /

Gamma a, (a)

(x)

a

e

x

x

, for x > 0 a/ a/

Beta a, b

(a+b)

(a)(b)

x

a 1

(1 x)

b 1

, for 0 < x < 1 μ =

a

a+b

a+b+

n

2 n/^2 (n/2)

x

n/ 2 1

e

x/ 2

, for x > 0 n 2 n

Student-t n

((n+1)/2)

p

n⇡(n/2)

(1 + x

/n)

(n+1)/ 2

0 if n > 1

n

n 2

if n > 2

3

3.2 Connections Between Distributions

The table above summarizes the PMFs/PDFs of the important distributions, and

their means and variances, but it does not say where each distribution comes from

(stories), or how the distributions interrelate. Some of these connections between

distributions are listed below.

Also note that some of the important distributions are special cases of others.

Bernoulli is a special case of Binomial; Geometric is a special case of Negative Bi-

nomial; Unif(0,1) is a special case of Beta; and Exponential and

are both special

cases of Gamma.

  1. Binomial: If X 1 ,... , X (^) n are i.i.d. Bern(p), then X 1 + · · · + X (^) n ⇠ Bin(n, p).
  2. Neg. Binom.: If G 1 ,... , G (^) r are i.i.d. Geom(p), then G 1 +· · ·+G (^) r ⇠ NBin(r, p).
  3. Location and Scale: If Z ⇠ N (0, 1), then μ + Z ⇠ N (μ,

).

If U ⇠ Unif(0, 1) and a < b, then a + (b a)U ⇠ Unif(a, b).

If X ⇠ Expo(1), then

X ⇠ Expo().

If Y ⇠ Gamma(a, ), then Y ⇠ Gamma(a, 1).

  1. Symmetry: If X ⇠ Bin(n, 1 /2), then n X ⇠ Bin(n, 1 /2).

If U ⇠ Unif(0, 1), then 1 U ⇠ Unif(0, 1).

If Z ⇠ N (0, 1), then Z ⇠ N (0, 1).

  1. Universality of Uniform: Let F be the CDF of a continuous r.v., such that

F

exists. If U ⇠ Unif(0, 1), then F

(U ) has CDF F. Conversely, if X ⇠ F ,

then F (X) ⇠ Unif(0, 1).

  1. Uniform and Beta: Unif(0, 1) is the same distribution as Beta(1, 1). The jth

order statistic of n i.i.d. Unif(0, 1) r.v.s is Beta(j, n j + 1).

  1. Beta and Binomial: Beta is the conjugate prior to Binomial, in the sense

that if X|p ⇠ Bin(n, p) and the prior is p ⇠ Beta(a, b), then the posterior is

p|X ⇠ Beta(a + X, b + n X).

  1. Gamma: If X 1 ,... , X (^) n are i.i.d. Expo(), then X 1 + · · · + X (^) n ⇠ Gamma(n, ).
  2. Gamma and Poisson: In a Poisson process of rate , the number of arrivals

in a time interval of length t is Pois(t), while the time of the nth arrival is

Gamma(n, ).

4

5 Review of Some Useful Results

5.1 De Morgan’s Laws

(A 1 [ A 2 · · · [ A (^) n )

c

= A

c

1 ^ A

c

2 · · ·^ ^ A

c

n ,

(A 1 \ A 2 · · · \ A (^) n )

c

= A

c

1 [^ A

c

2 · · ·^ [^ A

c

n.

5.2 Complements

P (A

c

) = 1 P (A).

5.3 Unions

P (A [ B) = P (A) + P (B) P (A \ B);

P (A 1 [ A 2 [ · · · [ An ) =

X^ n

i=

P (Ai ), if the Ai are disjoint;

P (A 1 [ A 2 [ · · · [ An ) 

X^ n

i=

P (Ai );

P (A 1 [A 2 [· · ·[An ) =

n

X

k=

(1)

k+

X

i 1

An analogous formula holds for conditioning on a continuous r.v. X with PDF f (x):

P (A) =

Z (^1)

P (A|X = x)f (x)dx.

Similarly, to go from a joint PDF f (x, y) for (X, Y ) to the marginal PDF of Y ,

integrate over all values of x:

f (^) Y (y) =

Z (^1)

f (x, y)dx.

5.6 Bayes’ Rule

P (A|B) =

P (B|A)P (A)

P (B)

.

Often the denominator P (B) is then expanded by the Law of Total Probability. For

continuous r.v.s X and Y , Bayes’ Rule becomes

f (^) Y |X (y|x) =

f (^) X|Y (x|y)f (^) Y (y)

f (^) X (x)

.

5.7 Expected Value, Variance, and Covariance

Expected value is linear : for any random variables X and Y and constant c,

E(X + Y ) = E(X) + E(Y ),

E(cX) = cE(X).

Variance can be computed in two ways:

Var(X) = E(X EX)

= E(X

) (EX)

.

Constants come out from variance as the constant squared:

Var(cX) = c

Var(X).

For the variance of the sum, there is a covariance term:

Var(X + Y ) = Var(X) + Var(Y ) + 2Cov(X, Y ),

where

Cov(X, Y ) = E((X EX)(Y EY )) = E(XY ) (EX)(EY ).

7