STOR 435 Midterm 2 Study Guide
Bayes and independence · Random variables · The famous distributions · Joint distributions and covariance · Normal, limit theorems and inequalities
Download the guide as PDF · Follow-along worksheet PDF (write-in boxes + answer key) · Midterm 1 guide
0. Before you start
What is in scope
The syllabus listed slide decks 5–8, possibly some of 9. Two things settle it: the instructor has confirmed that deck 9 is not on the midterm, and her own STOR 435 Study Guide: Lectures 5–8 lists exactly what is. That scope is decks 5–8, which runs from conditional probability through the Normal distribution and ends, at the back of deck 8, with the central limit theorem, the law of large numbers and the Markov and Chebyshev inequalities (the syllabus had filed those under deck 9, but the slides and the official guide put them in deck 8). Deck 9 proper is jointly continuous random variables, which is left out. The homework is the best map of what will be asked, because the quizzes and exams follow the homework.
| Deck | Classes | Topics | Homework | Guide |
|---|---|---|---|---|
| 5 | Sept 10, 15 | Law of total probability, Bayes' formula, independence, independent trials, first-step analysis | HW5 (end), HW6 | §2–3 |
| 6 | Sept 24 – Oct 8 | Random variables; pmf, cdf, pdf; expectation, variance; moment generating functions; Binomial, Poisson and the Poisson process; Uniform, Exponential | HW7, HW8 | §4–10 |
| 7 | Oct 13, 20 | Geometric distribution; joint cdf and pmf, marginals; expectation of sums; indicators (coat matching, coupon collector); multinomial | HW9 | §11 |
| 8 | Oct 22, 27, 29, Nov 3 | Independent random variables; sums via convolution and MGFs; covariance, variance of sums, correlation; the Normal distribution; CLT and the normal approximation; law of large numbers; Markov and Chebyshev | HW9, HW10 | §12–14 |
Sources: the filled-in and in-class-annotated slides for decks 5–8, Homeworks 6–10, the posted Midterm 2 practice problems, and the instructor's Lectures 5–8 Study Guide. Every result that guide marks with its warning sign is in a blue box here, with the explanation and the worked slide examples the guide itself leaves out.
How to use this guide
- It assumes you missed class. Every section starts from the definition and builds up. Blue boxes are the formulas and facts you must know cold. Orange boxes are the mistakes that cost points. Green boxes say how a question is likely to be phrased.
- Every homework problem is worked here, inside the section that teaches the idea it needs. The in-class quizzes were variants of the homework, and the exam will be too.
- Do each "Check yourself" with pen and calculator before opening the answer. On the exam you need the actual number to four decimals, not just the setup.
- Section 16 is the posted practice set, fully worked, followed by a second practice exam in the same style. Section 17 is a one-page distribution table and formula sheet for the night before.
- The worksheet PDF is the same text with every answer replaced by a ruled box, and all answers collected in a key at the end. Print it if you learn by writing.
If you have one day
- Section 1 (30 minutes): make sure the series, integrals and Midterm 1 facts are at your fingertips.
- Sections 2–3 (45 minutes): total probability, Bayes, independence. Do every Check-yourself.
- Sections 4–7 (90 minutes): random variables, pmf/cdf/pdf, expectation and variance, MGFs. This is the core vocabulary; everything after it is applications.
- Sections 8–10 (90 minutes): Binomial, Poisson, Uniform, Exponential. Learn the distribution table in section 17 as you go.
- Sections 11–14 (90 minutes): geometric, joint distributions, indicators, covariance, Normal, CLT and the inequalities.
- Section 16 Part A (75 minutes, timed): the posted practice problems. Then read every solution, including the ones you got right.
- Section 17 before bed and again before the exam.
With two days, add Part B of section 16 on day two and redo every Check-yourself you got wrong.
1. The toolkit: what you need from before
Midterm 2 uses the Midterm 1 material constantly, and from section 5 onward it uses calculus. This section is the minimum. If any line here looks unfamiliar, fix that first; everything later assumes it.
1.1 Probability facts from Midterm 1
- Sample space S is the set of all outcomes; an event is a subset. P(S) = 1, 0 ≤ P(E) ≤ 1, and for disjoint events probabilities add.
- Complement: P(Ec) = 1 − P(E). "At least one" is almost always 1 − P(none).
- Inclusion–exclusion: P(E ∪ F) = P(E) + P(F) − P(E ∩ F).
- Equally likely outcomes: P(E) = (number of outcomes in E)/(number in S). Count both at the same level (ordered with ordered, unordered with unordered).
- Counting: n! orderings of n things; (nr) = n!r!(n−r)! ways to choose r of n; n!/(n1!···nr!) ways to split n things into labeled groups.
- Conditional probability: P(E | F) = P(E ∩ F)P(F), so P(E ∩ F) = P(F) P(E | F). Given F, the sample space shrinks to F.
- Multiplication rule for a chain: P(E1 ∩ E2 ∩ E3) = P(E1) P(E2 | E1) P(E3 | E1 ∩ E2).
- De Morgan: (E ∪ F)c = Ec ∩ Fc and (E ∩ F)c = Ec ∪ Fc. "Not (at least one)" = "none".
1.2 Series you must recognize on sight
Geometric: 1 + x + x2 + ··· = 11 − x for |x| < 1; starting at xk: xk1 − x; finite: 1 + x + ··· + xn = 1 − xn+11 − x.
Exponential: Σk=0∞ xkk! = ex for every x.
Binomial theorem: (a + b)n = Σk=0n (nk) ak bn−k.
Limit: (1 + xn)n → ex as n → ∞, so (1 − λn)n → e−λ.
Why these four: the geometric series is how you sum "first success on trial k" probabilities (section 3 and section 11). The exponential series is why the Poisson probabilities add to 1 and where the Poisson MGF comes from (section 9). The binomial theorem is why the Binomial probabilities add to 1 and gives the Binomial MGF (section 8). The limit is how the Binomial turns into the Poisson.
1.3 Calculus you must do fast
- ddt eat = a eat; ddt eg(t) = g′(t) eg(t) (chain rule). Example: ddt eλ(et − 1) = λet eλ(et − 1).
- ddt (q + pet)n = n(q + pet)n−1 · pet.
- Product rule: (uv)′ = u′v + uv′. You need it for second derivatives of MGFs (section 7).
- Fundamental theorem: dda ∫−∞a f(x) dx = f(a). That is why the pdf is the derivative of the cdf (section 5).
- ∫ab c dx = c(b − a). ∫ xn dx = xn+1n+1 (n ≠ −1). ∫a∞ x−n dx = a1−nn − 1 for n > 1.
- ∫0a λe−λx dx = 1 − e−λa; ∫a∞ λe−λx dx = e−λa.
- Integration by parts, ∫ u dv = uv − ∫ v du, gives ∫0∞ x λe−λx dx = 1λ and ∫0∞ x2 λe−λx dx = 2λ2. In general ∫0∞ xn e−x dx = n!.
- ∫−∞∞ e−x2/2 dx = √(2π). This single fact is why the Normal density has the constant it has.
- An even function (f(−x) = f(x)) integrates to twice the right half; an odd function integrates to 0 over a symmetric interval.
Worked integral. ∫0∞ x λe−λx dx with u = x, dv = λe−λx dx, so du = dx, v = −e−λx: uv from 0 to ∞ is 0 (x e−λx → 0), and −∫ v du = ∫0∞ e−λx dx = 1/λ. This is the mean of the Exponential (section 10).
1.4 Calculator habits
- Keep four decimals until the end; round only the final number. Interval answers are usually generous, but (0.25, 0.4] versus (0.4, 0.5] hinges on the fourth decimal sometimes.
- Know where nCr, x!, ex and ln are on your calculator. 0! = 1 and e0 = 1.
- Powers like 0.9510 are fine on the calculator; 365! is not. Multiply fractions one at a time.
- Have ready: e−1 = 0.3679, e−2 = 0.1353, e−3 = 0.0498, e−4 = 0.0183, e−5 = 0.0067, ln 2 = 0.6931, √(2π) = 2.5066, √(2/π) = 0.7979.
1.5 Check yourself
Answer
Starts at k = 3: 0.83/(1 − 0.8) = 0.512/0.2 = 2.56.Answer
e−2 · e2 = 1. (These are the Poisson(2) probabilities; they add to 1.)Answer
3000 · 10−3/3 = 3000/3000 = 1. (So 3000/x4 on x ≥ 10 is a valid density; HW10 problem 3.)Answer
M′(t) = 4(0.7 + 0.3et)3 · 0.3et; M′(0) = 4 · 1 · 0.3 = 1.2. (The mean of a Binomial(4, 0.3).)Answer
P(A ∩ B) = 0.6 · 0.5 = 0.30. P(B) = 0.30 + 0.4 · 0.2 = 0.38.Answer
e−3 ≈ 0.0498, and 0 (a fixed base below 1 raised to a growing power).Answer
0: the integrand is odd and the interval is symmetric. (This is why a standard Normal has mean 0.)Deck 52. Total probability and Bayes' formula
The idea. Many probabilities are easiest to compute by splitting the world into cases ("does she have the disease or not?", "which bus did I take?"), computing the probability inside each case, and averaging with the case probabilities. That is the law of total probability. Bayes' formula is the same computation read backwards: it turns "probability of the evidence given the cause" into "probability of the cause given the evidence", which is what a doctor, a juror or a spam filter actually wants.
2.1 The law of total probability
P(E) = P(E ∩ F) + P(E ∩ Fc) = P(E | F) P(F) + P(E | Fc) P(Fc).
Either F happens or it does not, and the two pieces of E do not overlap.P(E) = Σi=1n P(E ∩ Fi) = Σi=1n P(E | Fi) P(Fi).
The two-case formula is n = 2 with F1 = F, F2 = Fc.The recipe the slides use every time: name the events first, write the formula in symbols, and only then plug in numbers. Most errors in this topic come from plugging numbers into the wrong slots.
Example: mammograms (slides). In the population described, 0.8% of women have breast cancer. A woman with cancer has a positive mammogram with probability 0.90; a woman without cancer, with probability 0.07. Let C = has cancer, T = positive test. The cases are C and Cc:
P(T) = P(T | C) P(C) + P(T | Cc) P(Cc) = 0.90(0.008) + 0.07(0.992) = 0.0072 + 0.06944 = 0.07664.
About 7.7% of these women test positive, and most of those positives (0.069 of the 0.077) come from women without cancer.
Example: triage (slides). 15% of ER patients are critical, 45% serious, 40% stable. Death rates are 50%, 20% and 2%. With D = dies,
P(D) = 0.50(0.15) + 0.20(0.45) + 0.02(0.40) = 0.075 + 0.09 + 0.008 = 0.173, so P(survives) = 0.827.
Example: grad school (slides). Eva gets into school A, B or C with probabilities 0.20, 0.40, 0.40, and the chances of a great job J afterwards are 0.95, 0.75, 0.05. Then P(J) = 0.95(0.20) + 0.75(0.40) + 0.05(0.40) = 0.19 + 0.30 + 0.02 = 0.51.
Example: the class-selection problem (slides). A class has 24 students; 6 have already been called on. Today a first group of 3 is picked at random, then a second group of 3 is picked at random (from all 24, so it may overlap anything). Find P(N), where N = the second group contains nobody from the original 6 and nobody from the first group.
The difficulty: how many students are "already chosen" when the second group is drawn depends on how much the first group overlapped the original 6. So condition on that. Let Aj = the first group contains exactly j of the original 6, j = 0, 1, 2, 3. These four events partition the sample space.
- P(Aj) = (6j)(183−j)(243) (choose j from the 6 and 3 − j from the other 18; (243) = 2024).
- Given Aj, the number of distinct already-chosen students is 6 + 3 − j = 9 − j, so the second group must come from the other 15 + j: P(N | Aj) = (15+j3)(243).
- P(N) = Σj=03 P(N | Aj) P(Aj) ≈ 0.2649. So P(at least one overlap) = 1 − 0.2649 = 0.7351.
Shortcut check from the slides: choose the second group first. It must avoid the original 6, (183) ways; then the first group can be any 3 of the remaining 21 students, (213) ways; so P(N) = (183)(213)/(243)2 = 816 · 1330/20242 ≈ 0.2649. Same answer, no conditioning needed. On an exam, use whichever you see first, but know that "condition on the first stage" always works.
2.2 Bayes' formula: flipping the condition
P(F | E) = P(E ∩ F)P(E) = P(E | F) P(F)P(E | F) P(F) + P(E | Fc) P(Fc).
With a partition F1, …, Fn:P(Fj | E) = P(E | Fj) P(Fj)Σi=1n P(E | Fi) P(Fi).
Top: the one case you are asking about. Bottom: the total probability of the evidence E, which is exactly the formula of 2.1.There is nothing new to memorize: Bayes is the definition of conditional probability, P(F | E) = P(F ∩ E)/P(E), with the numerator written as P(E | F) P(F) by the multiplication rule and the denominator expanded by total probability.
Example: mammograms, continued. A woman from this population tests positive. The chance she has cancer is
P(C | T) = P(T | C) P(C)P(T) = 0.90(0.008)0.07664 = 0.00720.07664 ≈ 0.094.
About 9%, even though the test catches 90% of cancers. When Gigerenzer asked 24 doctors this question, their answers ranged from 1% to 90%. The reason the correct answer is small: cancer is rare here, so the 7% false-positive rate applied to the large healthy group produces far more positives than the 90% true-positive rate applied to the small cancer group.
Example: HIV test in a low-risk group (slides, from Calculated Risks). P(HIV) = 0.0001; P(positive | HIV) = 0.999; P(negative | no HIV) = 0.9999, so P(positive | no HIV) = 0.0001. Then
P(H | T) = 0.999(0.0001)0.999(0.0001) + 0.0001(0.9999) = 0.00009990.0000999 + 0.00009999 ≈ 0.50.
A positive result in this population is a coin flip, which is why a confirmatory test is always run. The slides' story of Betty (told she was HIV positive, two years of medication, then a negative retest and a $600,000 jury award) is the human cost of forgetting this.
Example: grad school, continued. Given that Eva has a great job, the chance she went to A is P(A | J) = 0.95(0.20)0.51 = 0.190.51 ≈ 0.373.
Example: a negative test (practice set, problem 5). 40% of adults are addicted to the Internet. A scan is positive for 70% of addicted adults and for 20% of non-addicted adults. Someone tests negative; chance they are addicted? The evidence is now "negative", so use P(negative | addicted) = 0.3 and P(negative | not) = 0.8:
P(addicted | negative) = 0.4(0.3)0.4(0.3) + 0.6(0.8) = 0.120.60 = 0.20.
2.3 Natural frequencies: Bayes without the formula
The slides recommend the way doctors are now taught: imagine a large population and count. For the HIV example, take 100,000 low-risk men.
| Have HIV | No HIV | Total | |
|---|---|---|---|
| Test positive | ≈ 10 (99.9% of 10) | ≈ 10 (0.01% of 99,990) | ≈ 20 |
| Test negative | ≈ 0 | ≈ 99,980 | ≈ 99,980 |
| Total | 10 | 99,990 | 100,000 |
Among the roughly 20 positives, 10 are real: P(HIV | positive) ≈ 10/20 = 50%. For the mammogram: 100,000 women, 800 with cancer of whom 720 test positive; 99,200 without cancer of whom 6,944 test positive; 720/(720 + 6,944) = 0.094. Use this to sanity-check any Bayes computation: if the counts and the formula disagree, one of them has a slot filled wrong.
2.4 Two courtroom lessons from the slides
Sally Clark. After two of her sons died of SIDS, a pediatrician testified that the chance of two SIDS deaths in an affluent family was (1/8500)2 = 1 in 72 million. Two things are wrong. Multiplying treats the deaths as independent, ignoring shared genes, environment and medical factors (section 3). Worse, the court was told P(two deaths | innocent) when the question was P(innocent | two deaths); a tiny probability of the evidence under one explanation says nothing by itself about the probability of that explanation. She was convicted in 1999 and released in 2003.
O.J. Simpson. The defense argued that fewer than 1 in 2500 battered women are killed by their partner, so battery is a poor predictor of murder. But the woman in question had been murdered. Let B = battered, M = murdered, Mp = murdered by the partner, M* = murdered by someone else. The relevant quantity is
P(Mp | B ∩ M) = P(Mp ∩ B)P(Mp ∩ B) + P(M* ∩ B) = P(Mp | B)P(Mp | B) + P(M* | B) = 1/25001/2500 + 5/100,000 = 89 ≈ 88%,
using the FBI figure that about 5 in 100,000 women are murdered by someone other than a partner. The slides are careful: this is a statement about the calculation, not about the verdict. The exam lesson is the same as in the Clark case: conditioning on all the evidence changes the answer completely.
2.5 Check yourself
Answer
0.5(0.4) + 0.4(0.2) + 0.1(0.1) = 0.20 + 0.08 + 0.01 = 0.29, in (0.275, 1.0].Answer
Exactly one = (John, not Joe) or (not John, Joe): 0.65(0.2) + 0.35(0.45) = 0.13 + 0.1575 = 0.2875, in (0, 0.35].Answer
A YES needs heads and an honest filer: P(YES) = 0.5 · P(honest) = 0.45, so P(honest) = 0.9 and 10% file fraudulently.Answer
P(red) = 0.5(0.6) + 0.5(0.2) = 0.4. P(I | red) = 0.5(0.6)/0.4 = 0.75.Answer
P(defective) = 0.01 + 0.009 + 0.01 = 0.029. P(A | defective) = 0.01/0.029 ≈ 0.3448.Answer
0.999(0.05)/[0.999(0.05) + 0.0001(0.95)] = 0.04995/0.050045 ≈ 0.9981. Same test, different base rate, completely different meaning of a positive result.Answer
P(reply) = 0.5(0.3)(0.3) + 0.5(0.5)(0.8) = 0.045 + 0.20 = 0.245. P(Section 1 | reply) = 0.045/0.245 ≈ 0.1837.Answer
P(A0) = (183)/(243) = 816/2024 ≈ 0.4032. P(N | A0) = (153)/(243) = 455/2024 ≈ 0.2248.Deck 53. Independence and independent trials
The idea. Two events are independent when learning that one happened tells you nothing about the other. Independence is what lets you multiply probabilities, and almost every distribution in this course (Binomial, Poisson, Geometric) is built from independent repetitions of a simple experiment. It is a property you check or assume, not a feeling that two things are "unrelated".
3.1 Definition
P(E ∩ F) = P(E) P(F).
When P(E) > 0 and P(F) > 0 this is the same as P(E | F) = P(E) and P(F | E) = P(F): conditioning on one does not change the other.Why the two versions agree: if P(E ∩ F) = P(E)P(F) then P(E | F) = P(E ∩ F)/P(F) = P(E)P(F)/P(F) = P(E). Conversely, multiply P(E | F) = P(E) by P(F). The product form is the official definition because it also works when a probability is 0.
- Two coin tosses. E = first is H, F = second is T. S = {HH, HT, TH, TT}; E ∩ F = {HT}; P(E ∩ F) = 1/4 = (1/2)(1/2). Independent.
- One card. E = club, F = a 6. P(E ∩ F) = 1/52 = (1/4)(1/13). Independent: the suit tells you nothing about the rank.
- Two dice, F = first die is 4 (P = 1/6). E1 = sum is 6: P(E1) = 5/36 and E1 ∩ F = {(4, 2)} has probability 1/36, but (5/36)(1/6) = 5/216 ≠ 1/36. Not independent. E2 = sum is 7: P(E2) = 6/36 = 1/6, E2 ∩ F = {(4, 3)}, and (1/6)(1/6) = 1/36. Independent. Changing the target from 6 to 7 changes the answer; you must check.
3.2 Complements, and the disjoint trap
3.3 Three or more events
P(E ∩ F) = P(E)P(F), P(E ∩ G) = P(E)P(G), P(F ∩ G) = P(F)P(G), P(E ∩ F ∩ G) = P(E)P(F)P(G).
For n events: the probability of every sub-collection's intersection is the product of the probabilities. Then any events built from disjoint groups of them are independent: E and F ∪ G; Ec, Fc and Gc; E1 ∩ E2 and E3c ∩ E4; and so on.Why E is independent of F ∪ G (slides): P(E ∩ (F ∪ G)) = P(E ∩ F) + P(E ∩ G) − P(E ∩ F ∩ G) = P(E)[P(F) + P(G) − P(F)P(G)] = P(E)P(F ∪ G).
HW6 problem 3. E1, E2, E3 independent. P(E1 | E2 ∩ E3) = P(E1), because E1 is independent of E2 ∩ E3 (built from the other two).
HW6 problem 4. A, B, C independent with P(A) = 2/3, P(B) = 3/4, P(C) = 1/5.
- P(A ∩ Bc ∩ Cc) = (2/3)(1/4)(4/5) = 8/60 = 2/15 ≈ 0.1333.
- P(exactly one occurs) = P(A Bc Cc) + P(Ac B Cc) + P(Ac Bc C) = 8/60 + (1/3)(3/4)(4/5) + (1/3)(1/4)(1/5) = 8/60 + 12/60 + 1/60 = 21/60 = 0.35.
HW6 problem 5. E, F, G independent with probabilities 0.2, 0.3, 0.1. P(E ∪ Fc ∪ G) = 1 − P(Ec ∩ F ∩ Gc) = 1 − (0.8)(0.3)(0.9) = 1 − 0.216 = 0.784. Unions of independent events: go through the complement (De Morgan), then multiply.
Practice set, problem 4. E, F, G, H, I independent with probabilities 0.2, 0.3, 0.1, 0.4, 0.5. P((E ∪ Fc ∪ G) ∩ H | I): the event is built from E, F, G, H only, so it is independent of I and the conditioning does nothing. Then (E ∪ Fc ∪ G) and H are independent (disjoint groups), so the answer is 0.784 × 0.4 = 0.3136, in (0.25, 0.5].
3.4 Independent trials
HW6 problem 7. A coin with P(H) = 1/3 is flipped 10 times; Ei = toss i is H. The event "first 6 heads, next 4 tails" is F = E1 ∩ ··· ∩ E6 ∩ E7c ∩ ··· ∩ E10c, and P(F) = (1/3)6(2/3)4 ≈ 0.00027.
HW6 problem 8(1). Eva botches each order with probability 1/2, independently. P(first 10 correct, 11th wrong) = (1/2)10(1/2) = (1/2)11. (This is the Geometric distribution of section 11 in disguise.)
HW6 problem 8(2): the race. Tim errs with probability 1/6, Eva with 1/2, per customer, independently. Eva takes the trip if she errs strictly before Tim does (a tie means the game stops and Eva stays). For Eva to lose on customer n, both must be perfect on customers 1 to n − 1, probability [(1/2)(5/6)]n−1 = (5/12)n−1, then Eva errs and Tim does not, probability (1/2)(5/6) = 5/12:
P(Eva takes the trip) = Σn=1∞ (5/12)n−1 (5/12) = 5/121 − 5/12 = 57 ≈ 0.7143.
By the same method P(Tim first) = (1/12)/(7/12) = 1/7 and P(tie) = (1/12)/(7/12) = 1/7, and 5/7 + 1/7 + 1/7 = 1. Any "who fails first" question is a geometric series: (probability nothing decisive happens)n−1 × (probability of the decisive outcome).
HW6 problem 9. Roll two dice repeatedly; En = no 3 or 5 on the first n − 1 rolls and a 3 on roll n. P(sum 3) = 2/36 = 1/18, P(sum 5) = 4/36, P(neither) = 1 − 6/36 = 5/6. So P(En) = (5/6)n−1(1/18). E4 and E5 are disjoint (E5 requires no 3 on roll 4, E4 requires a 3 there), so P(E4 ∪ E5) = (5/6)3(1/18) + (5/6)4(1/18) ≈ 0.0589: option (E). Options with a subtracted product are wrong because there is no overlap to remove, and options with factors 3 and 4 in front count the trials incorrectly.
Example: the flat tire (slides). Four friends independently name which of four tires went flat. Donatello and Michelangelo pick uniformly (1/4 each). Leonardo picks each left tire with twice the probability of each right tire: 2q + 2q + q + q = 1 gives q = 1/6, so left tires 1/3 each, right tires 1/6 each. Raphael is the mirror image. For any fixed tire the four answers agree with probability (1/4)(1/4)(1/3)(1/6) = 1/288, because one biased friend contributes 1/3 and the other 1/6 whichever tire it is. Four tires: P(all match) = 4/288 = 1/72. The structure the slides stress: first a sum over disjoint cases, then independence inside each case.
3.5 First-step analysis: "which happens first?"
Example: 5 before 7 (slides). Roll two dice repeatedly. P(a sum of 5 appears before a sum of 7)? Let p be this probability and condition on the first roll: sum 5 (probability 4/36), sum 7 (6/36), or neither (26/36). If neither, the game restarts from scratch, so the conditional probability is p again:
p = 1 · 436 + 0 · 636 + p · 2636, so p(1 − 2636) = 436, p = 410 = 25.
Alternating turns (practice set, problem 3). A rolls a 4-sided and a 6-sided die aiming for sum 3 (outcomes (1,2), (2,1): pA = 2/24 = 1/12); then B rolls aiming for sum 4 ((1,3), (2,2), (3,1): pB = 3/24 = 1/8); they alternate until someone succeeds. Condition on the first round: A wins immediately with probability pA; otherwise, if B also fails, the game restarts:
p = pA + (1 − pA)(1 − pB) p, so p = pA1 − (1 − pA)(1 − pB) = 1/121 − (11/12)(7/8) = 1/1219/96 = 819 ≈ 0.4211,
in (0.25, 0.45]. Going first is worth something but A's target is harder, so A is still the underdog.
3.6 Check yourself
Answer
P(E ∪ F) = 0.4 + 0.5 − 0.2 = 0.7. P(Ec ∩ Fc) = 0.6 · 0.5 = 0.3 (= 1 − 0.7). Exactly one: 0.4 · 0.5 + 0.6 · 0.5 = 0.5.Answer
First pair: disjoint (P(E ∩ F) = 0 ≠ 1/4). Second pair: independent (1/4 = 1/2 · 1/2).Answer
2/15 ≈ 0.1333 and 21/60 = 0.35 (worked in 3.3).Answer
1 − 0.13 = 0.999; 0.93 = 0.729; 3 · 0.92 · 0.1 = 0.243.Answer
1 − P(Ec ∩ F ∩ Gc) = 1 − 0.8 · 0.3 · 0.9 = 0.784.Answer
P(4) = 3/36, P(8) = 5/36: 3/(3 + 5) = 0.375.Answer
Both perfect twice, then at least one errs: (5/12)2 (1 − 5/12) = (25/144)(7/12) ≈ 0.1013.Answer
Each specific sequence with 2 heads has probability (1/3)2(2/3)3; there are (52) = 10 of them: 10 · (1/9)(8/27) = 80/243 ≈ 0.3292. This is the Binomial pmf of section 8.Answer
p = (1/2)/(1 − (1/2)(1/2)) = (1/2)/(3/4) = 2/3.Answer
(5/6)3(1/18) + (5/6)4(1/18) ≈ 0.0589; the events are disjoint so nothing is subtracted.Deck 64. Random variables: pmf and cdf
The idea. A random variable is a number produced by a random experiment: the number of heads in three tosses, the largest ball drawn, the price of a stock next Monday at 9 a.m. The sample space might be hopelessly complicated (the state of the universe next Monday), but we only care about one measurement of it. From now on the course describes randomness through random variables and their distributions rather than through events and sample spaces, although every statement still is one.
4.1 Definition and the two types
- Example 1a. Toss 3 fair coins; Y = number of heads. Y takes values {0, 1, 2, 3}.
- Example 1b. Draw 3 balls without replacement from balls numbered 1 to 20; X = the largest number drawn. X takes values {3, 4, …, 20} (the largest of three distinct numbers is at least 3).
- Example 1c. Pick a point "at random" from [0, 1]; X = the point. X takes uncountably many values, and we will need a new way to describe it.
4.2 The probability mass function (discrete)
p(a) = P(X = a), with p(xi) ≥ 0, p(x) = 0 for every other x, and Σi p(xi) = 1.
The pmf characterizes X: to describe a discrete random variable, list its values and their probabilities. (From the margin of the slides: only countably many points can have p(x) > 0.)Example 1a worked. The 8 equally likely outcomes are HHH, HHT, HTH, THH, HTT, THT, TTH, TTT with Y = 3, 2, 2, 2, 1, 1, 1, 0. So p(0) = 1/8, p(1) = 3/8, p(2) = 3/8, p(3) = 1/8. Check: they add to 1.
Example 1b worked. All (203) = 1140 sets of three balls are equally likely. For the largest to equal k, ball k must be in the set and the other two must come from {1, …, k − 1}: (k−12) sets. So
P(X = k) = (k−12)(203), k = 3, 4, …, 20.
For instance P(X = 20) = (192)/1140 = 171/1140 = 0.15, and P(X = 3) = 1/1140.
HW7 problem 2: the second largest. Same urn, X = the second largest of the three numbers, values 2 to 19. For X = i you need one ball below i (i − 1 choices) and one above (20 − i choices):
p(i) = (i − 1)(20 − i)(203), i = 2, …, 19: option (D).
The wrong options have (i + 1) or (20 − i + 1), which would allow a ball to equal i twice. Sanity-check a formula at an edge: p(19) = 18 · 1/1140 (one ball must be ball 20, the other anything below 19); p(2) = 1 · 18/1140.
Biased coin (slides). Three tosses, P(H) = 1/4 on each, independent. Y = number of heads. Each sequence with k heads has probability (1/4)k(3/4)3−k and there are (3k) such sequences:
| k | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| p(k) = (3k)(1/4)k(3/4)3−k | 27/64 | 27/64 | 9/64 | 1/64 |
This is the Binomial(3, 1/4) distribution of section 8. Notice that "0 heads" and "1 head" are equally likely here, and that the values 0, 1, 2, 3 are certainly not equally likely.
HW7 problem 3 (a table). X takes values −1.3, 1.2, 2.7, 3.3, 9.8 with probabilities 0.1, 0.25, 0.35, 0.1, 0.2. A pmf given as a table is the most common exam format; the questions then ask for probabilities of ranges, the cdf at a point, or expectations (section 6).
4.3 The cumulative distribution function
F(x) = P(X ≤ x), −∞ < x < ∞.
F is non-decreasing, F(x) → 0 as x → −∞, F(x) → 1 as x → ∞, and F is right-continuous. For a discrete X, F is a staircase: flat between the possible values, jumping at each value xi by exactly p(xi). For a < b, P(a < X ≤ b) = F(b) − F(a).For the biased coin: F(x) = 0 for x < 0, 27/64 on [0, 1), 54/64 on [1, 2), 63/64 on [2, 3), and 1 for x ≥ 3. The value at a jump is the upper level (F(1) = 54/64 includes P(X = 1)).
- The locations of the jumps are the values X takes with positive probability.
- The size of each jump is the probability of that value.
HW7 problem 1. F(x) = 0 for x < −2.5; 2/12 on [−2.5, 0); 5/12 on [0, 1); 8/12 on [1, 6.5); 1 for x ≥ 6.5. Jumps: at −2.5 of size 2/12, at 0 of size 3/12, at 1 of size 3/12, at 6.5 of size 4/12. So the pmf is
| x | −2.5 | 0 | 1 | 6.5 |
|---|---|---|---|---|
| p(x) | 2/12 | 3/12 | 3/12 | 4/12 |
HW7 problem 3(a). For the table above, F(−1.5) = P(X ≤ −1.5) = 0, because the smallest value, −1.3, is larger than −1.5 (nothing sits at or below −1.5). And F(3.5) = 0.1 + 0.25 + 0.35 + 0.1 = 0.8: everything at or below 3.5, which excludes only the value 9.8. The cdf at a point that is not a possible value is just the running total of the pmf up to that point.
Practice set, problem 8 (reading a cdf graph). The graph of F is 0 left of −2, 0.1 on [−2, −0.75), 0.3 on [−0.75, 0), 0.6 on [0, 1), 0.8 on [1, 2), and 1 from 2 on. Jumps: 0.1 at −2, 0.2 at −0.75, 0.3 at 0, 0.2 at 1, 0.2 at 2. That is the pmf; the expected value (section 6) is then (−2)(0.1) + (−0.75)(0.2) + 0(0.3) + 1(0.2) + 2(0.2) = −0.2 − 0.15 + 0.2 + 0.4 = 0.25, in (0.2, 0.3].
4.4 Indicator random variables
4.5 Check yourself
Answer
P(X ≤ k) = (k/6)2 (both dice at most k), so P(X = k) = (k2 − (k − 1)2)/36 = (2k − 1)/36: 1/36, 3/36, 5/36, 7/36, 9/36, 11/36 for k = 1, …, 6.Answer
p(−2.5) = 2/12, p(0) = 3/12, p(1) = 3/12, p(6.5) = 4/12.Answer
(i − 1)(20 − i)/(203) for i = 2, …, 19: one ball below i, one above.Answer
F(1.5) = F(1) = 54/64. P(Y ≥ 2) = 10/64. P(0 < Y ≤ 2) = F(2) − F(0) = 63/64 − 27/64 = 36/64.Answer
P(X = k) = (1/2)k−1(1/2) = (1/2)k. P(X ≤ 3) = 1/2 + 1/4 + 1/8 = 7/8; P(X > 3) = 1/8 (three tails in a row).Answer
P(X = 0) = (482)/(522) = 1128/1326 ≈ 0.8507; P(X = 1) = 4 · 48/1326 ≈ 0.1448; P(X = 2) = 6/1326 ≈ 0.0045.Answer
F(1.2) = 0.1 + 0.25 = 0.35 (the jump at 1.2 is included). F(3.5) = 0.8. P(1 < X ≤ 3.3) = F(3.3) − F(1) = 0.8 − 0.1 = 0.7.Answer
0.6 + 0.1 = 0.7.Deck 65. Continuous random variables: pdf and cdf
The idea. A point chosen at random from [0, 1] has uncountably many possible values, so we cannot give each value a positive probability (they would add up to infinity). Instead we describe how probability is spread along the line with a density function, and probabilities of intervals are areas under it. Every discrete formula with a sum has a continuous twin with an integral.
5.1 The probability density function
P(X ∈ B) = ∫B f(x) dx.
In particular ∫−∞∞ f(x) dx = 1, P(a ≤ X ≤ b) = ∫ab f(x) dx, and P(X = a) = ∫aa f = 0.Uniform on [0, 1] (slides). We want every point in [0, 1] equally likely, so the density is a constant C on [0, 1] and 0 elsewhere. Since 1 = ∫01 C dx = C, the density is f(x) = 1 on [0, 1]. Then
- P(X > 0.25) = ∫0.251 1 dx = 0.75.
- P(0.5 ≤ X ≤ 1.7) = ∫0.51 1 dx = 0.5 (the density is 0 above 1).
- P(X = 0.787) = 0.
For a uniform variable, probability = length of the piece of the interval you are asking about, divided by the total length.
5.2 The cdf of a continuous variable
F(a) = P(X ≤ a) = ∫−∞a f(x) dx, and F′(a) = f(a) wherever F is differentiable.
F is a continuous function (no jumps, since no single value has positive probability). To go from cdf to pdf, differentiate; from pdf to cdf, integrate from −∞ (in practice from the left end of the support).Uniform on [0, 1]. F(x) = 0 for x < 0, F(x) = ∫0x 1 dt = x for 0 ≤ x ≤ 1, and F(x) = 1 for x > 1. Differentiating the middle piece gives back f = 1. A continuous, non-step cdf is the signature of a continuous random variable.
5.3 Finding the constant, then the probabilities
A density is often given as "c · (something)". The first step is always the same: set the total integral equal to 1 and solve for c. Three homework examples.
HW10 problem 3 (a power-law density). f(x) = c/x4 for x ≥ 10, else 0. These densities model wealth, city sizes and social networks.
- 1 = ∫10∞ c x−4 dx = c · 10−33 = c3000, so c = 3000.
- P(X > 20) = ∫20∞ 3000 x−4 dx = 3000 · 20−33 = 10008000 = 0.125.
(The mean and variance of this X are in section 6.)
HW10 problem 6 (a symmetric density). f(x) = c x2 on [−4, 4].
- 1 = c ∫−44 x2 dx = c · 2 · 643 = 128c3, so c = 3/128.
- P(|X| = 1/2) = 0 (a single value for a continuous variable, or rather two values, ±1/2, each of probability 0).
- P(|X| > 2) = P(X > 2) + P(X < −2) = 2 · 3128 ∫24 x2 dx = 2 · 3128 · 64 − 83 = 112128 = 0.875.
HW10 problem 5 (the Laplace density). f(x) = ½ e−|x| on the whole line: two Exponential(1) halves glued back to back, each carrying probability 1/2.
- P(|X| ≤ 2) = 2 ∫02 ½ e−x dx = 1 − e−2 ≈ 0.8647.
- {|X| ≤ 2 or X ≤ −1} = {X ≤ 2} (the second set swallows the left part), so the probability is P(X ≤ 2) = 1 − P(X > 2) = 1 − ½ e−2 ≈ 0.9323.
- P(X = 1 or X = 2 or …) = 0: a countable union of probability-zero events.
5.4 Conditional probability with a continuous variable
Nothing changes: P(A | B) = P(A ∩ B)/P(B), with both probabilities computed as integrals.
HW10 problem 4. A bus arrives at a time X uniform on (0, 30) minutes after 10:00. At 10:20 it has not come; P(you wait at least 5 more minutes)? That is P(X ≥ 25 | X > 20) = P(X ≥ 25)P(X > 20) = 5/3010/30 = 12. Given the bus is late, its arrival is uniform on the remaining 10 minutes.
5.5 The distribution of Y = g(X): the cdf method
- Find the range of Y.
- Write FY(y) = P(Y ≤ y) = P(g(X) ≤ y), solve the inequality for X, and express it through FX or an integral of fX.
- Differentiate: fY(y) = FY′(y) on the range, 0 outside.
HW10 problem 6(4). X has density (3/128) x2 on [−4, 4]; Y = X2. Range: [0, 16]. For 0 ≤ y ≤ 16,
FY(y) = P(X2 ≤ y) = P(−√y ≤ X ≤ √y) = ∫−√y√y 3128 x2 dx = 3128 · 2 y3/23 = y3/264.
fY(y) = 3128 √y for 0 ≤ y ≤ 16, and 0 otherwise.
Check: ∫016 (3/128) y1/2 dy = (3/128)(2/3)(163/2) = (1/64)(64) = 1.
Practice set, problem 21. X uniform on [−0.5, 0.5] (density 1 there), Y = X3. Range: [−1/8, 1/8]. The cube is increasing, so for y in the range
FY(y) = P(X ≤ y1/3) = y1/3 + 0.5, fY(y) = 13 y−2/3.
At y = 0.05: (1/3)(0.05)−2/3 ≈ (1/3)(7.368) ≈ 2.456, in (1.5, 3]. A density above 1 is normal; Y is squeezed into an interval of length 1/4.
A linear change. If Y = aX + b with a > 0, then FY(y) = FX((y − b)/a) and fY(y) = 1a fX(y − ba). So if X is uniform on (0, 1), then 30X is uniform on (0, 30), and if Z is standard Normal then μ + σZ is Normal with mean μ and standard deviation σ (section 13).
5.6 Check yourself
Answer
∫01 2x dx = 1. P(X > 1/2) = 1 − (1/2)2 = 3/4. F(x) = x2 on [0, 1]. Median: m2 = 1/2, m = 1/√2 ≈ 0.7071.Answer
c = 3000; P(X > 20) = (10/20)3 = 1/8 = 0.125. (In general P(X > a) = (10/a)3 for a ≥ 10.)Answer
c = 3/128; 0; 7/8 = 0.875.Answer
1 − e−2 ≈ 0.8647; P(X ≤ 2) = 1 − ½e−2 ≈ 0.9323; 0.Answer
P(X ≥ 25 | X > 20) = (5/30)/(10/30) = 1/2.Answer
P(Y > y) = P(−ln X > y) = P(X < e−y) = e−y. So FY(y) = 1 − e−y: Y is Exponential with rate 1 (section 10). This is how computers simulate exponential variables.Answer
Range [0, 1]. FY(y) = P(X ≤ √y) = (√y)3 = y3/2, so fY(y) = (3/2)√y on [0, 1].Answer
fY(y) = (1/3)y−2/3 on [−1/8, 1/8]; at 0.05 it is ≈ 2.456.Deck 66. Expectation, variance and functions of a random variable
The idea. The expected value is the long-run average of a random variable: what you would get per trial if you repeated the experiment forever. The variance measures how spread out the values are around that average. Both are computed from the pmf (sum) or the pdf (integral), and both obey a few algebra rules that you will use on every exam question.
6.1 Expected value of a discrete random variable
E(X) = Σi xi p(xi).
A weighted average of the values, weighted by their probabilities. Also written EX, μ, or "the mean".Why this is the long-run average (slides). Repeat the experiment n times. The average of the results is Σk xk · (number of times xk occurred)/n, and as n grows each frequency (count)/n settles down to p(xk). So the average tends to Σ xk p(xk). HW7 problem 5 phrases it this way: among a huge number of candidates like Brad, the average number of interviews would be close to E(X).
- A fair die. E(X) = (1 + 2 + 3 + 4 + 5 + 6)/6 = 3.5. The mean need not be a value X can take; do not be confused by the word "expected".
- An indicator. I = 1 if A occurs, 0 otherwise. E(I) = 1 · P(A) + 0 · P(Ac) = P(A). Expectation of an indicator is a probability; this will matter a lot in section 11.
- Brad's interviews (HW7 problem 5). X = 0, 1, 2, 3 with probabilities 0.1, 0.2, 0.6, 0.1: E(X) = 0 + 0.2 + 1.2 + 0.3 = 1.7.
- HW7 problem 3(b). Values −1.3, 1.2, 2.7, 3.3, 9.8 with probabilities 0.1, 0.25, 0.35, 0.1, 0.2: E(X) = −0.13 + 0.30 + 0.945 + 0.33 + 1.96 = 3.405.
- From a cdf (practice set, problem 8). Read the pmf off the jumps first (section 4.3), then E(X) = 0.25.
6.2 Expectation of a function of X
E[g(X)] = Σi g(xi) p(xi).
You do not need the pmf of g(X): keep the probabilities of X and plug each value into g. E(Xn) is the n-th moment.Example (slides). X = −1, 0, 1 with probabilities 0.2, 0.5, 0.3 and Y = X2. The long way: Y = 0 with probability 0.5 and Y = 1 with probability 0.5, so E(Y) = 0.5. The plug-in way: 0.2(−1)2 + 0.5(0)2 + 0.3(1)2 = 0.5. Same number, and the second way needs no new pmf.
HW7 problem 3(b), continued. E(eX) = 0.1e−1.3 + 0.25e1.2 + 0.35e2.7 + 0.1e3.3 + 0.2e9.8 ≈ 0.027 + 0.830 + 5.206 + 2.711 + 3606.75 ≈ 3615.5. One large value dominates; that is typical of eX, and it is the reason MGFs (section 7) are so informative.
HW7 problem 4 (stocking a product). Each unit sold earns $5; each unsold unit loses $15. Demand X = 2, 3, 4 with probabilities 0.1, 0.2, 0.7. If the store stocks s units, profit = 5 · min(X, s) − 15 · max(s − X, 0). Compute the expected profit for each s:
- s = 2: every demand buys both units, profit 10 always, E P(2) = 10.
- s = 3: demand 2 gives 10 − 15 = −5 (probability 0.1); demand 3 or 4 gives 15 (probability 0.9). E P(3) = −0.5 + 13.5 = 13.
- s = 4: demand 2 gives 10 − 30 = −20 (0.1); demand 3 gives 15 − 15 = 0 (0.2); demand 4 gives 20 (0.7). E P(4) = −2 + 0 + 14 = 12.
So E P(2) < E P(4) < E P(3): option (B). Stock 3. The method is the whole point: list the values of the function for each outcome, then weight by the probabilities.
6.3 Linearity
HW7 problem 5(8). Each interview costs 10 hours of preparation and the applications took 20 hours, so Y = 10X + 20 and E(Y) = 10(1.7) + 20 = 37 hours.
6.4 Variance and standard deviation
The mean says nothing about spread: W = 0, Y = ±1 (each with probability 1/2) and Z = ±100 all have mean 0. The variance distinguishes them.
Var(X) = E[(X − μ)2] = E(X2) − (E X)2.
The standard deviation is SD(X) = √Var(X), in the same units as X. The second form is the one you compute with: find E(X2) by the plug-in rule, subtract the square of the mean.Why the two forms agree (slides): E[(X − μ)2] = E[X2 − 2μX + μ2] = E(X2) − 2μ E(X) + μ2 = E(X2) − 2μ2 + μ2 = E(X2) − μ2, using linearity and the fact that μ is a constant.
- A fair die. E(X2) = (1 + 4 + 9 + 16 + 25 + 36)/6 = 91/6. Var(X) = 91/6 − (7/2)2 = 91/6 − 49/4 = 35/12 ≈ 2.917; SD ≈ 1.708.
- Brad (HW7 problem 5). E(X2) = 0 + 0.2 + 2.4 + 0.9 = 3.5; Var(X) = 3.5 − 1.72 = 3.5 − 2.89 = 0.61.
- W, Y, Z above. Var(W) = 0, Var(Y) = 1, Var(Z) = 10,000.
HW7 problem 5(9). Var(Y) = Var(10X + 20) = 100 · 0.61 = 61 hours2; SD(Y) = √61 ≈ 7.81 hours.
6.5 The continuous versions
E(X) = ∫−∞∞ x f(x) dx, E[g(X)] = ∫−∞∞ g(x) f(x) dx, Var(X) = E(X2) − (E X)2 with E(X2) = ∫ x2 f(x) dx.
Linearity and Var(aX + b) = a2Var(X) hold exactly as before (slides: pull the constants out of the integral).Uniform on (0, 1). E(X) = ∫01 x · 1 dx = 1/2. E(X2) = ∫01 x2 dx = 1/3. Var(X) = 1/3 − 1/4 = 1/12.
The chocolate bar (slides). A 1-foot bar is broken at a uniform point U. Amy gets the piece containing a fixed point p. If U < p her piece is [U, 1], length 1 − U; if U > p it is [0, U], length U. So the length L = g(U) and
E(L) = ∫0p (1 − u) du + ∫p1 u du = (p − p22) + (12 − p22) = 12 + p − p2.
At p = 1/2 this is 3/4: the piece containing the middle is on average three quarters of the bar, because whichever side the break lands on, Amy gets the bigger side plus a bit. The plug-in rule with a piecewise g is exactly this: split the integral where the formula for g changes.
HW10 problem 3, continued. f(x) = 3000/x4 for x ≥ 10.
- E(X) = ∫10∞ 3000 x−3 dx = 3000 · 10−22 = 15.
- E(X2) = ∫10∞ 3000 x−2 dx = 3000 · 10−1 = 300, so Var(X) = 300 − 225 = 75.
- E(2X2 + 3X) = 2(300) + 3(15) = 645 by linearity.
(With c/x3 instead of c/x4 the variance integral would diverge: heavy-tailed variables can have a mean but infinite variance. The homework chose the exponent 4 so that everything exists.)
6.6 Check yourself
Answer
E(X) = 1.7; E(X2) = 3.5; Var(X) = 0.61; E(Y) = 37; Var(Y) = 61.Answer
E P(2) = 10, E P(3) = 13, E P(4) = 12; E P(2) < E P(4) < E P(3).Answer
E(X) = −0.2 + 0.3 = 0.1; E(X2) = 0.5; Var(X) = 0.5 − 0.01 = 0.49.Answer
E(X − 2) = 3.5 − 2 = 1.5. Var(X − 2) = Var(X) = 35/12 ≈ 2.917.Answer
15; 75; 645.Answer
1/2 + 1/4 − 1/16 = 11/16 = 0.6875.Answer
E(X3) = ∫01 x3 dx = 1/4. Var(3X − 2) = 9 · (1/12) = 3/4.Answer
3.405 and ≈ 3615.5.Answer
E(X) = 0 by symmetry. Var(X) = E(X2) = 2 ∫0∞ x2 · ½ e−x dx = ∫0∞ x2 e−x dx = 2! = 2.Deck 67. Moment generating functions
The idea. The moment generating function packs every moment E(X), E(X2), E(X3), … of a random variable into one function of t. Differentiate it at 0 and the moments fall out. More importantly, the MGF is the "DNA" of a distribution: two random variables with the same MGF have the same distribution, so you can recognize a Binomial or a Poisson from its MGF, and you can find the distribution of a sum of independent variables by multiplying MGFs.
7.1 Definition
MX(t) = E(etX) = Σi et xi p(xi) (discrete) or ∫ etx f(x) dx (continuous), for the t where this is finite.
Always MX(0) = E(1) = 1. It is just the plug-in rule with g(x) = etx, where t is a bookkeeping variable.HW7 problem 5(3). X = 0, 1, 2, 3 with probabilities 0.1, 0.2, 0.6, 0.1. MX(t) = 0.1 + 0.2et + 0.6e2t + 0.1e3t. For a finite table the MGF is just "probability times et · value, added up".
7.2 Derivatives at 0 give the moments
MX′(0) = E(X), MX″(0) = E(X2), and in general the n-th derivative at 0 is E(Xn).
So Var(X) = M″(0) − M′(0)2.Why (slides): differentiating etX with respect to t gives X etX, so M′(t) = E(X etX) and M′(0) = E(X e0) = E(X). Differentiate again: M″(t) = E(X2 etX), M″(0) = E(X2). (Moving the derivative inside the sum or integral is allowed whenever the MGF exists near 0.)
HW7 problem 5(4)–(7). M′(t) = 0.2et + 1.2e2t + 0.3e3t, so M′(0) = 0.2 + 1.2 + 0.3 = 1.7 = E(X). M″(t) = 0.2et + 2.4e2t + 0.9e3t, M″(0) = 3.5 = E(X2), Var(X) = 3.5 − 2.89 = 0.61. Exactly the numbers from section 6, which is the point: the MGF is a machine that produces them.
7.3 The MGF determines the distribution
HW7 problem 10 (Sherlock's scrap of paper). MX(t) = 34 e2t + 18 et + 18. Match the pattern: X = 2 with probability 3/4, X = 1 with probability 1/8, X = 0 with probability 1/8 (the constant is e0 · t). Then E(X) = 2(3/4) + 1(1/8) = 1.625, E(X2) = 4(3/4) + 1(1/8) = 3.125, Var(X) = 3.125 − 1.6252 = 3.125 − 2.6406 = 0.4844 ≈ 0.48. Differentiating twice gives the same thing; reading off the pmf is faster.
HW9 problem 8 (Bert and Ernie). MX(t) = (1/3 + (2/3)et)5 is the Binomial MGF (q + pet)n with n = 5, p = 2/3 (section 8), and MY(t) = e2(et − 1) is the Poisson MGF with λ = 2 (section 9). Recognizing them gives E(X) = 10/3, Var(X) = 10/9, E(Y) = 2, Var(Y) = 2 instantly; the rest of that problem (Z = XY) is finished in section 12.
7.4 MGFs of linear transforms and of sums
MaX+b(t) = ebt MX(at), because E(et(aX+b)) = ebt E(e(at)X).
If X and Y are independent: MX+Y(t) = MX(t) MY(t), and more generally MaX+bY(t) = MX(at) MY(bt).
The second rule uses E(etX etY) = E(etX) E(etY), which is true for independent variables (section 12) and false in general.Practice set, problem 15. X, Y independent; the MGF of 3X − 2Y is MX(3t) MY(−2t): option (C). Options with powers like (MX(t))3 confuse "3X" with "X1 + X2 + X3" (three independent copies would give MX(t)3); options with sums of MGFs are never right.
HW10 problem 8. (1) MX−2Y(t) = MX(t) MY(−2t). (2) Without independence, no: the MGF of X − 2Y depends on the joint distribution. If Y = X (perfectly dependent) then X − 2Y = −X has MGF MX(−t), while an independent copy gives MX(t)MX(−2t); same marginals, different answers.
HW9 problem 5. X ~ Binomial(4, 0.3) and Y ~ Poisson(2) independent; E(eX+Y) = MX+Y(1) = MX(1) MY(1) = (0.7 + 0.3e)4 · e2(e−1) ≈ 5.2748 × 31.080 ≈ 163.94. An MGF evaluated at t = 1 is just E(eX).
Sums of famous variables. Multiply the MGFs and recognize the result: Binomial(n, p) + Binomial(m, p) = Binomial(n + m, p); Poisson(λ) + Poisson(μ) = Poisson(λ + μ); Normal + Normal = Normal with the means and variances added. These are used in sections 9, 12 and 13.
7.5 MGFs you should recognize
| Distribution | MX(t) | Section |
|---|---|---|
| Bernoulli(p) | 1 − p + pet | 8 |
| Binomial(n, p) | (1 − p + pet)n | 8 |
| Poisson(λ) | eλ(et − 1) | 9 |
| Geometric(p) | pet1 − (1 − p)et for t < −ln(1 − p) | 11 |
| Uniform(a, b) | etb − etat(b − a) | 10 |
| Exponential(λ) | λλ − t for t < λ (infinite otherwise) | 10 |
| Normal(μ, σ2) | eμt + σ2t2/2 | 13 |
7.6 Check yourself
Answer
M(t) = 0.1 + 0.2et + 0.6e2t + 0.1e3t; M′(t) = 0.2et + 1.2e2t + 0.3e3t; M′(0) = 1.7; M″(0) = 3.5; Var = 0.61.Answer
X = 2, 1, 0 with probabilities 3/4, 1/8, 1/8. E(X) = 1.625, E(X2) = 3.125, Var(X) ≈ 0.48.Answer
(a) Binomial(10, 0.6): mean 6, variance 2.4. (b) Poisson(3): mean 3, variance 3. (c) Exponential with rate 2: mean 1/2, variance 1/4.Answer
MX(3t)MY(−2t); MX(t)MY(−2t); no, the joint distribution is needed.Answer
MX(1)MY(1) = (0.7 + 0.3e)4 e2(e−1) ≈ 163.94.Answer
M′(t) = t et2/2, so E(X) = 0. M″(t) = (1 + t2) et2/2, so E(X2) = 1. (This is the standard Normal.)Answer
M2X+1(t) = et MX(2t) = ½(et + e3t): the values 1 and 3, each with probability 1/2 (X is a fair coin, 0 or 1).Answer
Product of the MGFs is e(1+2+4)(et − 1): Poisson(7).Deck 68. Bernoulli and Binomial random variables
The idea. The slides call the famous distributions the "X-men" and study each one with the same workflow: discrete or continuous? origin story? properties (mean, variance, MGF)? applications? The Binomial is the first: it counts successes in a fixed number of independent, identical yes/no trials. If you can say "n independent trials, each a success with probability p, and I am counting successes", you have a Binomial.
8.1 Bernoulli trials
8.2 The Binomial distribution
P(X = i) = (ni) pi (1 − p)n−i, i = 0, 1, …, n.
Notation X ~ B(n, p) or Bin(n, p); Bernoulli is B(1, p). A fair coin tossed n times gives B(n, 1/2) heads.Where the formula comes from (slides, 3 trials, p = 1/4). P(X = 0) = P(FFF) = (3/4)3. P(X = 1) = P(SFF) + P(FSF) + P(FFS) = 3 · (1/4)(3/4)2: each sequence with exactly one success has the same probability, and there are (31) = 3 positions for the success. In general each sequence with i successes has probability pi(1 − p)n−i (independence), and there are (ni) such sequences. The probabilities add to 1 by the binomial theorem: Σ (ni) pi(1 − p)n−i = (p + 1 − p)n = 1.
8.3 Mean, variance and MGF
E(X) = np, Var(X) = np(1 − p), SD(X) = √(np(1 − p)), MX(t) = (q + pet)n.
The MGF (slides). MX(t) = Σk etk (nk) pk qn−k = Σk (nk) (pet)k qn−k = (q + pet)n, by the binomial theorem with x = q and y = pet. Then M′(t) = n(q + pet)n−1 pet, so E(X) = M′(0) = np. One more derivative (product rule) gives M″(0) = np + n(n − 1)p2 = E(X2), hence Var(X) = np + n2p2 − np2 − n2p2 = np(1 − p). (Section 12 gives the quick proof: X is a sum of n independent Bernoullis, so means and variances add.)
The variance is largest at p = 1/2 and shrinks to 0 at p = 0 or 1: a nearly certain outcome has little spread.
8.4 Worked examples
HW7 problem 6: headlights. Each of 50 cars forgets its lights with probability 0.04, independently. X ~ B(50, 0.04). P(X = 2) = (502)(0.04)2(0.96)48 = 1225 · 0.0016 · 0.1409 ≈ 0.2762.
HW7 problem 9: Brad's exam. 80 questions, 5 choices each. Brad knows the answer with probability 0.75; otherwise he guesses. Per question, P(correct) = 0.75 + 0.25(1/5) = 0.80 (total probability). Questions are independent, so X ~ B(80, 0.8): E(X) = 64, Var(X) = 80(0.8)(0.2) = 12.8.
HW7 problem 8: flu vaccines. 300 employees all get the GS vaccine, which is 80% effective, so each still gets the flu with probability 0.2, independently: X ~ B(300, 0.2) employees fall ill. Cost C = 300 · $40 + $300 · X = 12,000 + 300X. By linearity and the scaling rule, E(C) = 12,000 + 300(60) = $30,000 and Var(C) = 3002 · Var(X) = 90,000 · 300(0.2)(0.8) = 90,000 · 48 = 4,320,000.
Practice set, problems 9–10 (same story, 40 employees, 70% effective, $70 per vaccine, $1000 per sick employee). X ~ B(40, 0.3): E(X) = 12, SD(X) = √(40 · 0.3 · 0.7) = √8.4 ≈ 2.90, option (D). C = 2800 + 1000X, so Var(C) = 10002 · 8.4 = 8,400,000, in [10,000, ∞), option (E). The fixed vaccine cost contributes nothing to the variance.
Motco's boxes (slides): a Binomial inside a Binomial. A box holds 10 packets; each packet has raisins with probability 0.05, independently. A box is returned if more than one packet has raisins. Eva buys 5 boxes; P(she returns exactly one)?
- Inside one box: Y = number of raisin packets ~ B(10, 0.05). The box is returned with probability p = P(Y ≥ 2) = 1 − P(Y = 0) − P(Y = 1) = 1 − 0.9510 − 10(0.05)(0.95)9 = 1 − 0.5987 − 0.3151 ≈ 0.0861.
- Across boxes: each box is returned with probability p independently, so X = number returned ~ B(5, p) and P(X = 1) = (51) p (1 − p)4 = 5(0.0861)(0.9139)4 ≈ 0.3004.
HW7 problem 7: pooled testing. 1000 employees, each infected with probability 0.05; samples are pooled 10 at a time, so there are 100 pools. A pool tests positive if at least one of its 10 members is infected: probability 1 − 0.9510 ≈ 0.4013. A negative pool costs 1 test; a positive pool costs 1 + 10 tests (everyone is retested). Expected tests per pool = 1 + 10(0.4013) = 5.013; expected total = 100 × 5.013 ≈ 501.3, about half of testing everyone individually.
Airplane engines (slides, from the textbook). Engines fail independently with probability 1 − p; a plane needs a majority of its engines. A 3-engine plane succeeds with probability 3p2(1 − p) + p3; a 5-engine plane with (53)p3(1 − p)2 + (54)p4(1 − p) + p5. At p = 0.6 these are 0.648 and 0.683; at p = 0.4 they are 0.352 and 0.317; at p = 1/2 both are 1/2. The 5-engine plane is preferable exactly when p > 1/2: redundancy only helps when the components are reliable to begin with. (The slides quote Downer's article on redundancy in complex systems for the engineering context.)
8.5 Recognizing a Binomial (and when it is not one)
| Story | Binomial? |
|---|---|
| Fixed number n of independent trials, same p each time, count the successes | Yes: B(n, p) |
| Draws without replacement from a finite population (aces in a 5-card hand) | No: trials are dependent (use counting; section 11.2 for the joint version) |
| Number of trials until the first success | No: Geometric (section 11.1) |
| Rare events, large n, small p | Binomial, but approximate it by a Poisson (section 9) |
| Trials with different success probabilities | Not Binomial, but means still add (section 11.5) |
8.6 Check yourself
Answer
(502)(0.04)2(0.96)48 ≈ 0.2762.Answer
p = 0.75 + 0.25/5 = 0.8; X ~ B(80, 0.8); E = 64, Var = 12.8.Answer
X ~ B(40, 0.3): E = 12, SD = √8.4 ≈ 2.90. C = 2800 + 1000X: Var(C) = 8,400,000.Answer
p = 1 − 0.9510 − 10(0.05)(0.95)9 ≈ 0.0861; 5p(1 − p)4 ≈ 0.3004.Answer
100 pools × [1 + 10(1 − 0.9510)] ≈ 501.3.Answer
X ~ B(300, 0.2); C = 12,000 + 300X; E(C) = 30,000; Var(C) = 90,000 · 48 = 4,320,000.Answer
252/1024 ≈ 0.2461; (45 + 10 + 1)/1024 = 56/1024 ≈ 0.0547.Answer
Var/E = 1 − p = 0.4, so p = 0.6 and n = 6/0.6 = 10.Answer
1 − 0.9n ≥ 0.95 ⇔ 0.9n ≤ 0.05 ⇔ n ≥ ln(0.05)/ln(0.9) ≈ 28.4, so n = 29.Answer
3 engines: 3(0.36)(0.4) + 0.216 = 0.648. 5 engines: 10(0.216)(0.16) + 5(0.1296)(0.4) + 0.0778 ≈ 0.683. The 5-engine plane, because p > 1/2.Deck 69. Poisson random variables and the Poisson process
The idea. The Poisson distribution counts rare events: misprints on a page, bombs falling on a quarter-square-kilometer of London, goals by Gretzky in a game, customers at a post office. It is what a Binomial becomes when the number of trials is huge and the success probability tiny, and it is the distribution of the number of events in a time interval when events occur "at random" at a constant rate. One parameter, λ, is both its mean and its variance.
9.1 Definition and basic properties
P(X = i) = e−λ λii!, i = 0, 1, 2, …, for some λ > 0.
E(X) = λ, Var(X) = λ, MX(t) = eλ(et − 1).
Why e−λ (slides). The probabilities must add to 1: Σi e−λ λi/i! = e−λ Σi λi/i! = e−λ eλ = 1, by the Taylor series of eλ. The e−λ is exactly the normalizing constant.
The MGF (slides). M(t) = Σ eti e−λ λi/i! = e−λ Σ (λet)i/i! = e−λ eλet = eλ(et − 1). Then M′(t) = λet eλ(et − 1), so E(X) = M′(0) = λ; M″(t) = (λet)2 eλ(et − 1) + λet eλ(et − 1), so E(X2) = λ2 + λ and Var(X) = λ.
9.2 The Poisson as a limit of the Binomial
Why (slides). Put p = λ/n. Then P(Y = k) = (nk) (λ/n)k (1 − λ/n)n−k = n(n−1)···(n−k+1)nk · λkk! · (1 − λ/n)n · (1 − λ/n)−k. As n → ∞ the first factor → 1, (1 − λ/n)n → e−λ, and the last factor → 1, leaving e−λλk/k!. The mean np = λ and the variance np(1 − p) ≈ λ match too.
Evidence from the slides. 537 bombs fell on 576 quarter-square-kilometer squares of South London, λ = 537/576 = 0.93 per square. Predicted number of squares with 0, 1, 2, 3, 4, 5+ bombs: 226.7, 211.4, 98.5, 30.6, 7.1, 1.6. Observed: 229, 211, 93, 35, 7, 1. Gretzky's points per game (λ = 1669/696 ≈ 2.4) fit a Poisson just as well. Many tiny chances, added up, give a Poisson.
Brad's dorm (slides). 180 other students; X = number sharing Brad's birthday. Exactly, X ~ B(180, 1/365); approximately, Poisson with λ = 180/365 ≈ 0.4932.
- (a) P(X ≥ 1) ≈ 1 − e−0.4932 ≈ 0.3893. Exact: 1 − (364/365)180 ≈ 0.3897.
- (b) P(X = 1) ≈ 0.4932 e−0.4932 ≈ 0.3012. Exact: 180(1/365)(364/365)179 ≈ 0.3018.
- (c) P(X ≥ 2) ≈ 1 − e−0.4932(1 + 0.4932) ≈ 0.0881.
HW8 problem 1: yelling runners. Brad passes n runners; each yells with probability 0.03.
- n = 100: X ≈ Poisson(3). P(X > 2) = 1 − e−3(1 + 3 + 4.5) = 1 − 8.5e−3 ≈ 0.5768. (Exact Binomial: 0.5802.)
- P(X ≥ 1) = 1 − e−0.03n ≥ 0.95 ⇔ e−0.03n ≤ 0.05 ⇔ n ≥ ln(20)/0.03 ≈ 99.86, so n = 100 runners.
Practice set, problem 12. 200 runners, probability 0.01: X ≈ Poisson(2), P(X > 2) = 1 − e−2(1 + 2 + 2) = 1 − 5e−2 ≈ 0.3233, in (0.25, 0.40].
9.3 More worked examples
HW8 problems 2–3. P(X = 1 | X ≤ 1) = λe−λe−λ + λe−λ = λ1 + λ = 0.5, so λ = 1. Conditional probability with a Poisson: both numerator and denominator are sums of pmf terms, and e−λ cancels.
HW8 problem 4: does the drug work? (Bayes with a Poisson likelihood). Colds per year are Poisson(5); the drug lowers λ to 3 for 75% of people and does nothing for 25%. A user has 2 colds. Let B = the drug is beneficial for him.
P(B | 2 colds) = 0.75 · e−332/2!0.75 · e−332/2! + 0.25 · e−552/2! = 0.75(0.2240)0.75(0.2240) + 0.25(0.0842) = 0.16800.1891 ≈ 0.8886.
HW8 problem 5: Clark and Diana. 400 questions; Clark errs with probability 0.0075, Diana 0.003. XC ≈ Poisson(3), XD ≈ Poisson(1.2). The sum of independent Poissons is Poisson with the summed mean (multiply the MGFs: e3(et−1) e1.2(et−1) = e4.2(et−1)), so XC + XD ≈ Poisson(4.2) and P(XC + XD = 2) = e−4.2(4.2)2/2 ≈ 0.1323.
Practice set, problem 17. X ~ Poisson(1), Y ~ Poisson(2), independent. P(max(X, Y) ≤ 1) = P(X ≤ 1 and Y ≤ 1) = P(X ≤ 1) P(Y ≤ 1) = (e−1 + e−1)(e−2 + 2e−2) = 2e−1 · 3e−2 = 6e−3 ≈ 0.2987, in [0, 0.5). (Section 12.4 has the general max/min method.)
Two buses (slides). Bus 1 carries Poisson(4) passengers, bus 2 Poisson(5); you take bus 1 with probability 1/3. P(at least 2 passengers) = 13[1 − e−4(1 + 4)] + 23[1 − e−5(1 + 5)] = 13(0.9084) + 23(0.9596) ≈ 0.9425. Total probability over which bus, then a Poisson inside each case.
9.4 The Poisson process
- P(exactly one event in the interval) = λh + o(h) (proportional to the length, for a constant rate λ);
- P(two or more events in the interval) = o(h) (no simultaneous events);
- the numbers of events in non-overlapping intervals are independent.
Examples from the slides: earthquakes, deaths among an insurer's policy holders, shark attacks, buses arriving at a stop. The sample path N(t) is a staircase that goes up by 1 at each event.
Light bulbs (slides). Bulbs burn out at rate 7.2 per day. (1) Noon to 2 p.m. is 2/24 = 1/12 day, so N ~ Poisson(0.6): P(N > 2) = 1 − e−0.6(1 + 0.6 + 0.18) ≈ 0.0231. (2) Next week: N ~ Poisson(50.4), P(N = 50) = e−50.4 50.450/50! ≈ 0.0562. (If the calculator overflows on 50.450, compute ln of the whole thing: −50.4 + 50 ln 50.4 − ln 50! ≈ −2.878, then exponentiate.)
HW8 problem 6: I-40 accidents. 3 accidents per weekday, days independent. (1) P(no accidents Monday) = e−3 ≈ 0.0498. (2) Let p = P(exactly 2 on a given day) = e−332/2 ≈ 0.2240. The number of days (out of 5) with exactly 2 accidents is B(5, p), so P(exactly 4 such days) = (54) p4(1 − p) ≈ 5(0.2240)4(0.7760) ≈ 0.0098. A Binomial whose p comes from a Poisson.
HW8 problems 7–8: Diane's phone. Calls arrive at rate 2 per hour. (7) In 10 minutes, N ~ Poisson(2 · 1/6) = Poisson(1/3): P(at least one call) = 1 − e−1/3 ≈ 0.2835. (8) P(no calls in t hours) = e−2t, which equals 0.5 when t = (ln 2)/2 ≈ 0.3466 hours ≈ 20.8 minutes. Breaks of at least 20.8 minutes have P(no calls) ≤ 0.5 (the homework's literal wording, "at most 0.5"); shorter breaks have P(no calls) > 0.5. Either way the number to report is the threshold t = (ln 2)/2, found by taking ln of both sides.
Practice set, problem 11. Earthquakes at 4 per week; in 2 weeks N ~ Poisson(8), so P(N = 4) = e−8 84/4!: option (C). Options with e−4 forgot to multiply the rate by the length; option (D) divided instead of multiplying.
9.5 Check yourself
Answer
Poisson(3): 1 − 8.5e−3 ≈ 0.5768. n ≥ ln 20/0.03 ≈ 99.9, so n = 100.Answer
λ/(1 + λ) = 0.5, λ = 1.Answer
0.75(0.2240)/[0.75(0.2240) + 0.25(0.0842)] ≈ 0.8886.Answer
Poisson(3) + Poisson(1.2) = Poisson(4.2): e−4.2(4.2)2/2 ≈ 0.1323.Answer
e−3 ≈ 0.0498; 5p4(1 − p) with p = 4.5e−3 ≈ 0.2240, giving ≈ 0.0098.Answer
1 − e−1/3 ≈ 0.2835; e−2t = 0.5 at t = (ln 2)/2 ≈ 0.347 h ≈ 20.8 min, and P(no calls) ≤ 0.5 for every t ≥ 20.8 min.Answer
e−884/4! ≈ 0.0573; Poisson(2): 1 − 5e−2 ≈ 0.3233.Answer
λ = 180/365 ≈ 0.4932; 1 − e−λ(1 + λ) ≈ 0.0881.Answer
λ2/2 = λ3/6 ⇒ λ = 3.Answer
1 − 2e−1 ≈ 0.2642. Each page is typo-free with probability e−1, so about 300e−1 ≈ 110 pages.Deck 610. Uniform and Exponential random variables
The idea. Two continuous "X-men". The Uniform is "a point chosen at random from an interval": every sub-interval of the same length is equally likely. The Exponential is "the waiting time until the next event" when events occur at a constant rate; it is the continuous twin of the Poisson process and it has no memory, which makes it both strange and extremely useful.
10.1 The Uniform distribution on (a, b)
f(x) = 1b − a for a < x < b (0 otherwise); F(x) = x − ab − a for a ≤ x ≤ b.
E(X) = a + b2, Var(X) = (b − a)212, P(x1 < X < x2) = x2 − x1b − a.
Probability depends only on the length of the sub-interval, not on where it sits (shifting x1 and x2 by the same h changes nothing).Mean and variance (slides). E(X) = ∫ab xb − a dx = b2 − a22(b − a) = a + b2. E(X2) = b3 − a33(b − a) = a2 + ab + b23. Subtracting (a + b)24 and simplifying gives (b − a)212. For (0, 1): mean 1/2, variance 1/12, as in section 6.
Practice set, problem 19 (chocolate bar again). The toothpick is at p = 1/4 and the break point U is uniform on [0, 1]. Amy's piece has length g(U) = 1 − U if U < 1/4 (she gets [U, 1]) and g(U) = U if U > 1/4. P(g(U) ≥ 1/2) = P(U < 1/4 and 1 − U ≥ 1/2) + P(U ≥ 1/4 and U ≥ 1/2) = P(U < 1/4) + P(U ≥ 1/2) = 1/4 + 1/2 = 3/4, in (0.65, 1]. Draw the interval and mark where the piece is long; the answer is the total length of those regions.
Bus breakdown (slides, "slightly complicated"). A bus breaks down at a point X uniform on (0, 100) miles from city A. Service stations at 0, 50 and 100, or at 25, 50 and 75: which plan gives the smaller expected distance to the nearest station?
- Stations at 0, 50, 100: the distance D1(x) is x on (0, 25], 50 − x on (25, 50], x − 50 on (50, 75], 100 − x on (75, 100]. By symmetry the four pieces contribute equally: E(D1) = 4 ∫025 x · 1100 dx = 4 · 312.5100 = 12.5 miles.
- Stations at 25, 50, 75: D2(x) is 25 − x on (0, 25], then triangles of half-width 12.5 around 25, 50, 75, then x − 75 on (75, 100]. E(D2) = 1100[312.5 + 4 · 78.125 + 312.5] = 9.375 miles.
The suggested plan is better. The method is the plug-in rule with a piecewise function: split the integral wherever the formula for the distance changes.
10.2 Why the Uniform matters: it generates every other distribution
- If U ~ Uniform(0, 1), then X = F−1(U) has cdf F.
- If X has cdf F, then F(X) ~ Uniform(0, 1).
Proof of (1): P(X ≤ x) = P(F−1(U) ≤ x) = P(U ≤ F(x)) = F(x), because for a uniform P(U ≤ u) = u. Proof of (2): P(F(X) ≤ z) = P(X ≤ F−1(z)) = F(F−1(z)) = z. Punchline: a computer that can produce uniform random numbers can simulate any distribution: compute the cdf, draw U, output F−1(U). For an Exponential, F−1(u) = −ln(1 − u)/λ. The slides' "even cooler fact": the binary digits of one uniform are an infinite sequence of independent fair coin flips, so a single uniform contains infinitely many independent uniforms.
10.3 The Exponential distribution
f(x) = λe−λx for x > 0 (0 for x < 0); F(x) = 1 − e−λx; P(X > x) = e−λx.
E(X) = 1λ, Var(X) = 1λ2, SD(X) = 1λ, MX(t) = λλ − t for t < λ (and +∞ for t ≥ λ).
λ is a rate (events per unit time); the mean waiting time is 1/λ.Derivations (slides). F(a) = ∫0a λe−λx dx = −e−λx from 0 to a = 1 − e−λa. E(X) = ∫0∞ x λe−λx dx = 1/λ by parts (section 1.3). E(X2) = ∫0∞ x2 λe−λx dx = 2/λ2, so Var(X) = 2/λ2 − 1/λ2 = 1/λ2. MGF: ∫0∞ etx λe−λx dx = λ ∫0∞ e−(λ−t)x dx = λ/(λ − t), which needs λ − t > 0.
HW10 problem 9. Time to the next earthquake is Exponential with mean 2 years, so λ = 1/2. P(within one year) = 1 − e−1/2 ≈ 0.3935. P(within ten years) = 1 − e−5 ≈ 0.9933.
Practice set, problem 25 (the median). Laptop lifetime Exponential with mean 36 months, λ = 1/36. The median a solves P(X ≤ a) = 1 − e−a/36 = 1/2, so e−a/36 = 1/2 and a = 36 ln 2 ≈ 24.95 months, in [20, 30). The median of an Exponential is always (ln 2)/λ ≈ 0.69 × the mean: the distribution is skewed right, so half the laptops die before 25 months even though the mean is 36.
Why it matters (slides). Waiting times (earthquakes, phone calls, hospital admissions); queueing theory (how businesses and internet routers behave); Markov processes (built on the memoryless property); and the Gamma distribution (sums of Exponentials) used in text mining and clustering.
10.4 The memoryless property
P(X > s + t | X > s) = P(X > t).
Having waited s already tells you nothing about how much longer you will wait. The Exponential is the only continuous distribution with this property.Proof (slides): P(X > s + t | X > s) = P(X > s + t and X > s)P(X > s) = P(X > s + t)P(X > s) = e−λ(s+t)e−λs = e−λt = P(X > t). Conversely, if G(t) = P(X > t) satisfies G(s + t) = G(s)G(t), differentiating in s at s = 0 gives G′(t) = G′(0)G(t), whose only solutions with G(0) = 1 are G(t) = e−λt with λ = −G′(0) > 0. That is the characterization.
Eva's hard drive (slides). Lifetime Exponential with mean 43,800 hours. She has used it for 3 years and is leaving on a 4380-hour trip. P(it survives the trip | it has survived 3 years) = P(X > 4380) = e−4380/43,800 = e−0.1 ≈ 0.9048, by memorylessness; the three years of use are irrelevant. If the lifetime were not Exponential (a drive that wears out), the age would matter and you would have to compute P(X > s + t)/P(X > s) from the actual cdf.
HW10 problem 10. Repair time Exponential with rate 1 per hour. P(takes at least 10 hours | has exceeded 9 hours) = P(X ≥ 1) = e−1 ≈ 0.3679. (Computing (e−10/e−9) directly gives the same thing.)
10.5 Connection to the Poisson process
So HW8 problem 8 (P(no calls in t hours) = e−2t) and "the wait for the next call is Exponential(2)" are the same statement. With calls at 2 per hour, the expected wait is 1/2 hour and P(wait > 30 min) = e−1 ≈ 0.3679.
10.6 Check yourself
Answer
15; 900/12 = 75; (5/30)/(10/30) = 1/2.Answer
P(U < 1/4) + P(U ≥ 1/2) = 3/4.Answer
D = min(x, 100 − x): E(D) = 2 ∫050 x/100 dx = 2(12.5) = 25 miles.Answer
1 − e−0.5 ≈ 0.3935; 1 − e−5 ≈ 0.9933.Answer
e−1 ≈ 0.3679.Answer
36 ln 2 ≈ 24.95 months. P(X > 36) = e−1 ≈ 0.3679 (always, for any Exponential).Answer
e−0.1 ≈ 0.9048, regardless of the 3 years.Answer
e−0.5 − e−1.5 ≈ 0.6065 − 0.2231 = 0.3834.Answer
P(X > t) = P(U < e−λt) = e−λt: Exponential(λ). (1 − U is also uniform, so −ln(1 − U)/λ works too.)Answer
Wait ~ Exponential(3 per hour): mean 1/3 hour = 20 minutes; P(wait > 1/3 h) = e−1 ≈ 0.3679.Answer
(b − a)2/12 = 3 gives b − a = 6; a + b = 10; so a = 2, b = 8.Deck 711. Geometric distribution, joint distributions and linearity of expectation
The idea. Deck 7 does three things. It adds one more "famous" discrete distribution, the Geometric (trials until the first success). It starts what the slides call the most important aspect of the course: relationships between random variables, described by a joint distribution. And it proves the "super duper useful fact" that E(X + Y) = E(X) + E(Y) with no conditions at all, which, combined with indicator variables, computes expectations of very complicated counts in two lines (coat matching, coupon collecting, Homework 9).
11.1 The Geometric distribution
P(X = n) = (1 − p)n−1 p, n = 1, 2, …
Interpretation (slides): the number of trials until the first success in independent Bernoulli(p) trials. ThenMX(t) = pet1 − (1 − p)et for t < −ln(1 − p), E(X) = 1p, Var(X) = 1 − pp2, P(X > k) = (1 − p)k.
Where the formulas come from (slides). "First success on trial n" is n − 1 failures then a success, and the trials are independent. The probabilities add to 1 by the geometric series: p Σn≥1(1 − p)n−1 = p/(1 − (1 − p)) = 1. "X > k" means the first k trials all failed. For the moments the slides use the MGF:
MX(t) = Σk≥1 etk(1 − p)k−1p = pet Σk≥1 [et(1 − p)]k−1 = pet1 − (1 − p)et,
which is finite when (1 − p)et < 1, i.e. t < −ln(1 − p). Differentiating, M′(t) = pet(1 − (1 − p)et)2, so E(X) = M′(0) = p/p2 = 1/p. One more derivative gives E(X2) = M″(0) = (2 − p)/p2, hence Var(X) = (2 − p)/p2 − 1/p2 = (1 − p)/p2. (As for the Binomial and Poisson, direct summation gives the same results.) Intuition for the mean: a success happens one time in 1/p trials, so you wait 1/p trials on average.
Memoryless. P(X > m + k | X > m) = (1 − p)m+k/(1 − p)m = (1 − p)k = P(X > k): having failed m times tells you nothing about the future, just like the Exponential.
Practice set, problem 6. Each kidney matches with probability 0.1 independently; X = number tested until a match. E(X) = 1/0.1 = 10, in [6, 12).
HW6 problem 8(1), revisited. P(Eva's first mistake is on order 11) = (1/2)10(1/2): the Geometric(1/2) pmf at n = 11.
HW9 problem 7: who gets heads first. Your coin has P(H) = 3/4, your friend's has 1/4; X and Y are the numbers of flips each needs, independent. P(X < Y)? Condition on the value of X:
P(X < Y) = Σk≥1 P(X = k) P(Y > k) = Σk≥1 (1/4)k−1(3/4) · (3/4)k = 916 Σk≥1 (3/16)k−1 = 9/161 − 3/16 = 913 ≈ 0.6923.
First-step check: in a round where both flip, you win outright if you get H and your friend gets T (probability (3/4)(3/4) = 9/16); the round is a do-over if both get T ((1/4)(3/4) = 3/16); otherwise your friend has H and you have not beaten them. So p = 9/16 + (3/16)p, p = 9/13. Both methods are always available; use whichever you set up faster.
11.2 Joint distributions: cdf, pmf, marginals
The slides motivate joint distributions with pairs like (Netflix price, Amazon price), (cholesterol, blood pressure), (rainfall in NC, rainfall in VA): most of statistics (regression, time series, factor models) and most of probability (Markov chains, stochastic processes) is about collections of random variables and how they relate.
P(X > a, Y > b) = 1 − P(X ≤ a or Y ≤ b) = 1 − [FX(a) + FY(b) − F(a, b)] = 1 − FX(a) − FY(b) + F(a, b).
pX,Y(x, y) = P(X = x, Y = y), pX(x) = P(X = x, Y takes any value) = Σy pX,Y(x, y), pY(y) = Σx pX,Y(x, y).
The marginal pmf of X is just the pmf of X; the word "marginal" comes from writing the row and column totals in the margins of the table. For more than two variables, sum over every coordinate except the one you want to keep. (The other case, jointly continuous X and Y with a joint density, is deck 9 and is not on this midterm.)Extra context beyond the slides: the conditional pmf pX|Y(x | y) = pX,Y(x, y)/pY(y) is the multiplication rule in pmf form, so pX,Y(x, y) = pY(y) pX|Y(x | y). Homework 9 problem 2 and practice problem 22 describe one variable "given" the other and need exactly this.
Problem 1 from the slides: two dice, X = the larger value, Y = the sum. All 36 ordered pairs (d1, d2) are equally likely. For the maximum to be x and the sum to be y, one die must show x and the other y − x ≤ x. If y − x < x there are two ordered pairs, (x, y − x) and (y − x, x); if y = 2x there is one, (x, x). So
p(x, y) = 236 for x + 1 ≤ y ≤ 2x − 1, p(x, 2x) = 136, and 0 otherwise.
| p(x, y) | y=2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | pX(x) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| x = 1 | 1 | 1/36 | ||||||||||
| x = 2 | 2 | 1 | 3/36 | |||||||||
| x = 3 | 2 | 2 | 1 | 5/36 | ||||||||
| x = 4 | 2 | 2 | 2 | 1 | 7/36 | |||||||
| x = 5 | 2 | 2 | 2 | 2 | 1 | 9/36 | ||||||
| x = 6 | 2 | 2 | 2 | 2 | 2 | 1 | 11/36 | |||||
| pY(y) | 1 | 2 | 3 | 4 | 5 | 6 | 5 | 4 | 3 | 2 | 1 | 36/36 |
(Entries are in 36ths; blank = 0.) The row totals are the pmf of the maximum, (2x − 1)/36, and the column totals are the familiar pmf of the sum. Reading probabilities off the table: P(X = 4, Y = 7) = 2/36, P(Y = 7 | X = 4) = (2/36)/(7/36) = 2/7, P(X ≤ 2, Y ≤ 3) = F(2, 3) = 3/36.
A smaller table. Toss a fair coin three times; X = heads in the first two tosses, Y = total heads:
| p(x, y) | y = 0 | y = 1 | y = 2 | y = 3 | pX(x) |
|---|---|---|---|---|---|
| x = 0 | 1/8 | 1/8 | 0 | 0 | 2/8 |
| x = 1 | 0 | 2/8 | 2/8 | 0 | 4/8 |
| x = 2 | 0 | 0 | 1/8 | 1/8 | 2/8 |
| pY(y) | 1/8 | 3/8 | 3/8 | 1/8 | 1 |
P(X = Y) = 1/8 + 2/8 + 1/8 = 1/2 (the third toss is tails); P(X = 1 | Y = 2) = (2/8)/(3/8) = 2/3. This table returns in section 12 as an example of dependent variables.
Practice set, problem 14 (sampling without replacement). 3 sophomores, 4 juniors, 5 seniors; 3 are chosen at random; X = sophomores chosen, Y = juniors chosen. Every triple is equally likely, so
P(X = x, Y = y) = (3x)(4y)(53−x−y)(123), and P(X = 1, Y = 1) = 3 · 4 · 5(123) = 60220 ≈ 0.2727: option (B).
Option (D), (3/12)(4/12), treats "one sophomore" and "one junior" as two independent single draws, which is wrong twice over: the draws are without replacement, and even with replacement the probability of one of each class in three draws would be the multinomial 3! · (3/12)(4/12)(5/12) ≈ 0.2083, not a bare product of two fractions.
HW9 problem 2: two doctors. H = 1 if Dr. Hibbert performs the n surgeries (probability p), else H = 0. Given H = 1, each surgery succeeds with probability a independently, so X | H = 1 ~ Binomial(n, a); given H = 0, X | H = 0 ~ Binomial(n, b). By the multiplication rule the joint pmf is
P(H = 1, X = k) = p (nk) ak(1 − a)n−k, P(H = 0, X = k) = (1 − p) (nk) bk(1 − b)n−k, k = 0, …, n.
The marginal of X is the sum of the two rows: a mixture of two Binomials. For E(X), condition on the doctor: E(X) = p · na + (1 − p) · nb = n[pa + (1 − p)b]. For E(X2), use E(Y2) = Var(Y) + (E Y)2 for each Binomial: E(X2) = p[na(1 − a) + n2a2] + (1 − p)[nb(1 − b) + n2b2]. Then Var(X) = E(X2) − (E X)2, which simplifies to n[pa(1 − a) + (1 − p)b(1 − b)] + n2p(1 − p)(a − b)2: the average within-doctor variance plus the extra variance from not knowing which doctor.
Practice set, problem 22 (a product of dependent variables). Shankar gets X questions with P(X = 0, 1, 2) = 0.2, 0.4, 0.4; each question is answered inadequately with probability 1/5 independently, so Y | X = x ~ Binomial(x, 1/5). P(XY ≤ 1): go case by case on X.
- X = 0: XY = 0 ≤ 1 always. Contributes 0.2.
- X = 1: Y ∈ {0, 1} so XY = Y ≤ 1 always. Contributes 0.4.
- X = 2: XY = 2Y ≤ 1 only if Y = 0, probability (4/5)2 = 0.64. Contributes 0.4 × 0.64 = 0.256.
Total 0.856, in (0.6, 1.0]. When one variable's distribution is described "given" the other, the joint pmf is pX(x) pY|X(y | x) and you sum over the cases.
11.3 Expectations from a joint pmf, and linearity
E[g(X, Y)] = Σx,y g(x, y) pX,Y(x, y).
With g(x, y) = x this gives Σx x pX(x) = E(X): computing E(X) from the joint pmf or from the marginal gives the same answer.E(X + Y) = E(X) + E(Y), and E(X1 + ··· + Xn) = E(X1) + ··· + E(Xn).
Proof (slides, equation (1)): Σx,y(x + y) p(x, y) = Σx x Σy p(x, y) + Σy y Σx p(x, y) = Σx x pX(x) + Σy y pY(y) = E(X) + E(Y). Only the marginals enter, so dependence between X and Y is irrelevant; the n-variable version follows by induction from the two-variable case (in class: Y = X2 + ··· + Xn). Variances do not add this freely (section 12).
Immediate payoff: a Binomial(n, p) is a sum of n Bernoulli(p) variables, so its mean is np with no computation. In the coin table above, E(Y) = E(X) + E(third toss) = 1 + 1/2 = 3/2.
11.4 The power of indicator random variables
E(X) = Σi=1n E(IAi) = Σi=1n [1 · P(Ai) + 0 · P(Aic)] = Σi=1n P(Ai),
whether or not the events are independent. You never need the distribution of X.Ten students (slides). Student i does well with probability pi. With Xi = 1 if student i does well, the number doing well is X = Σ Xi and E(X) = Σi=110 pi. No independence was assumed.
Coat matching (slides). Thirty guests' coats are handed back at random, so each guest gets their own coat with probability 1/30. M = number of guests who get their own coat = Σi=130 Ii, and E(M) = 30 · (1/30) = 1. The indicators are dependent (if 29 guests have the right coat, so does the 30th), and the answer is exactly 1 for any number of guests.
The coupon collector problem (slides). Each cereal box contains one of 100 X-men cards, chosen uniformly and independently. X = number of boxes needed to collect all 100. Break the wait into pieces: Ti = the number of boxes bought while you own exactly i distinct cards, until a new one appears, i = 0, 1, …, 99. Each box is "new" with probability (100 − i)/100, so Ti is Geometric with p = (100 − i)/100 and E(Ti) = 100/(100 − i). Then X = T0 + T1 + ··· + T99 and
E(X) = Σi=099 100100 − i = 100 (1 + 12 + 13 + ··· + 1100) = 100 H100 ≈ 518.74 boxes.
At $2.50 a box, Z = 2.5X and E(Z) = 2.5 · 518.74 ≈ $1,296.85. The slides' punchline: "E(sum of a bunch of random variables) = sum of the individual expectations" was the whole tool; the problem looks made up but shows up in computer science and genetics (see the course "Extras").
HW9 problem 1: five students, four colleges. Each of 5 students independently picks UNC, Duke, NC State or Hogwarts-NC with probabilities 0.6, 0.1, 0.1, 0.2. IUNC is the indicator that exactly 2 of the 5 choose UNC, and so on; X = number of schools that get exactly 2 students.
- The number choosing a given school is Binomial(5, pschool), so E(IUNC) = P(exactly 2) = (52)(0.6)2(0.4)3 = 0.2304; E(IDuke) = (52)(0.1)2(0.9)3 = 0.0729; E(INCS) = 0.0729; E(IHNC) = (52)(0.2)2(0.8)3 = 0.2048.
- X = IUNC + IDuke + INCS + IHNC.
- E(X) = 0.2304 + 0.0729 + 0.0729 + 0.2048 = 0.581.
HW9 problem 3: Halloween houses. 12 houses in a row, 7 give candy, every arrangement equally likely; X = number of adjacent pairs with different behavior. Let Ii = 1 if houses i and i + 1 differ, i = 1, …, 11. For any pair, P(different) = P(C then N) + P(N then C) = 712 · 511 + 512 · 711 = 70132 = 3566. So E(X) = 11 · 3566 = 356 ≈ 5.83. The pmf of X would be a nightmare; the expectation takes two lines.
Practice set, problem 20: sad schools. Four athletes choose independently among UNC, Duke, NC State with the given probabilities. Sad = number of schools that get nobody. E(Sad) = Σschools P(nobody picks it): UNC (0.5)(0.2)(0.7)(0.1) = 0.007; Duke (0.7)(0.9)(0.6)(0.95) = 0.3591; NC State (0.8)(0.9)(0.7)(0.95) = 0.4788. E(Sad) = 0.8449, in (0.6, 1.2]. Each probability is a product because the athletes decide independently; the three indicators are not independent, and again that does not matter.
11.5 The multinomial distribution
P(X1 = n1, …, Xr = nr) = n!n1! n2! ··· nr! p1n1 p2n2 ··· prnr,
and 0 for any other count vector.Why (as written in class): a specific sequence of outcomes with ni of type i has probability Π pini, and the multinomial coefficient counts such sequences (the "labeled groups" count from Midterm 1). With r = 2 it is the Binomial. Each Xi on its own is Binomial(n, pi) (a trial is "type i" or not), and the count of a union of categories, Xi + Xj, is Binomial(n, pi + pj).
HW9 problem 4: three candidates. 35% Sauron, 45% Voldemort, 20% Saruman; sample 4 voters.
- P(XA = 0, XV = 1, XS = 3) = 4!0! 1! 3! (0.35)0(0.45)1(0.2)3 = 4(0.45)(0.008) = 0.0144.
- Y = XA + XS = number of non-Voldemort voters ~ Binomial(4, 0.55): E(Y) = 2.20, Var(Y) = 4(0.55)(0.45) = 0.99.
Practice set, problem 23: ramen. Five customers; P(2 miso, 2 tonkotsu, 1 shoyu) = 5!2! 2! 1! (0.5)2(0.3)2(0.1) = 30(0.25)(0.09)(0.1) = 0.0675, in (0.0025, 0.1]. (The unused category, shio, simply has ni = 0.)
11.6 Check yourself
Answer
10; 0.95 ≈ 0.5905; by memorylessness P(X = 2) = 0.9(0.1) = 0.09.Answer
9/13 ≈ 0.6923.Answer
2/36 (pairs (5, 3) and (3, 5)); 5/36; (2/36)/(7/36) = 2/7.Answer
pet/(1 − (1 − p)et); M′(0) = p/p2 = 1/p; t < −ln(1 − p).Answer
60/220 ≈ 0.2727; (53)/220 = 10/220 ≈ 0.0455.Answer
(2/8)/(4/8) = 1/2. E(XY) = 1·1·(2/8) + 1·2·(2/8) + 2·2·(1/8) + 2·3·(1/8) = 16/8 = 2.Answer
p(nk)ak(1 − a)n−k; E(X) = n[pa + (1 − p)b].Answer
0.2 + 0.4 + 0.4(0.64) = 0.856.Answer
0.2304 + 0.0729 + 0.0729 + 0.2048 = 0.581.Answer
11 · 35/66 = 35/6 ≈ 5.83.Answer
0.007 + 0.3591 + 0.4788 = 0.8449.Answer
6(1 + 1/2 + 1/3 + 1/4 + 1/5 + 1/6) = 6(2.45) = 14.7 boxes. Exactly 1 coat.Answer
0.0144; Binomial(4, 0.55): 2.2 and 0.99.Answer
30(0.25)(0.09)(0.1) = 0.0675.Deck 812. Independent random variables, covariance and correlation
The idea. Deck 8 first isolates the special case where one random variable carries no information about another: independence. It makes products behave (E[g(X)h(Y)] = E[g(X)]E[h(Y)]), makes sums behave (MGFs multiply, so Binomials and Poissons add), and makes variances add. The deck then returns to general, possibly dependent, variables and measures their linear relationship with covariance and correlation, which gives "super powerful formulas and rules for computing variances of sums".
12.1 Independence of random variables
P(X ∈ A, Y ∈ B) = P(X ∈ A) P(Y ∈ B),
that is, the events {X ∈ A} and {Y ∈ B} are independent. Otherwise X and Y are dependent. Equivalent condition 1: F(a, b) = FX(a)FY(b) for all a, b. Equivalent condition 2 (discrete case):p(x, y) = pX(x) pY(y) for all x, y,
and this is also equivalent to p(x, y) = h(x)g(y) for some functions h and g (the pmf factors). For n variables: p(x1, …, xn) = pX1(x1) ··· pXn(xn).Why condition 2 is enough (in class): P(X ∈ A, Y ∈ B) = Σx∈A Σy∈B p(x, y) = Σx∈A Σy∈B pX(x)pY(y) = [Σx∈A pX(x)][Σy∈B pY(y)] = P(X ∈ A)P(Y ∈ B). And X, Y are not independent as soon as there are sets A, B with P(X ∈ B | Y ∈ A) ≠ P(X ∈ B).
Final Exam 2011 problem (slides). Two balls are drawn without replacement from an urn with 5 white and 8 red balls. X1 = 1 if the first ball is red (else 0), X2 = 1 if the second is red. Joint pmf by the multiplication rule:
| p(x1, x2) | x2 = 0 | x2 = 1 | marginal of X1 |
|---|---|---|---|
| x1 = 0 | (5/13)(4/12) = 5/39 | (5/13)(8/12) = 10/39 | 5/13 |
| x1 = 1 | (8/13)(5/12) = 10/39 | (8/13)(7/12) = 14/39 | 8/13 |
| marginal of X2 | 5/13 | 8/13 | 1 |
Both marginals are the same (the second ball is red with probability 8/13 too), but P(X1 = 1)P(X2 = 1) = (8/13)2 = 64/169 ≈ 0.379 while P(X1 = 1, X2 = 1) = 14/39 ≈ 0.359. One cell fails, so X1 and X2 are dependent, as sampling without replacement should be.
Pet boarding: thinning a Poisson (slides). N ~ Poisson(λ) dogs arrive in a day; each independently is "crazy" with probability p. Cr = number of crazy puppies, No = number of normal dogs, Cr + No = N. For c, d ≥ 0, condition on N = c + d; given N, Cr is Binomial(N, p):
P(Cr = c, No = d) = P(N = c + d) P(Cr = c | N = c + d) = e−λ λc+d(c + d)! · (c + d)!c! d! pc(1 − p)d = [e−λp (λp)cc!] · [e−λ(1−p) (λ(1 − p))dd!],
using e−λ = e−λpe−λ(1−p). The joint pmf is a product of a Poisson(λp) pmf in c and a Poisson(λ(1 − p)) pmf in d, so Cr and No are independent Poissons with means λp and λ(1 − p). This is the "factorization test" in action, and it is surprising: the two counts share the same random N and are still independent.
Practice set, problem 13. p(x, y) = (x2 + y2)/140 for x = 1, 2, 3 and y = −x, …, x. Dependent, for two separate reasons: the range of y depends on x, and x2 + y2 is a sum, not a product h(x)g(y). Option (B).
The coin table of section 11.2. X = heads in tosses 1–2, Y = total heads: p(0, 3) = 0 but pX(0)pY(3) = (2/8)(1/8) ≠ 0. Dependent (Y ≥ X always).
E[g(X)h(Y)] = E[g(X)] E[h(Y)],
and the same for any number of independent variables. Proof: Σx,y g(x)h(y) pX(x)pY(y) = [Σx g(x)pX(x)][Σy h(y)pY(y)]. In particular E(XY) = E(X)E(Y), and functions of independent variables are independent.HW9 problem 8: Bert and Ernie's sprints. X ~ Binomial(5, 2/3) (from its MGF), Y ~ Poisson(2), independent; Z = XY. E(Z) = E(X)E(Y) = (10/3)(2) = 20/3 ≈ 6.67. For the variance, Var(Z) = E(Z2) − (E Z)2 with E(Z2) = E(X2)E(Y2) (independence again, applied to X2 and Y2). E(X2) = Var(X) + (E X)2 = 10/9 + 100/9 = 110/9; E(Y2) = 2 + 4 = 6. So E(Z2) = (110/9)(6) = 220/3 and Var(Z) = 220/3 − 400/9 = 260/9 ≈ 28.89.
HW10 problem 11. X ~ N(0, 1) and Y ~ Exponential(1) independent: E[|X|(Y + 1)2] = E|X| · E[(Y + 1)2]. E|X| = √(2/π) ≈ 0.7979 (section 13.3). E[(Y + 1)2] = E(Y2) + 2E(Y) + 1 = (1 + 1) + 2 + 1 = 5, using E(Y2) = Var(Y) + (E Y)2 = 1 + 1. Answer: 5√(2/π) ≈ 3.989.
12.2 Sums of independent random variables
Why sums (slides): a sample of 100 Chapel Hill voters with Xi = 1 if voter i supports the candidate gives the total Σ Xi ~ Binomial(100, p); a study comparing two universities bases its conclusion on the sample averages (1/40) Σ Xi and (1/30) Σ Yj. Two methods find the distribution of a sum.
P(X + Y = n) = Σk=0n e−λ1λ1kk! e−λ2λ2n−k(n − k)! = e−(λ1+λ2)n! Σk=0n (nk) λ1kλ2n−k = e−(λ1+λ2) (λ1 + λ2)nn!,
by the binomial theorem: X + Y ~ Poisson(λ1 + λ2).MS(t) = E(etX1 etX2 ··· etXn) = MX1(t) MX2(t) ··· MXn(t).
Recipe: compute the individual MGFs, multiply, and see whether the product is the MGF of a known distribution.- Binomials with the same p (warning-sign slide). Xi ~ Bin(ni, p) independent: MS(t) = Π (1 − p + pet)ni = (1 − p + pet)n1+···+nm, so S ~ Bin(n1 + ··· + nm, p). (Different p's do not combine into a Binomial.)
- Poissons (warning-sign slide). Xi ~ Pois(λi) independent: MS(t) = e(λ1+···+λm)(et−1), so S ~ Pois(λ1 + ··· + λm), agreeing with Method 1.
- Normals (section 13.2): N(μ1, σ12) + N(μ2, σ22) = N(μ1 + μ2, σ12 + σ22).
- Sums of Geometrics are not Geometric and sums of Exponentials are not Exponential (their MGF products are not of the same form).
HW8 problem 5 was this: Poisson(3) + Poisson(1.2) = Poisson(4.2), so P(sum = 2) = e−4.2(4.2)2/2 ≈ 0.1323. By Method 1 instead: P(0)P(2) + P(1)P(1) + P(2)P(0) with the two pmfs gives the same number, more slowly.
12.3 Maximum and minimum of independent variables
Extra context beyond the slides, needed for HW9 problem 6 and practice problem 17.
P(max ≤ a) = P(all Xi ≤ a) = Πi P(Xi ≤ a), P(min > a) = P(all Xi > a) = Πi P(Xi > a).
Then P(max = k) = P(max ≤ k) − P(max ≤ k − 1) for integer values.HW9 problem 6. Twenty rolls of a fair four-sided die; Y = the maximum. Values 1, 2, 3, 4. P(Y ≤ i) = (i/4)20, so P(Y = i) = (i/4)20 − ((i − 1)/4)20: about 9 × 10−13, 9.5 × 10−7, 0.00317, 0.99683. With 20 rolls the maximum is almost surely 4.
Practice set, problem 17. P(max(X, Y) ≤ 1) = P(X ≤ 1)P(Y ≤ 1) = 2e−1 · 3e−2 = 6e−3 ≈ 0.2987 for independent Poisson(1) and Poisson(2).
Minimum of Exponentials. X ~ Exp(λ1), Y ~ Exp(λ2) independent: P(min > t) = e−λ1te−λ2t = e−(λ1+λ2)t, so the minimum is Exponential(λ1 + λ2).
12.4 Covariance
Cov(X, Y) = E[(X − EX)(Y − EY)] = E(XY) − E(X)E(Y).
Expanding the product: E[XY − μYX − μXY + μXμY] = E(XY) − μYμX − μXμY + μXμY = E(XY) − μXμY.Meaning (slides). Covariance signals the tendency of two variables to go up or down together relative to their means: positive (height and weight of a random person), negative (X up, Y tends down). Everything is random, so one can only talk about tendency. (For spurious correlations, the slides point to tylervigen.com.)
- Cov(X, Y) = Cov(Y, X); Cov(X, X) = Var(X); Cov(X, c) = 0 for a constant.
- Cov(aX + b, Y) = a Cov(X, Y), and more generally Cov(aX + b, cY + d) = ac Cov(X, Y). (In class: E[(aX + b)Y] − E(aX + b)E(Y) = aE(XY) + bE(Y) − aE(X)E(Y) − bE(Y).)
- Bilinear: Cov(Σi Xi, Σj Yj) = Σi Σj Cov(Xi, Yj). Expand like a product of sums.
- Independent ⇒ Cov(X, Y) = 0 (because E(XY) = E(X)E(Y)). Cov = 0 does not imply independence.
Uncorrelated but dependent (slides). X = −1, 0, 1 each with probability 1/3 and Y = X2. E(X) = 0, E(Y) = 2/3, E(XY) = E(X3) = 0, so Cov(X, Y) = 0 − 0 · (2/3) = 0. Yet Y is a function of X. Covariance only detects linear association.
Three coins (slides). X = number of heads, Y = number of tails in 3 fair tosses. Since Y = 3 − X, Cov(X, Y) = Cov(X, 3 − X) = Cov(X, 3) − Cov(X, X) = −Var(X) = −3(1/2)(1/2) = −3/4.
Practice set, problem 16. Cov(4X − Y, X + Y) = 4 Cov(X, X) + 4 Cov(X, Y) − Cov(Y, X) − Cov(Y, Y) = 4 Var(X) + 3 Cov(X, Y) − Var(Y): option (C).
Practice set, problem 24: socks. 8 left socks are matched at random with the 8 right socks (a random permutation). Ired = 1 if the red pair is matched correctly, Iblue likewise. P(red correct) = 1/8; P(red and blue both correct) = (1/8)(1/7) = 1/56. Cov(Ired, Iblue) = E(IredIblue) − E(Ired)E(Iblue) = 1/56 − 1/64 = 1/448 ≈ 0.00223, in (0.001, 0.0025]. Slightly positive: a correct red match removes one wrong option for blue. (For indicators, E(IAIB) = P(A ∩ B), so Cov = P(A ∩ B) − P(A)P(B).)
HW9 problem 10 (stock prices), part 1. E(X) = 1, E(Y) = 3, E(Z) = 3; E(X2) = 2, E(Y2) = 12, E(Z2) = 12; E(XY) = 2, E(XZ) = 4, E(YZ) = 9. Then Var(X) = 2 − 1 = 1, Var(Y) = 12 − 9 = 3, Var(Z) = 3; Cov(X, Y) = 2 − 3 = −1, Cov(X, Z) = 4 − 3 = 1, Cov(Y, Z) = 9 − 9 = 0.
Extra context beyond the slides: multinomial counts are negatively correlated, Cov(Xi, Xj) = −n pipj. In HW9 problem 4, Cov(XA, XV) = −4(0.35)(0.45) = −0.63.
12.5 Variance of a sum
Var(Σi=1n Xi) = Σi=1n Var(Xi) + 2 Σi<j Cov(Xi, Xj),
because Var(Σ Xi) = Cov(Σ Xi, Σ Xj) = ΣiΣj Cov(Xi, Xj), and the diagonal terms are the variances. Two variables: Var(X ± Y) = Var(X) + Var(Y) ± 2 Cov(X, Y) and Var(aX + bY) = a2Var(X) + b2Var(Y) + 2ab Cov(X, Y). If the Xi are independent (or merely uncorrelated), all cross terms vanish and Var(Σ Xi) = Σ Var(Xi). Means always add; variances add only without covariance.The Binomial variance np(1 − p) is n copies of the Bernoulli variance p(1 − p), and the average of n independent copies has Var(X̄) = σ2/n (used in section 14).
HW10 problem 7. X0, …, X3 independent with variance σ2; Y1 = X1 + 3X0, Y2 = X2 + 2X1, Y3 = X3 − X2. First simplify the sum: Y1 + Y2 + Y3 = 3X0 + 3X1 + X3 (the X2 terms cancel). Then Var = 9σ2 + 9σ2 + σ2 = 19σ2: C = 19, in [15, 20), option (D). Adding Var(Y1) + Var(Y2) + Var(Y3) = 10 + 5 + 2 = 17 would be wrong, because the Y's share X's and are correlated.
HW9 problem 9: symmetrization. X′ and X″ are independent copies of X and E[(X′ − X″)2] = 20. Since E(X′ − X″) = 0, E[(X′ − X″)2] = Var(X′ − X″) = Var(X) + Var(X) = 2Var(X). So Var(X) = 10.
HW9 problem 10, part 3: the portfolio. R = X + 2Y + Z. Var(R) = Var(X) + 4Var(Y) + Var(Z) + 2[2Cov(X, Y) + Cov(X, Z) + 2Cov(Y, Z)] = 1 + 12 + 3 + 2[−2 + 1 + 0] = 14, so σR = √14 ≈ 3.7417. The negative covariance between X and Y reduces the risk; that is diversification.
12.6 Correlation
ρ(X, Y) = Corr(X, Y) = Cov(X, Y)√(Var(X) Var(Y)).
Fact 1: −1 ≤ ρ ≤ 1. Fact 2: if ρ = −1 then Y = −aX + b with a > 0 (and ρ = 1 means Y = aX + b, a > 0): a perfect linear relationship. Fact 3: ρ(aX + b, Y) = ρ(X, Y) for a > 0 (the sign flips if a < 0). X and Y are called uncorrelated when ρ = 0; that is weaker than independent. ρ measures the strength and direction of a linear relationship.Why |ρ| ≤ 1 (in class). Standardize: U = (X − EX)/√Var(X) and V = (Y − EY)/√Var(Y), so E(U) = E(V) = 0, E(U2) = E(V2) = 1 and ρ = E(UV). For any number t, 0 ≤ E[(U + tV)2] = 1 + 2tρ + t2. Taking t = −ρ gives 0 ≤ 1 − ρ2, so −1 ≤ ρ ≤ 1. If ρ = −1 the choice t = 1 gives E[(U + V)2] = 0, so U = −V always, which unwinds to Y = −aX + b with a = √(Var Y/Var X) > 0: Fact 2. Fact 3 follows from Cov(aX + b, Y) = a Cov(X, Y) and Var(aX + b) = a2Var(X).
HW9 problem 10, parts 1–2. ρ(X, Y) = −1/(√1 √3) = −1/√3 ≈ −0.5774. ρ(Y, Z) = 0/(√3 √3) = 0: Y and Z are uncorrelated (from the given moments you cannot tell whether they are independent).
12.7 Check yourself
Answer
(8/13)(7/12) = 14/39; 8/13; not independent since (8/13)2 = 64/169 ≠ 14/39.Answer
No: the support is not a rectangle and the formula is not a product.Answer
Poisson(3), independent of the Poisson(7) normal dogs; e−3 ≈ 0.0498.Answer
E(Z) = 20/3 ≈ 6.67; E(Z2) = (110/9)(6) = 220/3; Var(Z) = 260/9 ≈ 28.89.Answer
(3/4)20 − (1/2)20 ≈ 0.00317.Answer
−Var(X) = −3/4; ρ = (−3/4)/(√(3/4)√(3/4)) = −1 (Y is exactly 3 − X).Answer
4Var(X) + 3Cov(X, Y) − Var(Y). 10 Cov(X, Y) (constants drop out).Answer
1/56 − 1/64 = 1/448 ≈ 0.00223.Answer
Var(3X0 + 3X1 + X3) = 19σ2.Answer
2Var(X) = 20, so Var(X) = 10.Answer
−1/√3 ≈ −0.5774; 0; √14 ≈ 3.7417.Answer
8 + 27 = 35; 5; 5. Var(2X1) = 8 but Var(X1 + X2) = 4.Answer
E(XY) = E(X3) = 1/4; E(X)E(Y) = (1/2)(1/3) = 1/6; Cov = 1/12. Not independent (Y is a function of X); ρ ≈ 0.968.Answer
Rates 0.1 and 0.2, so the minimum is Exponential(0.3) with mean 3.33 hours; P(min > 2) = e−0.6 ≈ 0.5488.Deck 813. The Normal distribution
The idea. The Normal (Gaussian, "bell curve") is the distribution of standardized test scores, blood pressure and beta-carotene levels, the driving component of the Black–Scholes model in finance, and, by the central limit theorem (section 14), the approximate distribution of any sum or average of many independent terms. Every computation reduces to the standard Normal Z through standardization, and probabilities for Z come from its cdf Φ, which has no formula but is tabulated.
13.1 Definition, standardization and the table
f(x) = 1√(2πσ2) e−(x−μ)2/(2σ2), −∞ < x < ∞, with E(X) = μ, Var(X) = σ2, MX(t) = eμt + σ2t2/2.
Note 3 (slides): if a ≠ 0 then aX + b ~ N(aμ + b, a2σ2). N(0, 1) is the standard Normal; its cdf is Φ(x) = P(Z ≤ x) = ∫−∞x e−y2/2/√(2π) dy, which cannot be written with elementary functions.P(X ≤ x) = P(Z ≤ x − μσ) = Φ(x − μσ), P(a < X < b) = Φ(b − μσ) − Φ(a − μσ), Φ(−x) = 1 − Φ(x).
For x > 0, Φ(x) is given in Table 5.1 of the textbook (the slide reads P(Z ≤ 2.23) = 0.9871 off the table); for x < 0 use the symmetry. The 68–95–99.7 rule: P(|X − μ| < σ) ≈ 0.68, P(|X − μ| < 2σ) ≈ 0.95, P(|X − μ| < 3σ) ≈ 0.997.Note 2: why the constant is 1/√(2πσ2) (in class). Let I = ∫−∞∞ e−x2/2 dx. Then I2 = ∫∫ e−(x2+y2)/2 dx dy = ∫02π∫0∞ e−r2/2 r dr dθ = ∫02π 1 dθ = 2π in polar coordinates, so I = √(2π), and the substitution x = μ + σz brings in the σ. Why Z has mean 0: zφ(z) is odd. Why variance 1: integrate by parts, or use the MGF below.
| z | 0 | 0.25 | 0.5 | 0.75 | 1 | 1.25 | 1.5 | 1.645 | 1.75 | 1.96 | 2 | 2.25 | 2.5 | 3 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Φ(z) | 0.5000 | 0.5987 | 0.6915 | 0.7734 | 0.8413 | 0.8944 | 0.9332 | 0.9500 | 0.9599 | 0.9750 | 0.9772 | 0.9878 | 0.9938 | 0.9987 |
Example. Heights are N(70, 9) inches (σ = 3). P(X > 76) = 1 − Φ(2) = 0.0228. P(67 < X < 73) = Φ(1) − Φ(−1) = 0.8413 − 0.1587 = 0.6826. The 90th percentile is μ + 1.2816σ ≈ 73.8 inches, since Φ(1.2816) = 0.90.
13.2 The MGF, the moments, and sums of Normals
Note 4 (in class). MX(t) = 1σ√(2π) ∫ etx e−(x−μ)2/(2σ2) dx. Substitute x = μ + σz, dx = σ dz: MX(t) = 1√(2π) ∫ exp(μt + σtz − z2/2) dz. Complete the square, σtz − z2/2 = −(z − σt)2/2 + σ2t2/2:
MX(t) = eμt + σ2t2/2 · 1√(2π) ∫ e−(z−σt)2/2 dz = eμt + σ2t2/2,
because the remaining integrand is the density of a Normal shifted by σt and integrates to 1. For Z itself, MZ(t) = et2/2.
Note 5 (in class). M′X(t) = (μ + σ2t) MX(t), so E(X) = M′(0) = μ. M″X(t) = σ2MX(t) + (μ + σ2t)2MX(t), so E(X2) = σ2 + μ2 and Var(X) = σ2. (The slides suggest also computing ∫ x f(x) dx and ∫ x2 f(x) dx directly at home.) From MZ, E(Z4) = 3, so Var(Z2) = 2.
Note 3 via the MGF. MaX+b(t) = ebtMX(at) = ebt + aμt + a2σ2t2/2 = e(aμ+b)t + (a2σ2)t2/2, exactly the MGF of N(aμ + b, a2σ2). Standardizing is the case a = 1/σ, b = −μ/σ.
Example. X ~ N(2, 4) and Y ~ N(1, 5) independent. X − Y ~ N(1, 9), so P(X > Y) = P(X − Y > 0) = 1 − Φ(−1/3) = Φ(1/3) ≈ 0.6306.
13.3 E|Z| (HW10 problem 11)
E|Z| = ∫−∞∞ |z| φ(z) dz = 2 ∫0∞ z e−z2/2√(2π) dz = 2√(2π) [−e−z2/2]0∞ = 2√(2π) = √(2/π) ≈ 0.7979.
(The substitution u = z2/2 does the integral.) So the average distance of a standard Normal from 0 is about 0.8, less than its standard deviation 1, as it should be: E|Z| ≤ √E(Z2) = 1. HW10 problem 11 then gives E[|X|(Y + 1)2] = √(2/π) · 5 ≈ 3.989 (section 12.1).
13.4 Check yourself
Answer
0.9871 (table); 1 − 0.9332 = 0.0668; 0.9772 − 0.1587 = 0.8185; 2(0.0228) = 0.0456.Answer
σ = 15: 1 − Φ(2) = 0.0228; Φ(1) − Φ(−1) = 0.6826.Answer
√(2/π) × 5 ≈ 3.989.Answer
X − Y ~ N(1, 9): Φ(1/3) ≈ 0.6306.Answer
Normal with μ = 3 and σ2/2 = 8, so σ2 = 16, σ = 4. P(X > 7) = 1 − Φ(1) = 0.1587.Answer
N(3μ − 2, 9σ2); N(0, 1).Answer
1; 3; 2.Answer
N(50, 64/16) = N(50, 4), σ = 2: P = 1 − Φ(1.5) = 0.0668.Deck 814. Limit theorems: the CLT, the law of large numbers, and the inequalities
Where this sits. These are the last slides of deck 8, and sections 6–7 of the instructor's Lectures 5–8 study guide mark them as warning-sign material. (The syllabus had listed them under deck 9, but deck 9 itself is jointly continuous random variables, which is not on this midterm.)
The idea. Why does a sample of about 1100 people predict an election? How long must a simulation run? The answers come from limit theory. The law of large numbers says the average of many independent observations settles at the mean. The central limit theorem says the fluctuations around the mean are Normal, with size σ/√n, whatever the original distribution; it is why the Normal is everywhere and how we approximate Binomial probabilities. Markov's and Chebyshev's inequalities give guaranteed bounds from a mean alone or a mean and a variance, and Chebyshev is what proves the law of large numbers.
14.1 The central limit theorem
Zn = X1 + ··· + Xn − nμσ√n
tends to the standard Normal as n → ∞: P(Zn ≤ a) → Φ(a) for every a. Punchline: for large n,Sn = X1 + ··· + Xn ≈ N(nμ, nσ2) and S̄n = Sn/n ≈ N(μ, σ2/n).
The numerator subtracts the mean of the sum; the denominator is the standard deviation of the sum. (Annotation on the slide: "mean of each Xi already subtracted off, divided by σ".)Idea of the proof (in class). Assume the MGF of Xi exists. Let Ui = (Xi − μ)/σ, so E(Ui) = 0, E(Ui2) = 1 and Zn = (U1 + ··· + Un)/√n. A second-order Taylor expansion at s = 0 gives MU(s) = 1 + E(U)s + E(U2)s2/2 + o(s2) = 1 + s2/2 + o(s2). By independence, MZn(t) = [MU(t/√n)]n = [1 + t2/(2n) + o(1/n)]n → et2/2, the MGF of N(0, 1), using (1 + x/n)n → ex. Fact: if the MGFs converge, the cdfs converge.
Example 1 (slides): a random walk. Xi = ±1 with probability 1/2 each (a stock price moving up or down by 1 each day). P(S50 > 10)?
- One step: E(Xi) = 0, E(Xi2) = 1, so Var(Xi) = 1.
- By independence, E(S50) = 0 and Var(S50) = 50; by the CLT, S50 ≈ N(0, 50).
- P(S50 > 10) ≈ P(Z > 10/√50) = P(Z > 1.41) = 1 − Φ(1.41) ≈ 1 − 0.9207 = 0.079.
Extra context beyond the slides: S50 only takes even values, so "S50 > 10" means S50 ≥ 12 and a continuity correction uses P(W > 11) = 1 − Φ(11/√50) = 1 − Φ(1.56) ≈ 0.060, very close to the exact 0.0595. The uncorrected 0.079 is what the lecture computed; either is acceptable as a CLT approximation unless the problem asks for the correction.
Example 3 (slides): the astronomer. Measurements are iid with mean d (the true distance) and variance 4. How many are needed to be "reasonably sure" (say 95%) that the average is within ±0.5 light-year of d? The average X̄n ≈ N(d, 4/n), so P(|X̄n − d| ≤ 0.5) = P(|Z| ≤ 0.5/(2/√n)) = P(|Z| ≤ 0.25√n). For this to be 0.95 we need 0.25√n ≥ 1.96, i.e. n ≥ (7.84)2 ≈ 61.5: about 62 measurements. (Chebyshev, in 14.4, gives the distribution-free but much more conservative n ≥ 320.)
HW10 problem 1. Xi = 1 or 2 with probabilities 1/3, 2/3. μ = 1/3 + 4/3 = 5/3; E(Xi2) = 1/3 + 8/3 = 3, so σ2 = 3 − 25/9 = 2/9 and σ = √2/3. The CLT says the distribution of
X1 + ··· + Xn − 5n/3√(2n/9) = X1 + ··· + Xn − 5n/3(√2/3)√n
tends to the standard Normal. The blanks are nμ and σ√n.
14.2 Normal approximation to the Binomial and the continuity correction
P(X = k) ≈ P(k − 0.5 < W < k + 0.5), P(X ≤ k) ≈ P(W < k + 0.5), P(X < k) ≈ P(W < k − 0.5),
and likewise P(X ≥ k) ≈ P(W > k − 0.5), P(X > k) ≈ P(W > k + 0.5). Move each integer cutoff by half a unit in the direction that captures the bars of the discrete distribution.The beer example (slides). Eva's PR firm tests 100 affirmed Bond-beer drinkers blind; X = number who prefer VP beer. In class the "worst case" p = 1/2 was used (most people cannot tell non-specialty beers apart), so X ~ Bin(100, 1/2): μ = np = 50, σ2 = np(1 − p) = 25, σ = 5, and W ~ N(50, 25).
- P(X > 40) ≈ P(W > 40.5) = P(Z > (40.5 − 50)/5) = P(Z > −1.9) = Φ(1.9) ≈ 0.9713.
- P(40 ≤ X ≤ 60) ≈ P(39.5 < W < 60.5) = P(−2.1 < Z < 2.1) = Φ(2.1) − Φ(−2.1) = 2Φ(2.1) − 1 ≈ 0.9643.
(Exact Binomial values: 0.9716 and 0.9648. Without the correction the answers would be 0.9772 and 0.9545, noticeably worse.) Rule of thumb: the approximation is good when np(1 − p) is at least about 10.
Another example. 100 fair coin tosses; P(at least 60 heads) ≈ P(W > 59.5) = 1 − Φ(9.5/5) = 1 − Φ(1.9) ≈ 0.0287 (exact 0.0284).
14.3 The weak law of large numbers
P(|X1 + ··· + Xnn − μ| ≥ ε) → 0 as n → ∞.
Punchline: the sample mean gets closer and closer to the population mean as the sample size grows.Exercise on the slide. With Xi = IAi the indicator that event A happens on trial i (so μ = P(A)), the law says the observed proportion of trials on which A occurs converges to P(A). That is the frequency interpretation of probability, now a theorem, and the reason the London-bomb and Gretzky tables match the Poisson so well.
14.4 Markov's and Chebyshev's inequalities
P(X ≥ a) ≤ E(X)a.
Proof (in class): since X ≥ 0 and a > 0, X ≥ a · 1{X ≥ a} always (if X ≥ a the right side is a ≤ X; otherwise it is 0 ≤ X). Take expectations: E(X) ≥ a P(X ≥ a); divide by a.
P(|X − μ| ≥ a) ≤ σ2a2, equivalently P(|X − μ| < a) ≥ 1 − σ2a2.
Proof (in class): Y = (X − μ)2 is a non-negative random variable, so Markov gives P(Y ≥ a2) ≤ E(Y)/a2 = Var(X)/a2; and {Y ≥ a2} is the same event as {|X − μ| ≥ a}. With a = kσ: at most 1/k2 of any distribution lies k or more standard deviations from its mean (compare the Normal's 0.0456 at k = 2).
Example 2a (slides): the factory. Weekly production X has mean 50.
- P(X > 75) ≤ P(X ≥ 75) ≤ 50/75 = 2/3 by Markov (production is non-negative).
- If also Var(X) = 25: P(40 ≤ X ≤ 60) = P(|X − 50| ≤ 10) = 1 − P(|X − 50| > 10) ≥ 1 − P(|X − 50| ≥ 10) ≥ 1 − 25/100 = 3/4 by Chebyshev.
Nothing was assumed about the shape of the distribution; that is the point, and also why the bounds are loose.
HW10 problem 2. X ~ Poisson(100), so E(X) = Var(X) = 100. (a) Markov: P(X > 120) ≤ P(X ≥ 120) ≤ 100/120 ≈ 0.8333 (or, using the integer values, ≤ 100/121 ≈ 0.8264; both are valid bounds). (b) Chebyshev: {X > 120} is contained in {|X − 100| ≥ 20}, so P(X > 120) ≤ 100/400 = 0.25. The true probability is about 0.023.
The astronomer by Chebyshev. P(|X̄n − d| ≥ 0.5) ≤ Var(X̄n)/0.25 = (4/n)/0.25 = 16/n. For this to be at most 0.05 we need n ≥ 320, versus about 62 from the CLT: Chebyshev holds for every distribution but pays for it in sharpness.
14.5 Proof of the weak law (how Chebyshev does it)
P(|X̄n − μ| ≥ ε) ≤ Var(X̄n)ε2 = σ2nε2 → 0.
Practice set, problem 18. The bound used in the proof is σ2/(ε2n): option (C). Options with n in the numerator get worse with more data, which cannot be right.
14.6 Check yourself
Answer
5n/3 and √(2n/9) = (√2/3)√n.Answer
Markov: ≤ 100/120 ≈ 0.833. Chebyshev: ≤ 100/202 = 0.25.Answer
σ2/(nε2).Answer
≤ 2/3 (Markov); ≥ 3/4 (Chebyshev).Answer
S100 ≈ N(0, 100): 1 − Φ(20/10) = 1 − Φ(2) ≈ 0.0228 (with the continuity correction, 1 − Φ(2.1) ≈ 0.018; exact 0.0176).Answer
Φ(1.9) ≈ 0.9713; 2Φ(2.1) − 1 ≈ 0.9643.Answer
0.25√n ≥ 1.96 gives n ≈ 62; 16/n ≤ 0.05 gives n ≥ 320.Answer
1 − Φ(9.5/5) = 1 − Φ(1.9) ≈ 0.0287.Answer
144/36 = 4, SD 2; P(|Z| < 2) ≈ 0.9545.Answer
Markov: 0.2. Chebyshev with a = 8: ≥ 1 − 16/64 = 0.75.15. Exam strategy
15.1 Recognize the distribution from the story
Most questions are "identify the model, write its parameters, use one formula". Decide the model before touching the calculator.
| The story says | Model | Parameters | First formula to write |
|---|---|---|---|
| n independent yes/no trials, same p, count the successes | Binomial(n, p) | n, p (p may itself need a total-probability step) | (nk)pk(1 − p)n−k; mean np, variance np(1 − p) |
| Many trials, tiny p, "use the Poisson approximation" | Poisson(λ) | λ = np | e−λλk/k! |
| Events at a constant rate over a time window | Poisson process | λ = rate × window length (same units!) | N(t) ~ Poisson(λt); wait for the first event ~ Exponential(rate) |
| Trials until the first success | Geometric(p) | p | (1 − p)k−1p; mean 1/p; P(X > k) = (1 − p)k |
| A random point in an interval; "equally likely anywhere" | Uniform(a, b) | a, b | length/(b − a); mean (a + b)/2; variance (b − a)2/12 |
| Waiting time, lifetime, "memoryless", "mean lifetime" | Exponential(λ) | λ = 1/mean | P(X > x) = e−λx |
| Several categories, fixed n, "exactly n1 of type 1, n2 of type 2 …" | Multinomial | n; p1, …, pr | n!/(n1!···nr!) Π pini |
| Draws without replacement, counts of each type | Counting (hypergeometric) | population sizes, draws | Π(Niki) / (Nn) |
| "Number of … that …" with no clean distribution | Indicators | one event per item | E(X) = Σ P(Ai) |
| Bell-shaped measurement; sums or averages of many terms | Normal / CLT | μ, σ2 (of the sum: nμ, nσ2) | Standardize, read Φ; ±0.5 continuity correction for counts |
| Only a mean (and maybe a variance) is known; "what can be said about …" | Markov / Chebyshev | E(X); σ2 | E(X)/a; σ2/a2 |
15.2 Four questions before you compute
- What is the random variable, and what values can it take? Write "X = number of …" or "X = time until …" and its range. Half of the practice set is answered correctly by this alone.
- Discrete or continuous? Discrete: sums, endpoints matter, P(X = a) can be positive. Continuous: integrals, endpoints never matter, P(X = a) = 0.
- Independent or not? Independence lets you multiply probabilities and MGFs and add variances. Means add regardless. If the problem says "given", "conditional on", or describes one variable in terms of another, there is dependence and you need total probability or a joint pmf.
- Is the complement easier? "At least one", "more than two", "at most n − 1": compute the small side and subtract from 1.
15.3 Multiple-choice tactics
- Interval answers: compute to four decimals, then check whether the endpoints are included: (0.25, 0.40] includes 0.40, [0.5, 0.65) excludes 0.65. When your number lands within 0.005 of an endpoint, recompute with more precision before choosing.
- Formula answers: test the options at an easy value (p = 0, n = 1, t = 0). An MGF option must equal 1 at t = 0. A pmf option must give probabilities between 0 and 1 at the smallest and largest values. Options that add MGFs or multiply variances by a instead of a2 are wrong on sight.
- Sanity limits: variances are never negative; a probability from a Poisson or Binomial with mean 2 should not be 0.9; E(number of successes) ≤ n; E(X) for an Exponential is 1/λ, not λ; the median of an Exponential is below its mean.
- Units: rate per hour times minutes is the most common silent error. Convert first.
- Time: about 6 minutes per question for 12 questions in 75 minutes. Do the recognizable ones first; MGF and covariance algebra questions are usually fastest.
15.4 The traps
| Trap | Correct thinking |
|---|---|
| Using P(positive | sick) when the person tested negative | Every term in Bayes must condition on the result actually observed. |
| Calling disjoint events independent | Disjoint with positive probabilities ⇒ dependent (one rules out the other). |
| P(1 ≤ X ≤ 2) = F(2) − F(1) for a discrete X | F(2) − F(just below 1) = F(2) − F(0) for integer values. |
| Treating f(a) as a probability | f(a) is a density; probabilities are areas. f can exceed 1. |
| E(X2) = (E X)2 | E(X2) = Var(X) + (E X)2; the plug-in rule for E g(X). |
| Var(aX + b) = aVar(X) + b | a2Var(X); the b vanishes. SD scales by |a|. |
| Var(X + Y) = Var(X) + Var(Y) always | Only if uncorrelated; in general add 2Cov(X, Y). Means add always. |
| M3X−2Y(t) = MX(t)3 MY(t)−2 | MX(3t) MY(−2t), and only for independent X, Y. |
| Poisson process over 2 hours at 4 per week with λ = 4 | λt = rate × length in the rate's units. |
| Exponential "mean 2" used as λ = 2 | λ = 1/mean = 1/2. |
| Forgetting the age in a memoryless question, or including it | P(X > s + t | X > s) = e−λt: the extra time only. |
| Dividing by 2! in a multinomial with two distinguishable groups of the same size | Categories are labeled; n!/(n1!···nr!) with no extra division. |
| Concluding independence from Cov = 0 | Cov = 0 is weaker; check the joint pmf factors (and the support is a rectangle). |
| Adding Var(Y1) + Var(Y2) + Var(Y3) when the Y's share terms | Simplify the sum first, then apply the variance to independent pieces. |
| Using Chebyshev as an approximation | It is an upper bound; the true probability is usually far smaller. |
| CLT denominator σ or σn | σ√n for the sum; σ/√n for the average. |
| Normal approximation to a count without the ±0.5 | P(X ≤ k) ≈ P(W < k + 0.5); P(X ≥ k) ≈ P(W > k − 0.5). |
16. Practice exams
Part A is the practice set posted for Midterm 2, with worked answers. Part B is a new set in the same style. Do each part in 75 minutes with only a calculator, then read every solution, including the ones you got right. The real exam will not just be variants of these, so focus on which concept each question uses.
16.1 Part A: the posted practice problems
Every Part A answer below opens with the one big concept the question is testing, then works the arithmetic in full and flags the traps the distractors are built from. Read the concept line first — if you can name it before you compute, you can handle the exam's version of the same question.
Answer
Big concept: independence is a numerical condition, P(E ∩ F) = P(E)P(F) — not the same as disjoint.Work on the 36 equally likely (red, blue) pairs. E = "sum is 7" = {(1,6),(2,5),(3,4),(4,3),(5,2),(6,1)}, so P(E) = 6/36 = 1/6. F = "red shows 4", so P(F) = 6/36 = 1/6. For E ∩ F the red die is pinned at 4, so the blue die must be 3: exactly one outcome, P(E ∩ F) = 1/36. Compare: P(E)P(F) = (1/6)(1/6) = 1/36. They match, so E and F are independent. They are certainly not disjoint, since (4,3) is in both — disjoint would force P(E ∩ F) = 0. (B) independent.
Why this works and when it breaks: a sum of 7 is the one total that is equally likely under every value of the red die (whatever red shows, exactly one blue value completes it), so learning red = 4 tells you nothing about the sum being 7. Change the target to "sum is 6" and that symmetry dies: P(E) = 5/36, P(E ∩ F) = P(red 4, blue 2) = 1/36, but P(E)P(F) = 5/216 ≠ 1/36 — neither disjoint nor independent, answer (C).
Answer
Big concept: law of total probability — split on the conditioning event, and read "exactly one" as a union of disjoint cases.Joe's probability is conditional on John, so you cannot multiply marginals. Condition on John:
• John attends (0.65) and Joe does not (1 − 0.8 = 0.2): 0.65(0.2) = 0.13.
• John does not attend (0.35) and Joe does (0.45): 0.35(0.45) = 0.1575.
These two cases are disjoint and cover "exactly one", so add: 0.13 + 0.1575 = 0.2875, which sits in (0, 0.35]. (A).
Trap: treating the two attendances as independent with P(Joe) = 0.8 gives 0.65(0.2) + 0.35(0.8) = 0.41 — wrong, because 0.8 only applies in the branch where John attends. Always ask whether a given number is a marginal or a conditional.
Answer
Big concept: a "first success wins" race — use the restart (renewal) argument instead of summing an infinite series by hand.First get the per-turn success probabilities on a 4-sided × 6-sided roll (24 equally likely pairs). Sum 3: (1,2), (2,1) → pA = 2/24 = 1/12. Sum 4: (1,3), (2,2), (3,1) → pB = 3/24 = 1/8.
Now condition on the first full round. A wins immediately with probability pA. If A fails and B fails — probability (1 − pA)(1 − pB) — the situation is identical to the start, so A's win probability q satisfies
q = pA + (1 − pA)(1 − pB) q ⇒ q = p_A1 - (1-p_A)(1-p_B).
Here (11/12)(7/8) = 77/96, so the denominator is 19/96 and q = (1/12)(96/19) = 8/19 ≈ 0.4211, in (0.25, 0.45]. (B).
Sanity check: A goes first (an advantage) but has the smaller per-turn probability (1/12 < 1/8), and the second effect wins, so the answer should land a bit below 1/2. The same formula is the geometric-series sum ∑k≥0 [(1−pA)(1−pB)]k pA.
Answer
Big concept: independence passes through complements, unions and intersections — so conditioning on an independent event changes nothing, and unions are handled by complementing.Step 1 (drop the condition): I is independent of every event built from E, F, G, H, so P((E ∪ Fc ∪ G) ∩ H | I) = P((E ∪ Fc ∪ G) ∩ H). The 0.5 is a decoy.
Step 2 (the union, via its complement): P(E ∪ Fc ∪ G) = 1 − P(Ec ∩ F ∩ Gc) = 1 − (0.8)(0.3)(0.9) = 1 − 0.216 = 0.784. Note the complement of Fc is F, with probability 0.3 — not 0.7.
Step 3 (the intersection): multiply by P(H) = 0.4 → 0.784(0.4) = 0.3136, in (0.25, 0.5]. (D).
Why complement the union: inclusion–exclusion on three events needs seven terms; complementing turns it into one product. This "1 − (all fail)" move is the single most reused trick on independence problems.
Answer
Big concept: Bayes' theorem, run on a negative result — so the relevant rates are the false-negative and true-negative rates.Let A = addicted. Given: P(A) = 0.4 (the prior/base rate), P(+ | A) = 0.7 so P(− | A) = 0.3, and P(+ | Ac) = 0.2 so P(− | Ac) = 0.8. Flip the conditioning:
P(A | −) = P(A)P(− | A)P(A)P(− | A) + P(Ac)P(− | Ac) = 0.4(0.3)0.4(0.3) + 0.6(0.8) = 0.120.12 + 0.48 = 0.120.60 = 0.20, in (0.15, 0.3]. (B).
Counting version (often faster): per 1000 adults, 400 addicted (120 test negative) and 600 not (480 test negative); 600 negatives total, 120 of them addicted → 120/600 = 0.2.
Sanity check: a negative result is evidence against addiction, so the answer must be below the 0.4 prior. The denominator is always P(evidence) — the total probability of the thing you actually observed.
Answer
Big concept: the Geometric distribution counts trials until the first success, and E(X) = 1/p.Each kidney independently matches with p = 0.1, and you stop at the first match, so X ~ Geometric(0.1) in the "number of trials including the success" convention: P(X = k) = (0.9)k−1(0.1). Then E(X) = 1/p = 10, in [6, 12). (C).
Also know: Var(X) = (1 − p)/p2 = 0.9/0.01 = 90, SD ≈ 9.49 — a geometric is very spread out. And watch the convention: if the book counts failures before the first success, the mean is (1 − p)/p = 9, which would still land in (C) here but not in general.
Intuition: at a 1-in-10 success rate you expect to wait about 10 tries — the mean is the reciprocal of the rate. This is the discrete cousin of the Exponential's mean 1/λ.
Answer
Big concept: law of total probability as a weighted average over a partition of the population.The three classes partition the policy holders, so weight each death probability by its class share:
P(dies) = 0.5(0.4) + 0.4(0.2) + 0.1(0.1) = 0.20 + 0.08 + 0.01 = 0.29, which lies in (0.275, 1.0]. (E).
Checks that catch errors: the weights must sum to 1 (0.5 + 0.4 + 0.1 = 1 ✓), and the answer must land between the smallest and largest conditional probability (0.1 ≤ 0.29 ≤ 0.4 ✓). It sits near 0.4 because the highest-risk class carries half the weight.
Companion skill: the natural follow-up "given a holder died, P(standard)?" is the Bayes version — 0.20/0.29 ≈ 0.69 — reusing this same 0.29 as the denominator.
Answer
Big concept: for a discrete random variable the pmf is the set of jump sizes of the cdf; then E(X) = ∑ x p(x).Read off the jumps of F at each point where it steps up:
at −2: 0.1 − 0 = 0.1 | at −0.75: 0.3 − 0.1 = 0.2 | at 0: 0.6 − 0.3 = 0.3 | at 1: 0.8 − 0.6 = 0.2 | at 2: 1 − 0.8 = 0.2.
They sum to 1 ✓. Now
E(X) = (−2)(0.1) + (−0.75)(0.2) + (0)(0.3) + (1)(0.2) + (2)(0.2) = −0.2 − 0.15 + 0 + 0.2 + 0.4 = 0.25, in (0.2, 0.3]. (D).
Key facts about a cdf: it is right-continuous and the mass sits at the left end of each interval of constancy — the value 0.6 "on [0, 1)" means the jump happens exactly at 0, so P(X = 0) = 0.3 and P(X ≤ 0) = 0.6. If asked for Var, square the same x values: E(X2) = 0.4 + 0.1125 + 0 + 0.2 + 0.8 = 1.5125, so Var = 1.5125 − 0.0625 = 1.45.
Answer
Big concept: Binomial mean and variance — E = np, Var = np(1 − p), SD = √(np(1−p)) — after defining "success" to match the question.X counts employees who get the flu, which happens when the vaccine fails, so the success probability for X is p = 1 − 0.7 = 0.3, and X ~ Binomial(40, 0.3) (fixed n, two outcomes, independent, constant p).
E(X) = 40(0.3) = 12; Var(X) = 40(0.3)(0.7) = 8.4; SD = √8.4 ≈ 2.90. (D).
The two traps the distractors are built from: (i) using p = 0.7 gives E = 28 — that is the count of protected employees, answering the wrong question; (ii) reporting 8.4 as the SD instead of the variance. Note SD < variance here only because 8.4 > 1; always take the square root last.
Rule of thumb: Var = np(1−p) is largest at p = 0.5 and shrinks toward 0 as p approaches 0 or 1 — extreme probabilities make outcomes predictable.
Answer
Big concept: Var(aX + b) = a2Var(X) — a shift adds nothing to variance, a scale multiplies it by the square.Build the cost: 40 vaccines at $70 is a fixed $2800, and each of the X sick employees costs $1000, so C = 2800 + 1000X with X ~ B(40, 0.3) from A9 (Var X = 8.4).
Var(C) = 10002 Var(X) = 1,000,000(8.4) = 8,400,000, in [10000, ∞). (E).
Why the $2800 vanishes: variance measures spread about the mean, and adding a constant moves the whole distribution without stretching it. Only the multiplier matters, and it enters squared because variance is in squared units.
Useful companions: E(C) = 2800 + 1000(12) = $14,800 (linearity, where the constant does count), and SD(C) = 1000(2.90) = $2898 — the SD scales by |a|, which is why SD is the figure you quote in dollars.
Answer
Big concept: in a Poisson process the count over an interval is Poisson with mean λt — you must scale the rate to the window.The rate is λ = 4 per week and the window is t = 2 weeks, so N ~ Poisson(λt = 8), and
P(N = 4) = e−8844! ≈ 0.0573. (C).
How the distractors are built: (B) uses the one-week mean 4 (forgot to scale), (A) uses 2 (confused the time with the mean), (D) divides instead of multiplying, (E) mismatches the exponent and the factorial. The general pmf is P(N = k) = e−λt(λt)k/k!, and the same (λt) must appear in all three places.
Related facts worth carrying: counts on disjoint intervals are independent, E(N) = Var(N) = λt = 8, and the waiting time between earthquakes is Exponential(4) with mean 1/4 week.
Answer
Big concept: Poisson approximation to the Binomial (n large, p small, λ = np), plus "more than" means take the complement.Here n = 200 and p = 0.01 are exactly the regime where B(n, p) ≈ Poisson(np), with λ = 200(0.01) = 2.
P(X > 2) = 1 − [P(0) + P(1) + P(2)] = 1 − e−2(1 + 2 + 42) = 1 − 5e−2 ≈ 1 − 0.6767 = 0.3233, in (0.25, 0.40]. (B).
Two places to be careful: (i) "more than twice" excludes 2, so you subtract k = 0, 1, 2 — subtracting only 0 and 1 gives the wrong 0.594; (ii) P(2) = e−222/2! = 2e−2, so the bracket is 1 + 2 + 2 = 5, not 1 + 2 + 4.
Why the approximation is legitimate: the exact Binomial answer is 0.3233 as well — agreement to four digits, because np stays moderate while p is tiny. Use Poisson for rare events in many trials; use the Normal approximation instead when np and n(1−p) are both large.
Answer
Big concept: X and Y are independent only if p(x, y) = pX(x)pY(y) for every pair — which requires a rectangular support and a factoring formula.Two independent reasons this fails:
1. Support test (the fast one). The range of y depends on x: y runs from −x to x. So p(1, 3) = 0 even though pX(1) > 0 and pY(3) > 0, and the product rule already breaks. Whenever the admissible y values move with x, independence is impossible — no arithmetic needed.
2. Factoring test. Even on the support, x2 + y2 is a sum and cannot be written as g(x)h(y). A joint pmf of independent variables must split into an x-part times a y-part.
(B) no.
Caution about the converse: a rectangular support plus a factoring formula does imply independence, but a symmetric-looking pmf does not imply anything about covariance — here Cov(X, Y) = 0 by the ±y symmetry even though X and Y are dependent. Uncorrelated ≠ independent.
Answer
Big concept: sampling without replacement → multivariate hypergeometric — count favorable combinations over total combinations.Three students are drawn from 3 + 4 + 5 = 12 without replacement, so all (123) = 220 triples are equally likely. X = 1 sophomore and Y = 1 junior forces the third pick to be one of the 5 seniors, so the favorable count is
(31)(41)(51) = 3 · 4 · 5 = 60,
giving P(X = 1, Y = 1) = 60/220 = 3/11 ≈ 0.2727. That is choice (B), 3 · 4 · 5 / (123).
Why the other forms are wrong: (A) forgets the senior must be chosen too; (D) multiplies marginal proportions as if the draws were independent with replacement; (E) adds probabilities for events that are not alternatives. Order does not matter here because both numerator and denominator count unordered sets — keep them consistent.
Generalization to memorize: P(k1, k2, k3) = (3k_1)(4k_2)(5k_3) / (123), the hypergeometric analogue of the multinomial (which is the with-replacement version, see A23).
Answer
Big concept: MGFs multiply over independent sums, and scaling moves inside the argument: MaX(t) = MX(at).By definition MZ(t) = E(etZ). With Z = 3X − 2Y and X, Y independent,
MZ(t) = E(et(3X − 2Y)) = E(e(3t)X)E(e(−2t)Y) = MX(3t) MY(−2t). (C).
Independence is what licenses splitting the expectation of the product into a product of expectations; the coefficients 3 and −2 then simply rescale t.
Why the distractors are tempting: (A) raises MGFs to powers — that is the rule for a sum of n iid copies, MX1+···+Xn(t) = MX(t)n, a different situation. (B) and (D) add MGFs, which never corresponds to any operation on random variables. (E) confuses the MGF with expectation's linearity.
Why MGFs matter: they identify distributions uniquely, so this product rule is how you prove facts like "sum of independent Poissons is Poisson" or "sum of independent Normals is Normal". Also M′(0) = E(X) and M″(0) = E(X2).
Answer
Big concept: covariance is bilinear — expand it like a product, using Cov(X, X) = Var(X) and Cov(X, Y) = Cov(Y, X).Cov(4X − Y, X + Y) = 4Cov(X, X) + 4Cov(X, Y) − Cov(Y, X) − Cov(Y, Y)
= 4Var(X) + 4Cov(X, Y) − Cov(X, Y) − Var(Y) = 4Var(X) + 3Cov(X, Y) − Var(Y). (C).
The decisive detail: coefficients come out to the first power, so the 4 stays a 4 — distractors (B) and (D) use 16, importing the squaring rule from variance. Squaring is correct for Var(aX + b) = a2Var(X) (see A10) because variance is covariance of a variable with itself, where the coefficient appears twice.
General template: Cov(aX + bY, cX + dY) = acVar(X) + (ad + bc)Cov(X, Y) + bdVar(Y). Setting b = d = 1, a = 4, c = 1 reproduces the answer. Also remember Cov(X, constant) = 0, so additive constants never matter.
Answer
Big concept: translate max/min events into statements about all the variables — max(X, Y) ≤ a means X ≤ a and Y ≤ a — then use independence to multiply the cdfs.P(max(X, Y) ≤ 1) = P(X ≤ 1, Y ≤ 1) = P(X ≤ 1)P(Y ≤ 1).
For X ~ Poisson(1): P(X ≤ 1) = e−1(1 + 1) = 2e−1 ≈ 0.7358.
For Y ~ Poisson(2): P(Y ≤ 1) = e−2(1 + 2) = 3e−2 ≈ 0.4060.
Product: 6e−3 ≈ 0.2987, in [0, 0.5). (A).
The companion identity: min(X, Y) > a means both exceed a, so P(min > a) = P(X > a)P(Y > a) — use the max rule for upper bounds and the min rule for lower bounds, and complement whichever you need.
Sanity check: the answer must be smaller than either factor alone, and 0.2987 < 0.406 ✓. Requiring two things at once can only shrink the probability.
Answer
Big concept: Chebyshev's inequality applied to the sample mean, with Var(X̄) = σ2/n — the engine of the weak law of large numbers.Chebyshev says P(|Z − E Z| ≥ ε) ≤ Var(Z)/ε2. Take Z = X̄ = (X1 + ··· + Xn)/n, which has E(X̄) = μ and, by independence plus the a2 scaling rule,
Var(X̄) = 1n2(nσ2) = σ2n.
Therefore P(|X̄ − μ| ≥ ε) ≤ σ2/(nε2). (C).
What this proves: the bound → 0 as n → ∞ for any fixed ε > 0, which is exactly the statement that X̄ converges to μ in probability — the WLLN. Averaging n observations divides the variance by n, so the SD shrinks like 1/√n.
Sign check on the distractors: any answer with n in the numerator (A, B) says averaging more data makes you less accurate, which is backwards; (D) and (E) misplace the squares — ε is always squared and n appears to the first power.
Answer
Big concept: for a continuous Uniform, probability = length of the favorable set — so translate the geometric condition into an interval for U.The break point is U ~ Uniform(0, 1) and the toothpick sits at 1/4. Amy's piece is whichever side holds the toothpick:
• If U > 1/4, the toothpick is in the left piece, so g(U) = U.
• If U < 1/4, the toothpick is in the right piece, so g(U) = 1 − U.
Now impose g(U) ≥ 1/2 in each case. When U < 1/4, 1 − U > 3/4 ≥ 1/2 automatically — the whole interval works, contributing 1/4. When U > 1/4, we need U ≥ 1/2, contributing length 1/2. The two sets are disjoint, so
P(g(U) ≥ 1/2) = 1/4 + 1/2 = 3/4, in (0.65, 1]. (E).
The transferable move: a piecewise-defined function of a uniform is handled by splitting the sample space at the breakpoints, solving the inequality separately on each piece, and adding the lengths — never by plugging into a formula. The answer is large because a break on the short side hands Amy the long piece.
Answer
Big concept: expectation of a count = sum of indicator probabilities (linearity of expectation), which holds even when the indicators are dependent.Let N = number of schools with no athlete, and write N = IUNC + IDuke + INCS, where each indicator is 1 if that school gets nobody. Then E(N) = P(no one picks UNC) + P(no one picks Duke) + P(no one picks NCS), and each term is a product over the four independent athletes:
• UNC empty: (0.5)(0.2)(0.7)(0.1) = 0.007
• Duke empty: (0.7)(0.9)(0.6)(0.95) = 0.3591
• NCS empty: (0.8)(0.9)(0.7)(0.95) = 0.4788
E(N) = 0.007 + 0.3591 + 0.4788 = 0.8449, in (0.6, 1.2]. (B).
Why this is the whole trick: N's own distribution is messy (the three indicators are clearly dependent — if two schools are empty, everyone went to the third), but linearity of expectation needs no independence whatsoever. Independence is used only inside each term, to multiply the four athletes' probabilities.
Sanity check: UNC is nearly impossible to leave empty (every athlete has a decent chance of picking it), while Duke and NCS are each roughly coin-flips, so a total just under 1 is right.
Answer
Big concept: density of a transformed variable — for monotone g, fY(y) = fX(g−1(y)) |d g−1(y)/dy| (change of variables).X ~ Uniform(−0.5, 0.5) has fX(x) = 1 on that interval. Y = X3 is strictly increasing, so invert: x = y1/3, and
dxdy = 13y−2/3.
Hence fY(y) = 1 · 13y−2/3 for y in (−0.125, 0.125). At y = 0.05: 0.052/3 ≈ 0.1357, so fY(0.05) ≈ 1/(3 · 0.1357) ≈ 2.456, in (1.5, 3]. (B).
The cdf route (safer if you forget the formula): FY(y) = P(X3 ≤ y) = P(X ≤ y1/3) = y1/3 + 0.5 on the support; differentiate to get the same (1/3)y−2/3. Deriving the density from the cdf always works and automatically handles the direction of the inequality — for a decreasing g the inequality flips, which is why the formula carries an absolute value.
Reality check: a density may exceed 1 (it is not a probability), and fY blows up near 0 because cubing squeezes a wide band of x values into a narrow band of y values near the origin.
Answer
Big concept: a compound/conditional setup — condition on X, use the Binomial for Y given X, then recombine with the law of total probability. Unpack the event {XY ≤ 1} case by case.Given X = x, Y ~ Binomial(x, 1/5). Take each value of X:
• X = 0 (prob 0.2): Y = 0, so XY = 0 ≤ 1 — always true, contributes 0.2.
• X = 1 (prob 0.4): XY = Y ∈ {0, 1}, which is ≤ 1 either way — always true, contributes 0.4.
• X = 2 (prob 0.4): XY = 2Y, which is ≤ 1 only if Y = 0, probability (4/5)2 = 0.64 — contributes 0.4(0.64) = 0.256.
Total: 0.2 + 0.4 + 0.256 = 0.856, in (0.6, 1.0]. (E).
Why case-by-case is unavoidable: XY ≤ 1 is not an event about X alone or Y alone, and X, Y are dependent (the number of trials for Y is X). Conditioning on X turns a dependent problem into three easy independent ones — the standard play whenever one variable sets the parameter of another.
Related computation worth practicing: E(Y) = E(E(Y | X)) = E(X/5) = (0 + 0.4 + 0.8)/5 = 0.24, using the tower property on the same decomposition.
Answer
Big concept: the multinomial distribution — independent trials with more than two outcome categories.With n = 5 customers, each independently choosing among four ramen types with probabilities (0.1, 0.1, 0.5, 0.3),
P(2 miso, 2 tonkotsu, 1 shoyu, 0 shio) = 5!2! 2! 1! 0!(0.5)2(0.3)2(0.1)1(0.1)0.
The multinomial coefficient is 120/(2 · 2 · 1 · 1) = 30, and the probability part is (0.25)(0.09)(0.1) = 0.00225. Multiply: 30(0.00225) = 0.0675, in (0.0025, 0.1]. (C).
What the coefficient is doing: 0.00225 is the probability of one specific ordering (say miso, miso, tonkotsu, tonkotsu, shoyu); there are 30 distinguishable orderings of that multiset, and they are disjoint, so you add 30 copies. Forgetting the coefficient gives 0.00225 and answer (B) — the most common error here.
Connections: with two categories this is exactly the Binomial, and each marginal is Binomial (e.g. the miso count is B(5, 0.5)). The counts are negatively correlated, since one customer choosing miso means one fewer available for tonkotsu. Contrast A14, the without-replacement (hypergeometric) version.
Answer
Big concept: covariance of two indicator variables, Cov(IA, IB) = P(A ∩ B) − P(A)P(B) — and matching without replacement creates small dependence.Randomly pair 8 left socks with 8 right socks. By symmetry, the red left sock is equally likely to meet any of the 8 right socks, so P(red matched) = 1/8, and likewise for blue.
For both: condition on the red pairing happening (1/8); the blue left sock now faces 7 remaining right socks, so P(blue matched | red matched) = 1/7. Hence P(both) = (1/8)(1/7) = 1/56.
Cov = 156 - 164 = 8 - 7448 = 1448 ≈ 0.00223, in (0.001, 0.0025]. (D).
Why the covariance is positive, not negative: learning that red found its partner removes one "wrong" right sock from blue's pool, nudging blue's chance from 1/8 up to 1/7. Sampling-without-replacement dependence can go either way — here the competing socks are eliminated, which helps.
Where this is used: the matching problem's total count M = ∑ Ii has E(M) = 8(1/8) = 1 and Var(M) = ∑Var(Ii) + ∑i≠jCov(Ii, Ij) = 8(7/64) + 56(1/448) = 1 — the indicator-plus-covariance method for variances of counts.
Answer
Big concept: Exponential quantiles — solve F(m) = 1/2 to get median = (ln 2)/λ = (mean)(ln 2), which is always below the mean.Mean 36 months means λ = 1/36, with F(t) = 1 − e−t/36. Set F(m) = 0.5:
e−m/36 = 0.5 ⇒ m = 36 ln 2 ≈ 36(0.6931) ≈ 24.95 months, in [20, 30). (A).
Why median < mean: the Exponential is right-skewed — a few very long-lived laptops drag the mean up above the typical value. The ratio is fixed: median = 0.693 × mean for every Exponential, so answers near 36 (choices C, D) are reading the mean as the median.
Other facts to keep handy: SD = mean = 36 (so the coefficient of variation is 1), the survival function is the clean P(T > t) = e−t/36, and memorylessness gives P(T > 50 | T > 14) = P(T > 36) — a used laptop is statistically as good as new.
16.2 Part B: a second exam
Answer
0.6(0.3)/[0.6(0.3) + 0.4(0.02)] = 0.18/0.188 ≈ 0.9574. (E).Answer
0.5(0.4)(0.7) + 0.5(0.6)(0.3) + 0.5(0.4)(0.3) = 0.14 + 0.09 + 0.06 = 0.29. (C).Answer
(1/6)/[1 − (5/6)(2/3)] = (1/6)/(4/9) = 3/8 = 0.375. (C).Answer
pmf 0.2, 0.3, 0.4, 0.1 at 1, 2, 4, 7. E(X) = 3.1; E(X2) = 0.2 + 1.2 + 6.4 + 4.9 = 12.7; Var = 12.7 − 9.61 = 3.09. (D).Answer
∫−11(1 − x2) = 4/3, so c = 3/4. P(X > 1/2) = (3/4)[(x − x3/3)]1/21 = (3/4)(2/3 − 11/24) = (3/4)(5/24) = 0.15625. (B).Answer
(1210)(0.7)10(0.3)2 + 12(0.7)11(0.3) + (0.7)12 ≈ 0.1678 + 0.0712 + 0.0138 = 0.2528. (C).Answer
λ = 2: e−223/3! = (8/6)e−2 ≈ 0.1804. (C).Answer
λt = 6(1/3) = 2: e−2(1 + 2) = 3e−2 ≈ 0.4060. (D).Answer
Memoryless: P(X > 500 more) = e−500/500. (B).Answer
P(X < 2 or X > 8) = 4/10; Var = 100/12 ≈ 8.33. (A).Answer
X = 0, 1, 3 with probabilities 0.3, 0.5, 0.2. E(X) = 1.1, E(X2) = 0.5 + 1.8 = 2.3, Var = 2.3 − 1.21 = 1.09. (C).Answer
Poisson(5). (A).Answer
(0.7)3(0.3) = 0.1029. (C).Answer
Indicator for each face: P(face appears) = 1 − (5/6)10 ≈ 0.8385; times 6 gives ≈ 5.031. (D).Answer
6!/(2! 1! 3!) · (1/6)6 = 60/46656 ≈ 0.00129. (C).Answer
4(4) + 9 − 2(2)(−2) = 33; ρ = −2/(2 · 3) = −1/3. (A).Answer
Marginals: P(X = 1) = 0.6; P(Y = 0, 1, 2) = 0.3, 0.4, 0.3. E(XY) = 0.2 + 0.4 = 0.6 = E(X)E(Y) = 0.6(1.0), so Cov = 0. But p(0, 0) = 0.1 ≠ 0.4(0.3) = 0.12, so not independent. (B).Answer
0.82 = 0.64. (C).Answer
P(min > 0.5) = P(X > 0.5)P(Y > 0.5) = e−0.5e−1.5 = e−2 ≈ 0.1353 (the minimum is Exponential(4)). (B).Answer
Same p, so X + Y ~ Binomial(5, 0.5): inom{5}{2}/25 = 10/32 = 0.3125. (C).Answer
σ = 2: 1 − Φ(1.5) = 0.0668. (B).Answer
0.4e−2 + 0.6e−1 ≈ 0.0541 + 0.2207 = 0.2749. (C).Answer
(52) · 4 · 3/(124) = 120/495 ≈ 0.2424. (C).Answer
X + Y ~ Poisson(4): e−4(1 + 4 + 8) = 13e−4 ≈ 0.2381. (C).Answer
P(X > 20) = 0.9520 ≈ 0.3585, and by memorylessness the conditional probability is the same. (A).Answer
9/36. (A).Answer
Mean 200, SD 10: Φ(1.05) − Φ(−1.05) = 2(0.8531) − 1 ≈ 0.7063. (D).Answer
X ~ Bin(180, 1/6): μ = 30, σ2 = 25, σ = 5. P(W > 39.5) = 1 − Φ(1.9) ≈ 0.0287 (exact Binomial 0.0321). (B).17. One-page summary
Read this the night before and again right before the exam. The distribution table is the single most useful thing to have memorized.
17.1 The distributions
| Name | Story | pmf / pdf | Mean | Variance | MGF |
|---|---|---|---|---|---|
| Bernoulli(p) | one yes/no trial | P(1) = p, P(0) = 1 − p | p | p(1 − p) | 1 − p + pet |
| Binomial(n, p) | successes in n independent trials | (nk)pk(1 − p)n−k, k = 0..n | np | np(1 − p) | (1 − p + pet)n |
| Poisson(λ) | rare events; Binomial with λ = np; events in a window of a rate-λ process | e−λλk/k!, k = 0, 1, … | λ | λ | eλ(et − 1) |
| Geometric(p) | trial number of the first success | (1 − p)k−1p, k = 1, 2, …; P(X > k) = (1 − p)k | 1/p | (1 − p)/p2 | pet/(1 − (1 − p)et) |
| Uniform(a, b) | random point in (a, b) | 1/(b − a) on (a, b); F(x) = (x − a)/(b − a) | (a + b)/2 | (b − a)2/12 | (etb − eta)/(t(b − a)) |
| Exponential(λ) | waiting time at rate λ; memoryless | λe−λx, x > 0; P(X > x) = e−λx | 1/λ | 1/λ2 | λ/(λ − t), t < λ |
| Normal(μ, σ2) | sums of many small effects; CLT limit | e−(x−μ)2/2σ2/(σ√(2π)) | μ | σ2 | eμt + σ2t2/2 |
| Multinomial(n; p1..r) | n trials, r categories | n!/(n1!···nr!) Π pini | E(Xi) = npi | npi(1 − pi); Cov(Xi, Xj) = −npipj | — |
Sums of independent variables: Bin(n, p) + Bin(m, p) = Bin(n + m, p); Pois(λ) + Pois(μ) = Pois(λ + μ); N(μ1, σ12) + N(μ2, σ22) = N(μ1 + μ2, σ12 + σ22). Minimum of Exp(λ1) and Exp(λ2) is Exp(λ1 + λ2). Poisson process: N(t) ~ Pois(λt); time to the first event ~ Exp(λ).