Docsity

Stat 110 Final Review, Fall 2011, Study notes of Probability and Statistics

Toggle sidebar
bg1
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 coefficients, 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(A1\A2\···\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
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Stat 110 Final Review, Fall 2011 and more Study notes Probability and Statistics in PDF only on Docsity!

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.
  • Expected Value: linearity, fundamental bridge, variance, standard deviation, covariance, correlation, using expectation to prove existence, LOTUS.
  • Conditional Expectation: definition and meaning, taking out what’s known, conditional variance, Adam’s Law (iterated expectation), Eve’s Law.
  • Important Discrete Distributions: Bernoulli, Binomial, Geometric, Negative Binomial, Hypergeometric, Poisson.
  • Important Continuous Distributions: Uniform, Normal, Exponential, Gamma, Beta, Chi-Square, Student-t.
  • Jointly Distributed Random Variables: joint, conditional, and marginal distri- butions, independence, Multinomial, Multivariate Normal, change of variables, order statistics.
  • Convergence: Law of Large Numbers, Central Limit Theorem.
  • Inequalities: Cauchy-Schwarz, Markov, Chebyshev, Jensen.
  • Markov chains: Markov property, transition matrix, irreducibility, stationary distributions, reversibility.
  • Strategies: conditioning, symmetry, linearity, indicator r.v.s, stories, checking whether answers make sense (e.g., looking at simple and extreme cases and avoiding category errors).
  • Some Important Examples: birthday problem, matching problem (de Mont- mort), Monty Hall, gambler’s ruin, prosecutor’s fallacy, testing for a disease, capture-recapture (elk problem), coupon (toy) collector, St. Petersburg para- dox, Simpson’s paradox, two envelope paradox, waiting time for HH vs. waiting time for HT, store with a random number of customers, bank-post oce ex- ample, Bayes’ billiards, random walk on a network, chicken and egg.

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 2 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 (μ, 2 ). If U ⇠ Unif(0, 1) and a < b, then a + (b a)U ⇠ Unif(a, b). If X ⇠ Expo(1), then ^1 X ⇠ Expo(). If Y ⇠ Gamma(a, ), then Y ⇠ Gamma(a, 1).
  4. 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).
  5. Universality of Uniform: Let F be the CDF of a continuous r.v., such that F ^1 exists. If U ⇠ Unif(0, 1), then F ^1 (U ) has CDF F. Conversely, if X ⇠ F , then F (X) ⇠ Unif(0, 1).
  6. 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).
  7. 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).
  8. Gamma: If X 1 ,... , X (^) n are i.i.d. Expo(), then X 1 + · · · + X (^) n ⇠ Gamma(n, ).
  9. 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, ).
  1. Gamma and Beta: If X ⇠ Gamma(a, ), Y ⇠ Gamma(b, ) are independent, then X/(X + Y ) ⇠ Beta(a, b) is independent of X + Y ⇠ Gamma(a + b, ).
  2. Chi-Square: (^2) n is the same distribution as Gamma(n/ 2 , 1 /2).
  3. Student-t: If Z ⇠ N (0, 1) and Y ⇠ (^2) n are independent, then pZ^ Y /n has the Student-t distribution with n degrees of freedom. For n = 1, this becomes the Cauchy distribution, which we can also think of as the distribution of Z 1 /Z 2 with Z 1 , Z 2 i.i.d. N (0, 1).

4 Sums of Independent Random Variables

Let X 1 , X 2 ,... , X (^) n be independent random variables. The table below shows the distribution of their sum, X 1 + X 2 + · · · + X (^) n , for various important cases depending on the distribution of X (^) i. The central limit theorem says that a sum of a large number of i.i.d. r.v.s will be approximately Normal, while these are exact distributions.

X (^) i

P (^) n i=1 X^ i

Bernoulli(p) Binomial(n, p)

Binomial(m (^) i , p) Binomial(

P (^) n i=1 m^ i^ , p)

Geometric(p) NBin(n, p)

NBin(r (^) i , p) NBin(

P (^) n i=1 r^ i^ , p)

Poisson( (^) i ) Poisson(

P (^) n i=1 ^ i^ )

Unif(0,1) Triangle(0,1,2) (n = 2)

N (μ (^) i , (^2) i ) N (

P (^) n i=1 μ^ i^ ,^

P (^) n i=1 ^

2 i )

Exponential() Gamma(n, )

Gamma(↵ (^) i , ) Gamma(

P (^) n i=1 ↵^ i^ ,^ )

Z (^) i^2 , for Z (^) i ⇠ N (0, 1) (^2) n

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) 2 = E(X 2 ) (EX) 2.

Constants come out from variance as the constant squared:

Var(cX) = c 2 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 ).

So if X and Y are uncorrelated, then the variance of the sum is the sum of the vari- ances. Recall that independent implies uncorrelated but not vice versa. Covariance is symmetric: Cov(Y, X) = Cov(X, Y ),

and covariances of sums can be expanded as

Cov(X + Y, Z + W ) = Cov(X, Z) + Cov(X, W ) + Cov(Y, Z) + Cov(Y, W ).

Note that for c a constant, Cov(X, c) = 0, Cov(cX, Y ) = cCov(X, Y ).

The correlation of X and Y , which is between 1 and 1 , is

Corr(X, Y ) =

Cov(X, Y ) SD(X)SD(Y )

This is also the covariance of the standardized versions of X and Y.

5.8 Law of the Unconscious Statistician (LOTUS)

Let X be a discrete random variable and h be a real-valued function. Then Y = h(X) is a random variable. To compute EY using the definition of expected value, we would need to first find the PMF of Y and use EY =

P

y yP^ (Y^ =^ y). The Law of the Unconscious Statistician says we can use the PMF of X directly:

Eh(X) =

X

x

h(x)P (X = x).

Similarly, for X a continuous r.v. with PDF f (^) X (x), we can find the expected value of Y = h(X) by integrating h(x) times the PDF of X, without first finding f (^) Y (y):

Eh(X) =

Z 1

h(x)f (^) X (x)dx.

5.9 Indicator Random Variables

Let A and B be events. Indicator r.v.s bridge between probability and expectation: P (A) = E(I (^) A ), where I (^) A is the indicator r.v. for A. It is often useful to think of a “counting” r.v. as a sum of indicator r.v.s. Indicator r.v.s have many pleasant

5.11 Change of Variables

Let Y = g(X), where g is a di↵erentiable function from R n^ to itself whose inverse exists, and X = (X 1 ,... , X (^) n ) is a continuous random vector with PDF f (^) X. The PDF of Y can be found using the Jacobian of the transformation g:

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

@x @y

where x = g ^1 (y) and | @ @xy | is the absolute value of the Jacobian determinant of g ^1

(here | @ @xy | can either be found directly or by using the reciprocal of | @ @yx |).

In the case n = 1, this says that if Y = g(X) where g is di↵erentiable with g 0 (x) > 0 everywhere, then

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

dx dy

which is easily remembered if written in the form

f (^) Y (y)dy = f (^) X (x)dx.

Remember when using this that f (^) Y (y) is a function of y (found by solving for x in terms of y), and the bounds for y should be specified. For example, if y = e x^ and x ranges over R, then y ranges over (0, 1 ).

5.12 Order Statistics

Let X 1 ,... , X (^) n be i.i.d. continuous r.v.s with PDF f and CDF F. The order statistics are obtained by sorting the X (^) i ’s, with X (^) (1)  X (^) (2)  · · ·  X (^) (n). The marginal PDF of the jth order statistic is

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

n 1 j 1

f (x)F (x) j^1 (1 F (x)) nj^.

5.13 Moment Generating Functions

The moment generating function of X is the function

M (^) X (t) = E(e tX^ ),

if this exists for all t in some open interval containing 0. For X 1 ,... , X (^) n independent, the MGF of the sum S (^) n = X 1 + · · · + X (^) n is

M (^) S (^) n (t) = M (^) X 1 (t) · · · M (^) X (^) n (t),

which is often much easier to deal with than a convolution. The name “moment generating function” comes from the fact that the derivatives of M (^) X at 0 give the moments of X:

M (^) X^0 (0) = E(X), M (^) X^00 (0) = E(X 2 ), M (^) X^000 (0) = E(X 3 ),....

Sometimes these can be computed “all at once” without explicitly taking derivatives, by finding the Taylor series for M (^) X (t), e.g., the MGF of X ⇠ Expo(1) is (^1) ^1 t for t < 1,

which is the geometric series

P 1

j=0 t^

n (^) = P^1 j=0 n!^

t n n! for^ |t|^ <^ 1. So the^ nth moment of X is n! (the coecient of t^ n n! ).

5.14 Conditional Expectation

The conditional expected value E(Y |X = x) is a number (for each x) which is the average value of Y , given the information that X = x. The definition is analogous to the definition of EY : just replace the PMF or PDF by the conditional PMF or conditional PDF.

It is often very convenient to just directly condition on X to obtain E(Y |X), which is a random variable (it is a function of X). This intuitively says to average Y , treating X as if it were a known constant: E(Y |X = x) is a function of x, and E(Y |X) is obtained from E(Y |X = x) by “changing x to X”. For example, if E(Y |X = x) = x 3 , then E(Y |X) = X 3.

Important properties of conditional expectation:

E(Y 1 + Y 2 |X) = E(Y 1 |X) + E(Y 2 |X) (Linearity);

E(Y |X) = E(Y ) if X and Y are independent; E(h(X)Y |X) = h(X)E(Y |X) (Taking out what’s known); E(Y ) = E(E(Y |X)) (Iterated Expectation/Adam’s Law); Var(Y ) = E(Var(Y |X)) + Var(E(Y |X)) (Eve’s Law).

The latter two identities are often useful for finding the mean and variance of Y : first condition on some choice of X where the conditional distribution of Y given X is easier to work with than the unconditional distribution of Y , and then account for the randomness of X.

For convex functions g (convexity of g is equivalent to g 00 (x) 0 for all x, assuming this exists), there is Jensen’s Inequality (the reverse inequality holds for concave g):

E(g(X)) g(E(X)) for g convex.

The Cauchy-Schwarz inequality bounds the expected product of X and Y :

|E(XY )| 

p E(X 2 )E(Y 2 ).

If X and Y have mean 0 and variance 1, this reduces to saying that the correlation is between -1 and 1. It follows that correlation is always between -1 and 1.

5.17 Markov Chains

Consider a Markov chain X 0 , X 1 ,... with transition matrix Q = (q (^) ij ), and let v be a row vector listing the initial probabilities of being in each state. Then vQ n^ is the row vector listing the probabilities of being in each state after n steps, i.e., the jth component is P (X (^) n = j).

A vector s of probabilities (adding to 1) is stationary for the chain if sQ = s; by the above, if a chain starts out with a stationary distribution then the distribution stays the same forever. Any irreducible Markov chain has a unique stationary distribution s, and the chain converges to it: P (X (^) n = i)! s (^) i as n! 1.

If s is a vector of probabilities (adding to 1) that satisfies the reversibility condition s (^) i q (^) ij = s (^) j q (^) ji for all states i, j, then it automatically follows that s is a stationary distribution for the chain; not all chains have this condition hold, but for those that do it is often easier to show that s is stationary using the reversibility condition than by showing sQ = s.

6 Common Mistakes in Probability

6.1 Category errors

A category error is a mistake that not only happens to be wrong, but also it is wrong in every possible universe. If someone answers the question “How many students are in Stat 110?” with “10, since it’s one ten,” that is wrong (and a very bad approxima- tion to the truth); but there is no logical reason the enrollment couldn’t be 10, aside from the logical necessity of learning probability for reasoning about uncertainty in the world. But answering the question with “-42” or “⇡” or “pink elephants” would be a category error. To help avoid being categorically wrong, always think about what type an answer should have. Should it be an integer? A nonnegative integer? A number between 0 and 1? A random variable? A distribution?

  • Probabilities must be between 0 and 1. Example: When asked for an approximation to P (X > 5) for a certain r.v. X with mean 7, writing “P (X > 5) ⇡ E(X)/5.” This makes two mis- takes: Markov’s inequality gives P (X > 5)  E(X)/5, but this is an upper bound, not an approximation; and here E(X)/5 = 1. 4 , which is silly as an approximation to a probability since 1. 4 > 1.
  • Variances must be nonnegative. Example: For X and Y independent r.v.s, writing that “Var(X Y ) = Var(X) Var(Y )”, which can immediately be seen to be wrong from the fact that it becomes negative if Var(Y ) > Var(X) (and 0 if X and Y are i.i.d.). The correct formula is Var(X Y ) = Var(X) + Var(Y ) 2Cov(X, Y ), which is Var(X) + Var(Y ) if X and Y are uncorrelated.
  • Correlations must be between 1 and 1. Example: It is common to confuse covariance and correlation; they are related by Corr(X, Y ) = Cov(X, Y )/(SD(X)SD(Y )), which is between -1 and 1.
  • The range of possible values must make sense. Example: Two people each have 100 friends, and we are interested in the dis- tribution of X = (number of mutual friends). Then writing “X ⇠ N (μ, 2 )” doesn’t make sense since X is an integer (sometimes we use the Normal as an approximation to, say, Binomials, but exact answers should be given unless an approximation is specifically asked for); “X ⇠ Pois()” or “X ⇠ Bin(500, 1 /2)” don’t make sense since X has possible values 0, 1 ,... , 100.

Example: If X 1 ⇠ Geom(1/2), then 2 E(X)^ = 4, but E(2 X^ ) is infinite (as in the St. Petersburg Paradox), so confusing the two is infinitely wrong. In general, if g is convex then Jensen’s inequality says that E(g(X)) g(EX).

  • An event is not a random variable. Example: If A is an event and X is an r.v., it does not make sense to write “E(A)” or “P (X)”. There is of course a deep connection between events and r.v.s, in that for any event A there is a corresponding indicator r.v. I (^) A , and given an r.v. X and a number x, we have events X = x and X  x.
  • Dummy variables in an integral can’t make their way out of the integral. Example:R In LOTUS for a r.v. X with PDF f , the letter x in E(g(X)) = 1 1 g(x)f^ (x)dx^ is a dummy variable; we could just as well write^

R 1

1 g(t)f^ (t)dt or

R 1

1 g(u)f^ (u)du^ or even^

R 1

1 g(^2 )f^ (^2 )d^2 , but the^ x^ (or whatever this dummy variable is called) can’t migrate out of the integral.

  • A random variable is not the same thing as its distribution! See Section 6.4.
  • The conditional expectation E(Y |X) must be a function of X (possibly a con- stant function, but it must be computable just in terms of X). See Section 6.5.

6.2 Notational paralysis

Another common mistake is a reluctance to introduce notation. This can be both a symptom and a cause of not seeing the structure of a problem. Be sure to define your notation clearly, carefully distinguishing between constants, random variables, and events.

  • Give objects names if you want to work with them. Example: Suppose that we are interested in a LogNormal r.v. X (so log(X) ⇠ N (μ, 2 ) for some μ, 2 ). Then log(X) is clearly an important object, so we should give it a name, say Y = log(X). Then, X = e Y^ and, for example, we can easily obtain the moments of X using the MGF of Y.

Example: Suppose that we want to show that

E(cos 4 (X 2 + 1)) (E(cos 2 (X 2 + 1))) 2.

The essential pattern is that there is a r.v. on the right and its square on the left; so let Y = cos^2 (X 2 + 1), which turns the desired inequality into the statement E(Y 2 ) (EY ) 2 , which we know is true because variance is nonnegative.

  • Introduce clear notation for events and r.v.s of interest.

Example: In the Calvin and Hobbes problem (from HW 3 and the final from 2010), clearly the event “Calvin wins the match” is important (so give it a name) and the r.v. “how many of the first two games Calvin wins” is important (so give it a name). Make sure that events you define really are events (they are subsets of the sample space, and it must make sense to talk about whether the event occurs) and that r.v.s you define really are r.v.s (they are functions mapping the sample space to the real line, and it must make sense to talk about their distributions and talk about them as a numerical summary of some aspect of the random experiment).

  • Think about location and scale when applicable. Example: If Y (^) j ⇠ Expo(), it may be very convenient to work with X (^) j = Y (^) j , which is Expo(1). In studying X ⇠ N (μ, 2 ), it may be very convenient to write X = μ + Z where Z ⇠ N (0, 1) is the standardized version of X.

6.3 Common sense and checking answers

Whenever possible (i.e., when not under severe time pressure), look for simple ways to check your answers, or at least to check that they are plausible. This can be done in various ways, such as using the following methods.

  1. Miracle checks. Does your answer seem intuitively plausible? Is there a cat- egory error? Did asymmetry appear out of nowhere when there should be symmetry?
  2. Checking simple and extreme cases. What is the answer to a simpler version of the problem? What happens if n = 1 or n = 2, or as n! 1, if the problem involves showing something for all n?
  3. Looking for alternative approaches and connections with other problems. Is there another natural way to think about the problem? Does the problem relate to other problems we’ve seen?
  • Probability is full of counterintuitive results, but not impossible results! Example: Suppose that we have P (snow Saturday) = P (snow Sunday) = 1 /2. Then we can’t say “P (snow over the weekend) = 1”; clearly there is some chance of no snow, and of course the mistake is to ignore the need for disjointness.
  • Check that PMFs are nonnegative and sum to 1, and PDFs are nonnegative and integrate to 1 (or that it is at least plausible), when it is not too messy. Example: Writing that the PDF of X is “f (x) = 15 e ^5 x^ for all x > 0 (and 0 otherwise)” is immediately seen to be wrong by integrating (the constant in front should be 5, which can also be seen by recognizing this as an Expo(5). Writing that the PDF is “f (x) = 1+e^ x 1+x for all^ x >^ 0 (and 0 otherwise)” doesn’t make sense since even though the integral is hard to do directly, clearly 1+e x 1+x >^

1 1+x , and^

R 1

0

1 1+x dx^ is infinite.

Example: Consider the following problem: “You are invited to attend 6 wed- dings next year, independently with all months of the year equally likely. What is the probability that no two weddings are in the same month?” A common mistake is to treat the weddings as indistinguishable. But no matter how generic and cliched weddings can be sometimes, there must be some way to distinguish two weddings! It often helps to make up concrete names, e.g., saying “ok, we need to look at the possible schedulings of the weddings of Daenerys and Drogo, of Cersei and Robert,... ”. There are 12 6 equally likely possibilities and, for example, it is much more likely to have 1 wedding per month in January through June than to have all 6 weddings in January (whereas treating weddings as indistinguishable would suggest having these be equal).

6.4 Random variables vs. distributions

A random variable is not the same thing as its distribution! We call this confusion sympathetic magic, and the consequences of this confusion are often disastrous. Every random variable has a distribution (which can always be expressed using a CDF, which can be expressed by a PMF in the discrete case, and which can be expressed by a PDF in the continuous case). Every distribution can be used as a blueprint for generating r.v.s (for example, one way to do this is using Universality of the Uniform). But that doesn’t mean that doing something to a r.v. corresponds to doing it to the distribution of the r.v. Confusing a distribution with a r.v. with that distribution is like confusing a map of a city with the city itself, or a blueprint of a house with the house itself. The word is not the thing, the map is not the territory.

  • A function of a r.v. is a r.v.

Example: Let X be discrete with possible values 0, 1 , 2 ,... and PMF p (^) j = P (X = j), and let Y = X + 3. Then Y is discrete with possible values 3 , 4 , 5 ,... , and its PMF is given by P (Y = k) = P (X = k 3) = p (^) k 3 for k 2 { 3 , 4 , 5 ,... }. In the continuous case, if Y = g(X) with g di↵erentiable and strictly increasing, then we can use the change of variables formula to find the PDF of Y from the PDF of X. If we only need E(Y ) and not the distribution of Y , we can use LOTUS. A common mistake is not seeing why these transformations of X are themselves r.v.s and how to handle them.

Example: For X, Y i.i.d., writing that “E max(X, Y ) = EX since max(X, Y ) is either X or Y , both of which have mean EX”; this misunderstands how and why max(X, Y ) is a r.v. Of course, we should have E max(X, Y ) EX since max(X, Y ) X.

  • Avoid sympathetic magic. Example: Is it possible to have two r.v.s X, Y which have the same distribu- tion but are never equal, i.e., the event X = Y never occurs?

Example: In finding the PDF of XY , writing something like “f (^) X (x)f (^) Y (y).” This is a category error since if we let W = XY , we want a function f (^) W (w), not a function of two variables x and y. The mistake is in thinking that the PDF of the product is the product of the PDFs, which comes from not understanding well what a distribution really is.

Example: For r.v.s X and Y with PDFs f (^) X and f (^) Y respectively, the event {X < Y } is very di↵erent conceptually from the inequality f (^) X < f (^) Y. In fact, it is impossible that for all t, f (^) X (t) < f (^) Y (t), since both sides integrate to 1.

  • A CDF F (x) = P (X  x) is a way to specify the distribution of X, and is a function defined for all real values of x. Here X is the r.v., and x is any number; we could just as well have written F (t) = P (X  t). Example: Why must a CDF F (x) be defined for all x and increasing every- where, and why is it not true that a CDF integrates to 1?

6.5 Conditioning

It is easy to make mistakes with conditional probability so it is important to think carefully about what to condition on and how to carry that out. Conditioning is the soul of statistics.