Weeks
Statistics 2Week 3 · Expectation, Variance, Correlation and Inequalities
Week 3 Notes

Statistics for
Data Science 2

Expectation and casino math, the rules of expectation, scatter plots and spread, variance and standard deviation, covariance and correlation, and the inequalities of Markov, Chebyshev, Jensen and Cauchy-Schwarz, with every worked example and graded-style question solved.

8 chapters56 worked examples~49 min read
ExpectationVarianceCorrelationMarkovChebyshevJensen

Chapters

  1. 01Expected Value and Casino MathExpectation
  2. 02Expected Value of a Random VariableExpectation
  3. 03Scatter Plots and SpreadSpread
  4. 04Variance and Standard DeviationSpread
  5. 05Covariance and CorrelationRelationships
  6. 06Markov and ChebyshevInequalities
  7. 07Jensen and Cauchy-SchwarzInequalities
  8. 08Week 3 Summary SheetSummary
01
Expectation

Expected Value and Casino Math

Long-run average, and why the house wins.

A random variable can give a different value every time. Expected value is one single number that tells you where those values settle on average, if you could repeat the experiment again and again. This chapter builds the idea, tests it on dice, and then shows why every casino game is designed to lose you money slowly.

1.1What is expected value?

Expected value (the mean)

The expected value E[X]E[X] (also called the mean) is the long-run average of XX. Think of it as the balance point of the distribution, like the spot where a see-saw stays level. How to use it: multiply every value by its chance, then add everything up.

E[X]=∑xx⋅P(X=x)E[X] = \sum_x x \cdot P(X = x)
Analogy. Look at a cricketer's batting average. One innings can be 0, another 100, another 45, so a single innings tells you nothing. After many innings the average settles on one number. Expected value is exactly this: not one result, but the average over a long time. And on the see-saw: wherever the children sit, there is one spot where it balances. That spot is the mean.

1.2A fair die

For a fair die E[X]=1⋅16+2⋅16+⋯+6⋅16=216=3.5E[X] = 1 \cdot \tfrac16 + 2 \cdot \tfrac16 + \cdots + 6 \cdot \tfrac16 = \tfrac{21}{6} = 3.5. You can never roll a 3.5, and that is fine: the expected value need not be a possible outcome. It is only the average. If you roll 6000 times, the total will be close to 6000×3.5=21,0006000 \times 3.5 = 21{,}000.

A fair die: six equal bars of height 1/6 balance at 3.511/621/631/641/651/661/6E[X] = 3.5the bars balance here
Figure 1. A fair die: the six equal bars balance exactly at 3.5
One simulated run of 200 die rolls: the running average steadies near 3.5123456E[X] = 3.5050100150200number of rollswobbles a lot at first, then settles near 3.5
Figure 2. One simulated run of 200 die rolls: the running average steadies near 3.5
About this figure. It is one random simulation, so every run looks a little different. What does not change is the pattern: a big wobble at the start, then a steady settling near 3.5. This settling is the "law of large numbers".

1.3A loaded die

Example 1Mean of a loaded die

A loaded die shows 1, 2, 3, 4, 5 with probability 0.1 each, and 6 with probability 0.5. Find E[X].

Solution
Value xP(X = x)x · P(X = x)
1, 2, 3, 4, 5 (each)0.10.1, 0.2, 0.3, 0.4, 0.5
60.53.0
  1. The first five rows add to 0.1 + 0.2 + 0.3 + 0.4 + 0.5 = 1.5.
  2. Add the 6: 1.5 + 3.0 = 4.5. E[X] = 4.5.
  3. This is higher than the fair die's 3.5 because 6 is much more likely.

1.4The indicator variable

Special case: an indicatorIf XX is 1 when something happens and 0 otherwise, then E[X]=0⋅(1−p)+1⋅p=pE[X] = 0 \cdot (1 - p) + 1 \cdot p = p. The expected value is just the probability. Example: if 10% of people are left-handed and X=1X = 1 for a left-hander, then E[X]=0.1E[X] = 0.1.

1.5Casino math: why the house always wins

Casinos use expected value to make sure that, in the long run, they never lose. Every game is designed so that the player's expected gain is slightly negative. A few players win big, but over thousands of bets the average takes over.

Analogy. Remember the stall at a fair where you throw rings to win a prize? Now and then someone wins big and everybody cheers. But the stall owner earns every day, because the cost of each ring is more than the average prize. A casino is the same stall, only bigger.
Roulette: a ₹1 bet on a single numberBet ₹1 on one number37 slots: 0 to 36WIN +35 chance 1/3735 × 1/37 ≈ +0.946LOSE −1 chance 36/37−1 × 36/37 ≈ −0.973add: −1/37 ≈ −₹0.027
Figure 3. Roulette: a ₹1 bet on a single number loses about 2.7 paise on average

The expected gain is 35⋅137−1⋅3637=−137≈−0.02735 \cdot \tfrac1{37} - 1 \cdot \tfrac{36}{37} = -\tfrac1{37} \approx -0.027. The casino keeps about 2.7 paise out of every rupee bet.

Expected total gain keeps sliding down the more you bet (₹100 on red each time)0−1,000−2,000−3,00002505007501000100 bets: about −₹2701000 bets: about −₹2,703number of ₹100 bets on redslope: about −₹2.70 per bet
Figure 4. Expected total gain keeps sliding down the more you bet: about −₹2.70 per ₹100 bet

1.6Judging a game

Expected net gainVerdictMeaning
>0> 0good for youplay it
=0= 0a fair gameno one wins on average
<0< 0bad for youthis is how casinos earn
Net gain

Net gain = what you win on average minus what you pay. Always subtract the price before judging the game.

Fair priceA lottery pays ₹1,00,000 with probability 1/10,000 and ₹0 otherwise. E[prize] = 100000 × 1/10000 = 10, so the fair price of a ticket is ₹10. Real tickets cost more than that, which is how lotteries make money.

1.7Going deeper

  • Mean is not "most likely" (extra). In the loaded die the most likely face is 6, but the mean is 4.5. The mean is the balance point, which can differ from the highest bar.
  • Why it works (extra). In n repeated trials a value x appears about n·P(X = x) times, so the total is about Σ x · n · P(X = x), and the average is about Σ x · P(X = x) = E[X].
  • Few games, big swings (extra). Expected value tells you the average over many plays. In a single roulette spin you either win ₹35 or lose ₹1; the −₹0.027 only appears as a long-run average.

1.8Exam tips and common mistakes

Exam tips
  • Write the table first: value, probability, value × probability. Add the last column.
  • For games, state the net gain (winnings minus price) before deciding.
Common mistakes
  • Judging a game by the winnings alone and forgetting to subtract the price.
  • Expecting E[X] to be a possible value (3.5 on a die).
  • Confusing the most likely value with the mean.

Practice questions (graded-assignment style)

Q1Loaded die

Numerical Answer Type (NAT).

A die shows 1 to 5 with probability 0.1 each and 6 with probability 0.5. Find E[X].

Solution
Idea

Add value × probability.

  • 0.1 + 0.2 + 0.3 + 0.4 + 0.5 + 6 × 0.5 = 1.5 + 3.0 = 4.5.
  • Answer: 4.5
Q2Indicator

Numerical Answer Type (NAT).

10% of people are left-handed. X = 1 for a left-hander and 0 otherwise. Find E[X].

Solution
Idea

An indicator's mean is its probability.

  • E[X] = p = 0.1.
  • Answer: 0.1
Q3Fair price

Numerical Answer Type (NAT).

A lottery pays ₹1,00,000 with probability 1/10,000 and ₹0 otherwise. What is the fair price of a ticket in rupees?

Solution
Idea

Fair price = expected prize.

  • 100000 × 1/10000 = 10.
  • Answer: 10
Q4Roulette over 37 bets

Numerical Answer Type (NAT).

You bet ₹100 on red (18 red, 18 black, 1 green) on 37 separate spins. What is the expected total gain in rupees?

Solution
Idea

Per bet −100/37.

  • Per bet: 100·18/37 − 100·19/37 = −100/37. Over 37 bets: 37 × (−100/37) = −100.
  • Answer: -100
Q5Which game?

Multiple Choice Question (MCQ): choose the one correct option.

You pay ₹10 to play. You win ₹30 with probability 1/3 and ₹0 otherwise. This game is:

1
good for you
2
a fair game
3
bad for you
4
cannot be decided
Solution
Idea

Expected winnings against the price.

  • Expected winnings = 30 × 1/3 = 10, which equals the price, so the net gain is 0: a fair game.
  • Answer: option 2.
Q6Expected value facts

Multiple Select Question (MSQ): select all that apply.

Choose the correct statements.

1
E[X] need not be a possible value of X
2
For an indicator variable E[X] = P(X = 1)
3
The expected net gain of a casino game is positive for the player
4
E[X] is the balance point of the distribution
Solution
Idea

Casinos are designed to win on average.

  • Statement 3 is false: the casino game has a slightly negative expected gain for the player.
  • Answer: options 1, 2 and 4.
Revision overview
MeaningLong-run average of X
Balance point
FormulaE[X] = Σ x · P(X = x)
Value × chance, then add
Good to knowNeed not be a possible value
Indicator: E[X] = p
Expected valueChapter 1
Casino mathPlayer's expected gain is slightly negative
Roulette: −1/37 per ₹1
Judging a game> 0 good, = 0 fair, < 0 bad
Net = winnings − price
Fair priceFair price = expected prize
Lottery: ₹10 for ₹1,00,000 at 1/10,000
Revision: expected value and casino math on one page
Next · ExpectationExpected Value of a Random Variable
02
Expectation

Expected Value of a Random Variable

Linearity, functions (LOTUS) and the continuous case.

Now that you know what expected value means, here are the rules that let you calculate with it quickly, and how it works for continuous random variables.

2.1Four rules you will use all the time

RuleFormulaIn simple words
LinearityE[aX+bY+c]=aE[X]+bE[Y]+cE[aX + bY + c] = aE[X] + bE[Y] + cSplit the sum, pull out multipliers. Always true, no independence needed.
ConstantE[c]=cE[c] = cA number that never changes has that number as its average.
ProductE[XY]=E[X]E[Y]E[XY] = E[X]E[Y]Only if X and Y are independent.
LOTUSE[g(X)]=∑xg(x) P(X=x)E[g(X)] = \sum_x g(x)\,P(X = x)To average a function of X, change the values first, keep the same probabilities.
Correction (extra). The PDF says the product rule holds "only if X and Y are independent". More precisely, independence is sufficient but not necessary: the rule can also hold for dependent variables. In Chapter 5 you will meet X ~ N(0, 1) and Y = X², which are dependent yet have E[XY] = E[X]E[Y] = 0. Safe exam reading: independent ⟹ the product rule holds; the reverse is not guaranteed.
Analogy. You and your friend shop separately. The average of the total spending is your average plus your friend's average. This sum is always right, whether you went to the mall together (influencing each other) or separately. That is linearity.
Linearity: compute each piece separately and addKnow only the two means: E[X] = 5 and E[Y] = 34 · E[X]4 · 5 = 20−2 · E[Y]−2 · 3 = −6+ 7constant: 7E[4X − 2Y + 7]20 − 6 + 7 = 21No joint distribution needed. No independence needed.
Figure 5. Linearity: compute each piece separately and add
Example 5Linearity with two means

E[X] = 5 and E[Y] = 3. Find E[4X − 2Y + 7].

Solution
  1. E[4X−2Y+7]=4E[X]−2E[Y]+7E[4X - 2Y + 7] = 4E[X] - 2E[Y] + 7.
  2. =4⋅5−2⋅3+7=20−6+7=21= 4 \cdot 5 - 2 \cdot 3 + 7 = 20 - 6 + 7 = 21.
  3. No joint distribution and no independence were needed, only the two means.
Example 6Sum of two dice by linearity (extra)

Find the expected sum of two fair dice without listing the 36 outcomes.

Solution
  1. Each die has mean 3.53.5.
  2. By linearity E[X1+X2]=3.5+3.5=7E[X_1 + X_2] = 3.5 + 3.5 = 7, and the two dice need not even be independent.
  3. Check by the definition: the sum has PMF (6 − |s − 7|)/36 from Week 2, and Σ s · (6 − |s − 7|)/36 = 7. ✓

2.2Counting heads with linearity

Example 7Total heads without the binomial formula

100 people each flip a fair coin and X is the total number of heads. Find E[X] using linearity.

Solution
  1. Let Xi=1X_i = 1 if person ii gets heads, else 0. Then X=X1+X2+⋯+X100X = X_1 + X_2 + \cdots + X_{100}.
  2. Each XiX_i is an indicator, so E[Xi]=P(heads)=12E[X_i] = P(\text{heads}) = \tfrac12.
  3. By linearity E[X]=100×12=50E[X] = 100 \times \tfrac12 = 50. This still holds if the coins are not independent.

2.3LOTUS: the expected value of a function

To find E[g(X)]E[g(X)] you do not need the distribution of g(X)g(X). Take each value xx, apply gg, multiply by P(X=x)P(X = x), and add. The most common choice is g(x)=x2g(x) = x^2, which we need for variance in Chapter 4.

LOTUS: change the values, keep the probabilitiesxP(X = x)x²x² · P-10.310.300.20020.542E[X²] = 0.3 + 0 + 2.0 = 2.3E[X] = 0.7, so (E[X])² = 0.492.3E[X²]0.49(E[X])²E[X²] ≠ (E[X])²
Figure 6. LOTUS: change the values, keep the probabilities; and E[X²] ≠ (E[X])²
Example 8Expected value of a function

X takes the values −1, 0, 2 with probabilities 0.3, 0.2, 0.5. Find E[X²] and compare it with (E[X])².

Solution
  1. Using LOTUS: E[X2]=(−1)2(0.3)+02(0.2)+22(0.5)=0.3+0+2.0=2.3E[X^2] = (-1)^2(0.3) + 0^2(0.2) + 2^2(0.5) = 0.3 + 0 + 2.0 = 2.3.
  2. The mean is E[X]=−1(0.3)+0(0.2)+2(0.5)=0.7E[X] = -1(0.3) + 0(0.2) + 2(0.5) = 0.7, so (E[X])2=0.49(E[X])^2 = 0.49.
  3. 2.3≠0.492.3 \ne 0.49: squaring the average is not the same as averaging the squares. The gap 2.3−0.49=1.812.3 - 0.49 = 1.81 is the variance (Chapter 4).

2.4Continuous random variables

For a continuous random variable the "sum" turns into an integral (a smooth sum), and probabilities come from the density function f(x)f(x):

E[X]=∫−∞∞x f(x) dxE[X] = \int_{-\infty}^{\infty} x\, f(x)\, dx
DistributionMean E[X]
Uniform (a,b)(a, b)a+b2\dfrac{a+b}{2} (the middle of the interval)
Exponential (λ)(\lambda)1λ\dfrac1\lambda
Normal N(μ,σ2)N(\mu, \sigma^2)μ\mu (the centre of symmetry)
Bernoulli (p)(p), Binomial (n,p)(n, p), Poisson (λ)(\lambda)pp, npnp, λ\lambda
Analogy. Imagine a long ruler with rice grains stuck on it. The spot where you balance the ruler on your finger is the mean. If more grains lie on one side (a skewed curve), the balance point shifts toward that side and does not stay at the peak.
The mean is the balance pointUniform(2, 8): flat, mean 5Exp(1/5): skewed right, mean 51/6mean 5025810mean 50510152025in the skewed curve the mean sits to the right of the peak
Figure 7. Uniform: mean in the middle. Exponential: mean pulled right by the long tail
Example 9Uniform and exponential: E[X] and E[X²]

For X ~ Uniform(2, 8) find E[X] and E[X²]. For X ~ Exp(1/5) find E[X] and E[X²].

Solution
  1. Uniform(2, 8). E[X]=(2+8)/2=5E[X] = (2 + 8)/2 = 5. By LOTUS with density 16\tfrac16: E[X2]=∫28x2⋅16 dx=118(512−8)=28E[X^2] = \int_2^8 x^2 \cdot \tfrac16\, dx = \tfrac1{18}(512 - 8) = 28.
  2. Exp(1/5). λ=15\lambda = \tfrac15, so E[X]=1/λ=5E[X] = 1/\lambda = 5 and E[X2]=2/λ2=50E[X^2] = 2/\lambda^2 = 50. If customers arrive every 5 minutes on average, the waiting time has mean 5 minutes.
  3. Note 28≠52=2528 \ne 5^2 = 25 and 50≠2550 \ne 25: again E[X2]≠(E[X])2E[X^2] \ne (E[X])^2.

2.5Going deeper

  • LOTUS for a continuous variable (extra). The same idea works with an integral: E[g(X)]=∫g(x)f(x) dxE[g(X)] = \int g(x) f(x)\,dx. That is how E[X²] = 28 was computed above.
  • Why linearity is so powerful (extra). It works even for strongly dependent variables, so you can find the mean of a complicated sum by finding the mean of each simple piece, as in "100 coins = 100 indicators".
  • E[g(X)] is not g(E[X]) (extra). For linear g(x)=ax+bg(x) = ax + b they agree, but for curved gg they differ. Chapter 7 (Jensen) says which side is bigger.

2.6Means and variances of the named distributions, and conditional expectation

The summary table at the end of the week lists the mean and variance of the uniform, exponential and normal distributions. The discrete distributions of Week 0 (Bernoulli, binomial, geometric, Poisson, hypergeometric) are used just as often. Here is each result, with the reason.

A. The five discrete distributions

DistributionMeanVarianceWhere it comes from
Bernoulli(p)(p)ppp(1−p)p(1-p)E[X]=1⋅pE[X] = 1\cdot p; since X2=XX^2 = X, E[X2]=pE[X^2] = p, so Var⁡=p−p2\operatorname{Var} = p - p^2
Binomial(n,p)(n, p)npnpnp(1−p)np(1-p)a sum of nn independent Bernoulli(p)(p); means add, and (by independence) variances add
Geometric(p)(p) (trials until the first success, 1,2,…1, 2, \dots)1p\dfrac1p1−pp2\dfrac{1-p}{p^2}first-step argument below
Poisson(λ)(\lambda)λ\lambdaλ\lambdaE[X(X−1)]=λ2E[X(X-1)] = \lambda^2, so E[X2]=λ2+λE[X^2] = \lambda^2 + \lambda
Hypergeometric(N,r,m)(N, r, m)mrNm\dfrac{r}{N}mrN(1−rN)N−mN−1m\dfrac{r}{N}\left(1 - \dfrac{r}{N}\right)\dfrac{N - m}{N - 1}each draw is Type 1 with probability r/Nr/N (linearity); draws are dependent, so the variance is the binomial one times N−mN−1\tfrac{N-m}{N-1}

Why E[G]=1/pE[G] = 1/p for the geometric. Look at the first trial. With probability pp it succeeds and G=1G = 1. With probability 1−p1 - p it fails, you have used one trial, and you are back at the start, so the expected total is 1+E[G]1 + E[G]. Hence

E[G]=p⋅1+(1−p) (1+E[G])  ⟹  pE[G]=1  ⟹  E[G]=1pE[G] = p \cdot 1 + (1 - p)\,(1 + E[G]) \;\Longrightarrow\; pE[G] = 1 \;\Longrightarrow\; E[G] = \frac1p

Worked values.

  • Binomial(10,0.3)(10, 0.3): mean 33, variance 10(0.3)(0.7)=2.110(0.3)(0.7) = 2.1, standard deviation 2.1≈1.449\sqrt{2.1} \approx 1.449. (Computing ∑k P(X=k)\sum k\,P(X = k) from the full PMF gives exactly 33 and 2.12.1.)
  • Geometric(1/6)(1/6) (throw a die until the first 1): E[G]=6E[G] = 6 throws, Var⁡(G)=5/61/36=30\operatorname{Var}(G) = \dfrac{5/6}{1/36} = 30, standard deviation ≈5.48\approx 5.48. The spread is as big as the mean: waiting times are very variable.
  • Poisson(4)(4): mean 44, variance 44, and E[X2]=4+16=20E[X^2] = 4 + 16 = 20.
  • Hypergeometric(N=10,r=4,m=3)(N = 10, r = 4, m = 3): mean 3⋅0.4=1.23 \cdot 0.4 = 1.2, variance 3(0.4)(0.6)79=0.563(0.4)(0.6)\dfrac{7}{9} = 0.56. (Binomial(3,0.4)(3, 0.4) would have variance 0.720.72; sampling without replacement lowers it.)

B. Sums and products of two variables

  • Always: E[X+Y]=E[X]+E[Y]E[X + Y] = E[X] + E[Y], independent or not.
  • If XX and YY are independent: E[XY]=E[X] E[Y]E[XY] = E[X]\,E[Y] and Var⁡(X+Y)=Var⁡(X)+Var⁡(Y)\operatorname{Var}(X + Y) = \operatorname{Var}(X) + \operatorname{Var}(Y).
  • In general: E[XY]=E[X]E[Y]+Cov⁡(X,Y)E[XY] = E[X]E[Y] + \operatorname{Cov}(X, Y) and Var⁡(X+Y)=Var⁡(X)+Var⁡(Y)+2Cov⁡(X,Y)\operatorname{Var}(X + Y) = \operatorname{Var}(X) + \operatorname{Var}(Y) + 2\operatorname{Cov}(X, Y).
  • Two independent fair dice: sum has mean 3.5+3.5=73.5 + 3.5 = 7 and variance 3512+3512=356≈5.83\tfrac{35}{12} + \tfrac{35}{12} = \tfrac{35}{6} \approx 5.83; the product has E[XY]=3.5×3.5=12.25E[XY] = 3.5 \times 3.5 = 12.25.

C. Conditional expectation and the law of total expectation

The conditional expectation of XX given an event AA (with P(A)>0P(A) > 0) is the average of XX over the conditional PMF:

E[X∣A]=∑xx P(X=x∣A)E[X \mid A] = \sum_x x\,P(X = x \mid A)

If B1,…,BnB_1, \dots, B_n partition the sample space, then

E[X]=∑iE[X∣Bi] P(Bi)E[X] = \sum_i E[X \mid B_i]\,P(B_i)

This is the law of total probability carried over to averages: the overall average is the weighted average of the group averages.

  • A die. E[X∣even]=2+4+63=4E[X \mid \text{even}] = \dfrac{2 + 4 + 6}{3} = 4, E[X∣odd]=1+3+53=3E[X \mid \text{odd}] = \dfrac{1 + 3 + 5}{3} = 3, so E[X]=4⋅12+3⋅12=3.5E[X] = 4 \cdot \tfrac12 + 3 \cdot \tfrac12 = 3.5 ✓.
  • From a joint PMF. Let P(X=0,Y=0)=0.2P(X = 0, Y = 0) = 0.2, P(0,1)=0.3P(0, 1) = 0.3, P(1,0)=0.1P(1, 0) = 0.1, P(1,1)=0.4P(1, 1) = 0.4. Then P(Y=0)=0.3P(Y = 0) = 0.3, P(Y=1)=0.7P(Y = 1) = 0.7, E[X∣Y=0]=0.10.3=13E[X \mid Y = 0] = \tfrac{0.1}{0.3} = \tfrac13, E[X∣Y=1]=0.40.7=47E[X \mid Y = 1] = \tfrac{0.4}{0.7} = \tfrac47, and E[X]=13(0.3)+47(0.7)=0.1+0.4=0.5E[X] = \tfrac13(0.3) + \tfrac47(0.7) = 0.1 + 0.4 = 0.5, which matches E[X]=P(X=1)=0.5E[X] = P(X = 1) = 0.5 computed directly ✓.

D. Standardising

For XX with mean μ\mu and standard deviation σ>0\sigma > 0, the standardised variable Z=X−μσZ = \dfrac{X - \mu}{\sigma} has E[Z]=0E[Z] = 0 and Var⁡(Z)=1\operatorname{Var}(Z) = 1 (by the rules for aX+baX + b). The value z=x−μσz = \dfrac{x - \mu}{\sigma} says "how many standard deviations xx is from the mean". Example: marks with mean 60 and standard deviation 8: a score of 76 has z=(76−60)/8=2z = (76 - 60)/8 = 2.

2.7Exam tips and common mistakes

Exam tips
  • Sum of counts: break it into indicators and use E[indicator] = probability.
  • For E[X²] use LOTUS directly from the PMF; do not square the mean.
Common mistakes
  • Using E[XY] = E[X]E[Y] without independence.
  • Writing E[X²] = (E[X])².
  • Thinking linearity needs independence. It does not.

Practice questions (graded-assignment style)

Q1Linearity

Numerical Answer Type (NAT).

E[X] = 5 and E[Y] = 3. Find E[4X − 2Y + 7].

Solution
Idea

4·5 − 2·3 + 7.

  • 20 − 6 + 7 = 21.
  • Answer: 21
Q2E[X²] by LOTUS

Numerical Answer Type (NAT).

X takes −1, 0, 2 with probabilities 0.3, 0.2, 0.5. Find E[X²].

Solution
Idea

Square the values, keep the probabilities.

  • 1(0.3) + 0(0.2) + 4(0.5) = 2.3.
  • Answer: 2.3
Q3Counting heads

Numerical Answer Type (NAT).

100 fair coins are flipped (not necessarily independently). Find the expected number of heads.

Solution
Idea

100 indicators with mean 1/2.

  • By linearity: 100 × 1/2 = 50.
  • Answer: 50
Q4Exponential second moment

Numerical Answer Type (NAT).

X ~ Exp(1/5) (mean 5). Using E[X²] = 2/λ², find E[X²].

Solution
Idea

λ = 1/5.

  • 2/λ² = 2 × 25 = 50.
  • Answer: 50
Q5Which rule needs independence?

Multiple Choice Question (MCQ): choose the one correct option.

Which of these is guaranteed only when X and Y are independent?

1
E[X + Y] = E[X] + E[Y]
2
E[3X] = 3E[X]
3
E[XY] = E[X]E[Y]
4
E[X + 5] = E[X] + 5
Solution
Idea

Linearity needs nothing.

  • Linearity (sums, multipliers, constants) is always true; the product rule is the one that needs independence.
  • Answer: option 3.
Q6Means of known distributions

Multiple Select Question (MSQ): select all that apply.

Choose the correct means.

1
Uniform(2, 8): 5
2
Exp(1/5): 5
3
Binomial(10, 0.5): 5
4
Poisson(3): 9
Solution
Idea

Uniform (a+b)/2, Exp 1/λ, Binomial np, Poisson λ.

  • Poisson(3) has mean 3, so statement 4 is false.
  • Answer: options 1, 2 and 3.
Q1Mean and variance of a binomial

Numerical Answer Type (NAT).

XX is Binomial(n=10, p=0.3)(n = 10,\ p = 0.3). Find Var⁡(X)\operatorname{Var}(X).

Solution
Idea

XX is a sum of 10 independent Bernoulli(0.3), each with variance p(1−p)p(1 - p).

  • Var⁡(X)=np(1−p)=10×0.3×0.7=2.1\operatorname{Var}(X) = np(1 - p) = 10 \times 0.3 \times 0.7 = 2.1.
  • Answer: 2.1
Q2The mean waiting time

Numerical Answer Type (NAT).

A fair die is thrown repeatedly until the first 6 appears. What is the expected number of throws?

Solution
Idea

The number of trials to the first success is Geometric(p)(p) with E=1/pE = 1/p.

  • p=1/6p = 1/6, so E[G]=6E[G] = 6. The variance is (1−p)/p2=(5/6)⋅36=30(1 - p)/p^2 = (5/6)\cdot 36 = 30.
  • Answer: 6
Q3Which means and variances are right?

Multiple Select Question (MSQ): select all that apply.

Choose the correct statements.

1
If X∼Poisson(4)X \sim \text{Poisson}(4), then E[X]=Var⁡(X)=4E[X] = \operatorname{Var}(X) = 4.
2
If X∼Binomial(20,0.5)X \sim \text{Binomial}(20, 0.5), then E[X]=10E[X] = 10 and Var⁡(X)=5\operatorname{Var}(X) = 5.
3
If GG is Geometric(0.25)(0.25), then E[G]=0.25E[G] = 0.25.
4
If X∼Bernoulli(0.2)X \sim \text{Bernoulli}(0.2), then Var⁡(X)=0.16\operatorname{Var}(X) = 0.16.
Solution
Idea

Plug into the table.

  • 1 ✓ for the Poisson the mean and variance are both λ\lambda.
  • 2 ✓ np=10np = 10 and np(1−p)=20⋅0.5⋅0.5=5np(1 - p) = 20 \cdot 0.5 \cdot 0.5 = 5.
  • 3 ✗ E[G]=1/p=4E[G] = 1/p = 4, not 0.250.25.
  • 4 ✓ p(1−p)=0.2⋅0.8=0.16p(1 - p) = 0.2 \cdot 0.8 = 0.16.
  • Answer: options 1, 2 and 4.
Q4Conditional expectation of a die

Numerical Answer Type (NAT).

A fair die is thrown. What is E[X∣X is even]E[X \mid X \text{ is even}]?

Solution
Idea

Given "even", the outcomes 2,4,62, 4, 6 are equally likely, each with conditional probability 13\tfrac13.

  • E[X∣even]=2⋅13+4⋅13+6⋅13=4E[X \mid \text{even}] = 2 \cdot \tfrac13 + 4 \cdot \tfrac13 + 6 \cdot \tfrac13 = 4.
  • Answer: 4
Q5Law of total expectation

Numerical Answer Type (NAT).

A shop's customers are 60% members and 40% non-members. A member spends on average ₹500 and a non-member ₹200. What is the expected spend of a randomly chosen customer?

Solution
Idea

Weighted average of the group means: E[X]=∑E[X∣Bi]P(Bi)E[X] = \sum E[X \mid B_i]P(B_i).

  • E[X]=500(0.6)+200(0.4)=300+80=380E[X] = 500(0.6) + 200(0.4) = 300 + 80 = 380.
  • Answer: 380
Q6Sum of two independent dice

Numerical Answer Type (NAT).

Two independent fair dice are thrown. What is the variance of the sum? (Give a decimal rounded to 2 places.)

Solution
Idea

For independent variables, the variances add.

  • One die has variance 35/1235/12. The sum has 35/12+35/12=35/6≈5.8335/12 + 35/12 = 35/6 \approx 5.83.
  • Answer: 5.83
Q7A z-score

Numerical Answer Type (NAT).

Marks have mean 60 and standard deviation 8. What is the standardised value zz of a score of 76?

Solution
Idea

z=(x−μ)/σz = (x - \mu)/\sigma.

  • z=(76−60)/8=2z = (76 - 60)/8 = 2: the score is two standard deviations above the mean.
  • Answer: 2
Revision overview
LinearityE[aX + bY + c] = aE[X] + bE[Y] + c
Always true, no independence
Other rulesE[c] = c
E[XY] = E[X]E[Y] if independent
LOTUSE[g(X)] = Σ g(x)P(X = x)
E[X²] ≠ (E[X])²
Expectation rulesChapter 2
ContinuousE[X] = ∫ x f(x) dx
Sum becomes integral
Known meansUniform (a+b)/2, Exp 1/λ
Normal μ, Binomial np
Counting trickCount = sum of indicators
E = sum of probabilities
Revision: the rules of expectation on one page
Next · SpreadScatter Plots and Spread
03
Spread

Scatter Plots and Spread

Reading patterns, range and IQR.

Before using formulas, it helps to look at data. A scatter plot shows how two variables are related, and measures of spread tell us how scattered the values are.

3.1Scatter plots

A scatter plot draws every observation as one dot at position (x, y). Look at the cloud of dots and ask three questions: Which direction? (up or down) How strong? (tight or loose) What shape? (straight or curved)

Analogy. Think of each student in a class as one dot: hours studied (x) and marks obtained (y). If students who study more also score more, the dots climb upward. If the dots are scattered everywhere, there is no direct link between study time and marks.
Scatter plots: direction and strength (r is the correlation of Section 5)strong positiver ≈ +0.9weak positiver ≈ +0.4no patternr ≈ +0.0strong negativer ≈ -0.9
Figure 8. Direction and strength: the number r (the correlation of Chapter 5) puts a number on both

3.2Reading the shape

  • Linear: dots follow a straight line. A straight-line model works well.
  • Curved: dots follow a curve. The correlation can be close to 0 even though the link is strong, because correlation only sees straight-line patterns.
  • Fan shape: the spread grows as x grows. Straight-line modelling assumptions may fail.
  • Clusters: separate groups can behave differently from the combined data (this is called Simpson's paradox).
  • Outliers: one extreme dot can change the correlation a lot, especially with few points. Always look at the plot first.
Four shapes you should recognise at a glanceLinearuse a straight lineCurvedr can be near 0, link strongFan shapespread grows with xClustersgroups behave differently
Figure 9. Four shapes you should recognise at a glance

3.3Measuring spread

The mean says where the centre is, but not how scattered the values are. Three common measures of spread:

MeasureWhat it isGood / bad
Rangemax⁡−min⁡\max - \minVery simple, but one outlier changes it a lot.
IQRQ3−Q1Q_3 - Q_1 (the spread of the middle 50% of the data)Ignores extreme values, so it is robust.
Varianceaverage squared distance from the meanThe standard measure (next chapter).
Analogy. Two cricketers both average 40. The first scores 38, 40, 42, 39, 41: very consistent. The second scores 0, 80, 0, 80, 40: sometimes zero, sometimes 80. Whom would you trust? Spread tells you how far you can trust the average alone.
Same centre, different spreadmean 50σ = 5σ = 152040506080Arange = 4Brange = 16A and B both have mean 10, yet range 4 against 16
Figure 10. Both curves are centred at 50, one narrow and one wide; and two data sets with the same mean 10 but ranges 4 and 16
Remember

Never describe data by the mean alone. Always give the spread too.

3.4Going deeper

  • Simpson's paradox (extra). Two groups can each show a downward trend while the combined cloud shows an upward one (or the reverse). That is why clusters in a scatter plot are a warning: analyse the groups separately.
  • Which spread when (extra). Range is quick but fragile; IQR is robust to outliers; variance and standard deviation are the ones that fit the formulas of this week.
  • Plot before you compute (extra). A correlation number can hide a curve, a fan, clusters or an outlier. The plot takes five seconds and can save the whole analysis.

3.5Exam tips and common mistakes

Exam tips
  • Describe a scatter plot in three words: direction, strength, shape.
  • When asked to compare two data sets, give both the centre and the spread.
Common mistakes
  • Concluding cause from a scatter plot.
  • Trusting a correlation near 0 to mean "no link": a curve can hide behind it.
  • Reporting only the mean of a data set.

Practice questions (graded-assignment style)

Q1Range of B

Numerical Answer Type (NAT).

Find the range of the data set {2, 6, 10, 14, 18}.

Solution
Idea

max − min.

  • 18 − 2 = 16.
  • Answer: 16
Q2Variance of A

Numerical Answer Type (NAT).

Find the variance of {8, 9, 10, 11, 12} (mean 10), as the average of the squared distances from the mean.

Solution
Idea

(4 + 1 + 0 + 1 + 4)/5.

  • 10/5 = 2.
  • Answer: 2
Q3Variance of B

Numerical Answer Type (NAT).

Find the variance of {2, 6, 10, 14, 18} (mean 10).

Solution
Idea

(64 + 16 + 0 + 16 + 64)/5.

  • 160/5 = 32.
  • Answer: 32
Q4IQR after an outlier

Numerical Answer Type (NAT).

For {10, 11, 12, 13, 14, 50} take Q₁ as the median of 10, 11, 12 and Q₃ as the median of 13, 14, 50. Find the IQR.

Solution
Idea

Q₃ − Q₁ = 14 − 11.

  • 14 − 11 = 3, the same as without the outlier.
  • Answer: 3
Q5Which measure is robust?

Multiple Choice Question (MCQ): choose the one correct option.

Which measure of spread is least affected by one extreme outlier?

1
Range
2
IQR
3
The maximum
4
The sum of the data
Solution
Idea

Think of the middle 50%.

  • The IQR uses only the middle half of the data.
  • Answer: option 2.
Q6Scatter plot facts

Multiple Select Question (MSQ): select all that apply.

Choose the correct statements.

1
A tight upward band means a strong positive relationship
2
A curved pattern can have r near 0 even if the link is strong
3
A strong correlation proves that one variable causes the other
4
One outlier can change r a lot
Solution
Idea

Correlation is not causation.

  • Statement 3 is false: correlation does not prove cause.
  • Answer: options 1, 2 and 4.
Revision overview
Scatter plotOne dot per observation
Ask: direction, strength, shape
ShapesLinear, curved, fan, clusters
Curved: r may be near 0
OutliersOne dot can change r a lot
Always look at the plot
Looking at dataChapter 3
SpreadRange = max − min
IQR = Q3 − Q1 (robust)
Variance: next chapter
Key lessonSame mean can hide very different spread
CauseA plot never proves cause
Watch for a hidden factor
Revision: scatter plots and spread on one page
Next · SpreadVariance and Standard Deviation
04
Spread

Variance and Standard Deviation

How far values wander from the mean.

Variance and standard deviation are the standard way to measure how far values wander from their mean. They appear in almost every formula in statistics, so take the time to get a feel for them.

4.1Variance

In simple words: take every value, find how far it is from the mean, square that distance, then take the average. That average is the variance.

Analogy. You throw darts at a board. If all darts land near the bullseye, the variance is small. If they land all over the board, sometimes on the bullseye and sometimes on the wall, the variance is large. The mean tells you where the centre of the darts is; the variance tells you how scattered they are.
Variance

With μ=E[X]\mu = E[X]:

Var⁡(X)=E[(X−μ)2](definition)\operatorname{Var}(X) = E[(X - \mu)^2] \quad \text{(definition)}
Var⁡(X)=E[X2]−(E[X])2(shortcut)\operatorname{Var}(X) = E[X^2] - (E[X])^2 \quad \text{(shortcut)}
Variance by hand for the data 2, 6, 10, 14, 1805101520mean = 10−8−4+4+8distances cancel, so square each one first(-8)² = 64(-4)² = 16(0)² = 0(+4)² = 16(+8)² = 64average of the squares = variance: 160/5 = 32
Figure 11. Variance by hand: distances from the mean, squared, then averaged

Why square? Without squaring, distances above and below the mean cancel out. Squaring also makes big gaps count more. And Var(X) ≥ 0 always, with Var(X) = 0 only when X is a constant (no spread at all).

  • Fair die. E[X2]=916E[X^2] = \tfrac{91}{6}, E[X]=3.5E[X] = 3.5, so Var⁡(X)=916−494=3512≈2.917\operatorname{Var}(X) = \tfrac{91}{6} - \tfrac{49}{4} = \tfrac{35}{12} \approx 2.917.
  • Bernoulli variable. If XX is 1 with chance pp and 0 otherwise, then E[X2]=pE[X^2] = p (since X2=XX^2 = X), so Var⁡(X)=p−p2=p(1−p)\operatorname{Var}(X) = p - p^2 = p(1 - p).
Variance of a Bernoulli variable is p(1 − p)00.250.50.75100.10.20.25p = 0.5: 0.25p = 0.3: 0.21p, the chance of successa coin is most unpredictable at p = 0.5; at p = 0 or 1 the variance is 0
Figure 12. A coin is most unpredictable at p = 0.5, and not unpredictable at all when p is 0 or 1 (variance 0)

4.2Standard deviation

σ=Var⁡(X)\sigma = \sqrt{\operatorname{Var}(X)} is the standard deviation. Taking the square root brings us back to the original units (marks, cm, rupees), so it is easier to understand than the variance (marks², cm², ...). If exam scores have mean 70 and σ=10\sigma = 10, most students score within 70±1070 \pm 10, that is between 60 and 80. If σ=2\sigma = 2, scores are packed between 68 and 72.

4.3Rules for variance

RuleFormulaIn simple words
ConstantVar⁡(c)=0\operatorname{Var}(c) = 0A fixed number has no spread.
Shift and scaleVar⁡(aX+b)=a2Var⁡(X)\operatorname{Var}(aX + b) = a^2 \operatorname{Var}(X)Adding b only moves everything; it does not change spread. Multiplying by a multiplies the variance by a².
Sum (independent)Var⁡(X±Y)=Var⁡(X)+Var⁡(Y)\operatorname{Var}(X \pm Y) = \operatorname{Var}(X) + \operatorname{Var}(Y)Variances add, even for a difference.
Sum (general)Var⁡(X+Y)=Var⁡(X)+Var⁡(Y)+2Cov⁡(X,Y)\operatorname{Var}(X + Y) = \operatorname{Var}(X) + \operatorname{Var}(Y) + 2\operatorname{Cov}(X, Y)Needs the covariance term (Chapter 5).
SD of aX + bσaX+b=∣a∣ σX\sigma_{aX+b} = |a|\,\sigma_XThe standard deviation scales by |a| only.
Y = 2X + 5: shift by 5 and stretch by 22060100125150180Xmean 60, σ = 10, Var = 1002060100125150180Y = 2X + 5mean 125, σ = 20, Var = 400the mean moves to 125 and the variance becomes 4 times bigger
Figure 13. Y = 2X + 5: the mean moves to 125 and the variance becomes 4 times bigger
Independent X, Y: standard deviations combine like the sides of a right triangleσ_Y = 4σ_X = 3σ_(X±Y) = 5Independent X, Y with Var(X) = 9, Var(Y) = 16Var(X) = 9, Var(Y) = 16Var(X + Y) = 9 + 16 = 25Var(X − Y) = 9 + 16 = 25Both are 25, so the SD is 5.Subtracting does not reduce the spread.
Figure 14. For independent variables, standard deviations combine like the sides of a right triangle
Common mistake: Var(X − Y)
  • Many students write Var⁡(X−Y)=Var⁡(X)−Var⁡(Y)\operatorname{Var}(X - Y) = \operatorname{Var}(X) - \operatorname{Var}(Y). This is wrong. For independent variables it is Var⁡(X)+Var⁡(Y)\operatorname{Var}(X) + \operatorname{Var}(Y). Uncertainty from two independent sources piles up whether you add or subtract the quantities.

4.4The empirical rule (68-95-99.7)

For a roughly normal (bell-shaped) distribution: about 68% of the values lie within 1σ of the mean, about 95% within 2σ, and about 99.7% within 3σ.

Analogy. Look at the customers of a tea stall every day. Most people (68%) come very close to the daily average, a few come a little away, and very few (0.3%) arrive at a really strange time. That is what a bell curve means: a crowd in the middle, silence at the edges.
Empirical rule for a roughly normal distributionμ−3σμ−2σμ−σμμ+σμ+2σμ+3σ68% (1σ)95% (2σ)99.7% (3σ)
Figure 15. About 68%, 95% and 99.7% of the values lie within 1, 2 and 3 standard deviations of the mean

4.5Going deeper

  • Two ways to the same number (extra). The definition E[(X − μ)²] and the shortcut E[X²] − (E[X])² always agree. For X = 1, 3, 5 above the definition gives 0.2·(1 − 3.2)² + 0.5·(3 − 3.2)² + 0.3·(5 − 3.2)² = 0.968 + 0.02 + 0.972 = 1.96.
  • Why E[X²] ≥ (E[X])² (extra). Their gap is the variance, which is never negative. Chapter 7 shows the same fact as a case of Jensen's inequality.
  • Units (extra). If X is in cm, Var(X) is in cm² and σ is in cm. That is why we quote σ when talking to people and use Var in formulas.
  • Max variance (extra). Among Bernoulli variables the largest variance is 0.25, at p = 0.5, as the curve shows.

4.6Exam tips and common mistakes

Exam tips
  • Use the shortcut: find E[X] and E[X²] from the PMF, then subtract. Check that the answer is not negative.
  • For Var(aX + b) ignore b and square a. For independent sums add variances, never subtract them.
Common mistakes
  • Var(X − Y) = Var(X) − Var(Y).
  • Var(aX) = a Var(X): the multiplier is squared.
  • Reporting the variance when the question asks for the standard deviation (forgetting the square root).

Practice questions (graded-assignment style)

Q1Variance by shortcut

Numerical Answer Type (NAT).

X takes 1, 3, 5 with probabilities 0.2, 0.5, 0.3. Find Var(X).

Solution
Idea

E[X²] − (E[X])².

  • E[X] = 3.2, E[X²] = 12.2, so Var = 12.2 − 10.24 = 1.96.
  • Answer: 1.96
Q2Variance after Y = 2X + 5

Numerical Answer Type (NAT).

X has mean 60 and standard deviation 10. Find Var(2X + 5).

Solution
Idea

Ignore the +5, square the 2.

  • 2² × 100 = 400.
  • Answer: 400
Q3Sum of independent

Numerical Answer Type (NAT).

X, Y are independent with Var(X) = 9 and Var(Y) = 16. Find the standard deviation of X − Y.

Solution
Idea

Variances add, then take the root.

  • Var = 9 + 16 = 25, σ = 5.
  • Answer: 5
Q4Fair coin variance

Numerical Answer Type (NAT).

X is 1 with probability 0.5 and 0 otherwise. Find Var(X).

Solution
Idea

p(1 − p).

  • 0.5 × 0.5 = 0.25.
  • Answer: 0.25
Q5Empirical rule

Multiple Choice Question (MCQ): choose the one correct option.

Heights follow N(175, 49) cm. About what percentage lie between 161 and 189 cm?

1
68%
2
95%
3
99.7%
4
50%
Solution
Idea

σ = 7; 161 and 189 are μ ∓ 2σ.

  • Within 2σ of the mean: about 95%.
  • Answer: option 2.
Q6Variance facts

Multiple Select Question (MSQ): select all that apply.

Choose the correct statements.

1
Var(X) ≥ 0 always
2
Var(aX + b) = a² Var(X)
3
For independent X, Y: Var(X − Y) = Var(X) − Var(Y)
4
Var(X) = 0 only when X is a constant
Solution
Idea

For a difference of independent variables the variances still add.

  • Statement 3 is false: Var(X − Y) = Var(X) + Var(Y).
  • Answer: options 1, 2 and 4.
Revision overview
VarianceE[(X − μ)²]
Shortcut E[X²] − (E[X])²
Always ≥ 0
Standard deviationσ = √Var(X)
Same units as X
RulesVar(aX + b) = a² Var(X)
Independent: variances add
Variance and SDChapter 4
Special casesBernoulli: p(1 − p)
Fair die: 35/12
Empirical rule68% within 1σ
95% within 2σ, 99.7% within 3σ
Watch outVar(X − Y) adds, not subtracts
Var(aX) = a² Var(X)
Revision: variance and standard deviation on one page
Next · RelationshipsCovariance and Correlation
05
Relationships

Covariance and Correlation

Do two variables move together?

So far we looked at one variable at a time. Now we look at two variables together: do they rise and fall together, or do they pull in opposite directions?

5.1Covariance: the direction of a relationship

Covariance tells us whether X and Y tend to move in the same direction (positive), in opposite directions (negative), or show no tendency (zero). For each pair, multiply the two deviations from their means, then average.

Covariance
Cov⁡(X,Y)=E[(X−μX)(Y−μY)](definition)\operatorname{Cov}(X, Y) = E[(X - \mu_X)(Y - \mu_Y)] \quad \text{(definition)}
Cov⁡(X,Y)=E[XY]−E[X] E[Y](shortcut)\operatorname{Cov}(X, Y) = E[XY] - E[X]\,E[Y] \quad \text{(shortcut)}
Analogy. Two friends ride bicycles. If one speeds up and the other also speeds up, one slows and the other slows, their speeds change together: positive covariance. If one speeds up exactly as the other slows (like a see-saw), the covariance is negative. If each rides as they like, it is close to zero.
Dashed lines mark the two means; green dots add a positive product, red dots a negative one+−−+positive covariance: most dots in the + corners+−−+negative covariance: most dots in the − corners
Figure 16. Dashed lines mark the two means; a dot above-right or below-left adds a positive product (green), the other two corners add a negative one (red)

Examples: temperature and ice-cream sales are positively related (both are high in summer). Temperature and the heating bill are negatively related (hot days mean small bills).

5.2Rules for covariance

RuleFormulaIn simple words
ItselfCov⁡(X,X)=Var⁡(X)\operatorname{Cov}(X, X) = \operatorname{Var}(X)Variance is the covariance of a variable with itself.
OppositeCov⁡(X,−X)=−Var⁡(X)\operatorname{Cov}(X, -X) = -\operatorname{Var}(X)Perfectly opposite, so as negative as possible.
Shift and scaleCov⁡(aX+b,cY+d)=acCov⁡(X,Y)\operatorname{Cov}(aX + b, cY + d) = ac\operatorname{Cov}(X, Y)Constants b, d do nothing. Only the multipliers a, c matter.
IndependentCov⁡(X,Y)=0\operatorname{Cov}(X, Y) = 0Independent variables have zero covariance. The reverse is not true.
Variance of a sumVar⁡(X+Y)=Var⁡(X)+Var⁡(Y)+2Cov⁡(X,Y)\operatorname{Var}(X + Y) = \operatorname{Var}(X) + \operatorname{Var}(Y) + 2\operatorname{Cov}(X, Y)The extra term vanishes when X, Y are independent.
Problem with covariance. Its size depends on the units. A covariance of 150 might be strong or weak: you cannot tell. We fix this next.

5.3Correlation: covariance without units

Correlation
ρ(X,Y)=Cov⁡(X,Y)σX σY\rho(X, Y) = \frac{\operatorname{Cov}(X, Y)}{\sigma_X\,\sigma_Y}

Dividing by both standard deviations removes the units, so the answer always lies between −1-1 and +1+1.

Analogy. To compare the marks of two students, one out of 50 and the other out of 200, comparing the raw numbers is wrong, so we use percentages. Correlation is the percentage-like version of covariance: remove the scale, keep the relationship.
How to read a correlation value-1perfectstraight linedown-0.5moderatedownwardtrend0noneno straight-linelink+0.5moderateupwardtrend+1perfectstraight lineupCloser to ±1: stronger straight-line link. Closer to 0: weaker.The sign only tells direction. It does not tell how strong.
Figure 17. How to read a correlation value
Changing units changes the covariance but not the correlationHeight in cmCov = 150ρ = 0.8 (say)Height in metresCov = 1.5ρ = 0.8 (same)cm → m÷ 100Cov changes, ρ stays the sameρ divides Cov by σX · σY, so the units cancel out
Figure 18. Changing units changes the covariance but not the correlation

5.4Properties of correlation

  • −1≤ρ≤1-1 \le \rho \le 1 always (proved in Chapter 7).
  • ρ=±1\rho = \pm 1 exactly when Y=aX+bY = aX + b (a perfect straight line). The sign of ρ\rho is the sign of aa.
  • Symmetric: ρ(X,Y)=ρ(Y,X)\rho(X, Y) = \rho(Y, X).
  • Independent gives ρ=0\rho = 0, but ρ=0\rho = 0 does not give independent (except for the bivariate normal).
  • Under a change of scale: ρ(aX+b,cY+d)=sign⁡(ac)⋅ρ(X,Y)\rho(aX + b, cY + d) = \operatorname{sign}(ac)\cdot\rho(X, Y). Flipping one variable flips the sign.

5.5Zero correlation does not mean no relationship

ρ\rho only detects straight-line relationships. Take X∼N(0,1)X \sim N(0, 1) and Y=X2Y = X^2. Here E[X]=0E[X] = 0, E[Y]=1E[Y] = 1 and E[XY]=E[X3]=0E[XY] = E[X^3] = 0 (odd powers of a symmetric variable average to 0). So Cov⁡=0−0⋅1=0\operatorname{Cov} = 0 - 0\cdot 1 = 0, yet YY is completely decided by XX.

A perfect curve that a straight-line measure cannot see-3-2-10123Y = X²X ~ N(0, 1), Y = X²E[X] = 0, E[Y] = 1E[XY] = E[X³] = 0Cov = 0 − 0·1 = 0Y is exactly X², so knowing Xtells you Y completely.Cov = 0, ρ = 0, yet dependent
Figure 19. A perfect curve that a straight-line measure cannot see: Cov = 0, correlation 0, yet dependent
Link to Chapter 2. This same pair also shows that E[XY] = E[X]E[Y] can hold for dependent variables, which is why independence is sufficient but not necessary for the product rule.

5.6Correlation is not causation

If two things move together, one need not cause the other. A third hidden factor (a confounder) can drive both. Even pure coincidence can produce a high correlation: the PDF quotes a funny example, the number of films a famous actor appears in per year, once reported to correlate (about 0.66) with pool drownings, which is obviously a coincidence.

Ice-cream sales and drownings both rise in summerSummer heatthe hidden cause (confounder)Ice-cream salesgo up in summerDrowning casesgo up in summer (more swimming)?they move together, but there is NO cause between them
Figure 20. Ice-cream sales and drownings both rise in summer
Rule
  • Correlation suggests where to investigate. Proving cause needs a controlled experiment or careful causal methods.
  • Correlation batata hai ki kahan jaanch karni hai. Karan sabit karne ke liye controlled experiment ya sahi causal methods chahiye.

5.7Going deeper

  • Covariance as an average product (extra). Cov(X, Y) is the average of (X − μX)(Y − μY). Above-right and below-left dots give positive products, the other corners negative ones, which is exactly the picture of the quadrants.
  • Correlation is symmetric but not about causes (extra). ρ(X, Y) = ρ(Y, X), so it cannot say which variable drives which.
  • Special case (extra). For two jointly normal variables, ρ = 0 does give independence; that is the exception mentioned above.

5.8Exam tips and common mistakes

Exam tips
  • Cov = E[XY] − E[X]E[Y]: get the three expectations from the joint PMF. For ρ divide by both standard deviations.
  • For transformations, multiply the multipliers (and look at the sign of the product) and ignore the constants.
Common mistakes
  • Reading ρ = 0 as independent.
  • Reading a high ρ as cause.
  • Forgetting the covariance term in Var(X + Y) for dependent variables.
  • Believing the sign of ρ tells how strong the link is.

Practice questions (graded-assignment style)

Q1Cov from a table

Numerical Answer Type (NAT).

P(0,0) = 0.1, P(0,1) = 0.2, P(1,0) = 0.3, P(1,1) = 0.4. Find Cov(X, Y).

Solution
Idea

E[XY] − E[X]E[Y] = 0.4 − 0.7 × 0.6.

  • 0.4 − 0.42 = −0.02.
  • Answer: -0.02
Q2ρ with a negative sign

Numerical Answer Type (NAT).

ρ(A, B) = 0.8. Find ρ(2A + 1, −3B + 5).

Solution
Idea

The product of multipliers 2 × (−3) is negative.

  • The sign flips and the magnitude stays: −0.8.
  • Answer: -0.8
Q3Covariance after a change

Numerical Answer Type (NAT).

Cov(X, Y) = 5. Find Cov(2X + 3, 4Y − 1).

Solution
Idea

2 × 4 × 5.

  • Constants do nothing: 8 × 5 = 40.
  • Answer: 40
Q4Variance of a sum

Numerical Answer Type (NAT).

Var(X) = 4, Var(Y) = 9, Cov(X, Y) = −6. Find Var(X + Y).

Solution
Idea

Add 2Cov.

  • 4 + 9 + 2(−6) = 1.
  • Answer: 1
Q5ρ = 0

Multiple Choice Question (MCQ): choose the one correct option.

For X ~ N(0, 1) and Y = X², the correlation is 0. Therefore:

1
X and Y are independent
2
X and Y are dependent but have no straight-line relationship
3
Y causes X
4
There is a calculation error
Solution
Idea

Y is exactly X².

  • Y is decided by X, so they are dependent; ρ only measures straight-line relationships.
  • Answer: option 2.
Q6Correlation facts

Multiple Select Question (MSQ): select all that apply.

Choose the correct statements.

1
−1 ≤ ρ ≤ 1 always
2
ρ = 0 means X and Y are independent
3
Changing units does not change ρ
4
A high correlation proves cause
Solution
Idea

ρ = 0 is weaker than independence.

  • Statements 2 and 4 are false.
  • Answer: options 1 and 3.
Revision overview
CovarianceE[XY] − E[X]E[Y]
+ same way, − opposite way
RulesCov(X, X) = Var(X)
Cov(aX+b, cY+d) = ac Cov(X, Y)
Correlationρ = Cov / (σX σY)
Unit-free, in [−1, 1]
Two variablesChapter 5
Carefulρ = 0 is not independent
Only sees straight lines
Not causationA hidden factor can drive both
Correlation is only a hint
Sum of variablesVar(X+Y) = Var X + Var Y + 2Cov
Cov term vanishes if independent
Revision: covariance and correlation on one page
Next · InequalitiesMarkov and Chebyshev
06
Inequalities

Markov and Chebyshev

Bounds from just the mean and spread.

Sometimes we do not know the full distribution, only a couple of numbers such as the mean and the variance. Probability inequalities still give a guaranteed upper limit on how likely something extreme can be.

6.1Markov's inequality: using only the mean

Markov's inequality

If X≥0X \ge 0 and a>0a > 0, then

P(X≥a)≤E[X]aP(X \ge a) \le \frac{E[X]}{a}

In simple words: if the average is small, very large values must be rare. We only needed the mean.

Analogy. A colony's average income is ₹50,000. Can half the people earn ₹10 lakh? No! Then the average would be far higher. The average also tells you the most people who can earn ₹2 lakh or more: no more than 1/4. This is Markov: if the average is small, big earners are few.

The idea behind the proof. Suppose too many (more than E[X]/a of them) are at or above a. Their total alone is already above E[X], and nobody is negative. That is a contradiction: the mean would be too big. So at most E[X]/a of the population can be that large.

Markov is always true, but often a loose bound: P(X ≥ 3) for Exp(1)0123456tail X ≥ 3Exp(1): mean 10.333Markov bound0.050true valueMarkov says ≤ 1/3; the truth is e⁻³ ≈ 0.05. Safe, but loose.
Figure 21. Markov is always true, but often a loose bound
Needs X ≥ 0. If X can be negative, Markov can fail. Example: X = −10 with probability 0.9 and X = 100 with probability 0.1. Then E[X] = 1, but P(X ≥ 100) = 0.1, while Markov would claim ≤ 1/100 = 0.01. The bound is broken because of the negative values.

6.2Chebyshev's inequality: using mean and variance

Chebyshev's inequality

For any random variable with mean μ\mu and standard deviation σ\sigma, and any k>0k > 0,

P(∣X−μ∣≥kσ)≤1k2  ⟺  P(∣X−μ∣<kσ)≥1−1k2P(|X - \mu| \ge k\sigma) \le \frac1{k^2} \iff P(|X - \mu| < k\sigma) \ge 1 - \frac1{k^2}

In simple words: at least a fraction 1−1/k21 - 1/k^2 of the values lie within kk standard deviations of the mean. This is stronger than Markov because it uses the variance too.

Analogy. A teacher says "most children score close to the average". Chebyshev turns this into a firm promise: whatever the shape of the class's marks, at least 75% of the children are within 2σ of the mean. Bell curve or lopsided, the promise holds.
kAt most outside (1/k²)At least inside
110% (no information)
21/475%
31/988.9%
41/1693.75%
51/2596%
Chebyshev guarantee against the exact normal values0%25%50%75%100%0%68.3%k = 175%95.4%k = 288.9%99.7%k = 3Chebyshev (at least)Normal (actual)cautious but valid for every distribution
Figure 22. The guarantee is weaker than the exact normal figures, but it works for every distribution

Where it comes from. Apply Markov to the non-negative variable (X−μ)2(X - \mu)^2 with a=k2σ2a = k^2\sigma^2: P((X−μ)2≥k2σ2)≤E[(X−μ)2]k2σ2=σ2k2σ2=1k2P((X - \mu)^2 \ge k^2\sigma^2) \le \dfrac{E[(X-\mu)^2]}{k^2\sigma^2} = \dfrac{\sigma^2}{k^2\sigma^2} = \dfrac1{k^2}.

Can it be improved? Not without extra assumptions: there are distributions where it holds with equality, so it is the best possible bound for general data.

A three-point distribution that hits the Chebyshev bound exactly1/8-23/401/82X takes −2, 0, 2E[X] = 0Var(X) = 2 · (1/8) · 4 = 1P(|X| ≥ 2) = 1/8 + 1/8 = 1/4Chebyshev: 1/k² = 1/4equal, so it cannot be improved
Figure 23. A three-point distribution that hits the Chebyshev bound exactly

6.3Going deeper

  • Both are loose but valid (extra). They use very little information, so they must cover the worst case. That is why they are so safe and so cautious.
  • Choosing the tool (extra). Only the mean and X ≥ 0: Markov. Mean and standard deviation: Chebyshev. A known shape (normal): the exact 68–95–99.7 figures.
  • k below 1 says nothing (extra). For k = 1 the bound 1/k² = 1 is trivial, as the table shows (0% inside).

6.4Exam tips and common mistakes

Exam tips
  • For Chebyshev first convert the interval to k: k = (distance from the mean) ÷ σ.
  • Say which direction the bound goes: Markov and Chebyshev bound the tail from above; the "inside" statement is a lower bound.
Common mistakes
  • Using Markov on a variable that can be negative.
  • Reading the bound as the actual probability.
  • Using k = distance in raw units instead of in standard deviations.

Practice questions (graded-assignment style)

Q1Markov bound

Numerical Answer Type (NAT).

The average salary is ₹50,000. Bound P(X ≥ 2,00,000) (give the bound as a decimal).

Solution
Idea

E[X]/a.

  • 50000/200000 = 0.25.
  • Answer: 0.25
Q2Chebyshev k

Numerical Answer Type (NAT).

Mean 500, σ = 100. For the interval 300 to 700 what is k?

Solution
Idea

Distance 200 divided by σ.

  • 200/100 = 2.
  • Answer: 2
Q3Chebyshev least probability

Numerical Answer Type (NAT).

Mean 500, σ = 100. At least what probability does the quantity lie between 200 and 800? Give 9 × the answer.

Solution
Idea

k = 3 gives 1 − 1/9.

  • 1 − 1/9 = 8/9, and 9 × 8/9 = 8.
  • Answer: 8
Q4Tight Chebyshev

Numerical Answer Type (NAT).

X takes −2, 0, 2 with probabilities 1/8, 3/4, 1/8 (mean 0, variance 1). Find P(|X| ≥ 2) as a decimal.

Solution
Idea

1/8 + 1/8.

  • 0.125 + 0.125 = 0.25 = 1/k² for k = 2: Chebyshev is tight here.
  • Answer: 0.25
Q5Which inequality?

Multiple Choice Question (MCQ): choose the one correct option.

You know only the mean of a non-negative variable. Which inequality do you use to bound P(X ≥ a)?

1
Chebyshev
2
Markov
3
Jensen
4
Cauchy-Schwarz
Solution
Idea

Only the mean is known.

  • Markov uses only the mean and X ≥ 0.
  • Answer: option 2.
Q6Markov and Chebyshev

Multiple Select Question (MSQ): select all that apply.

Choose the correct statements.

1
Markov needs X ≥ 0
2
Chebyshev uses the mean and the variance
3
Chebyshev with k = 2 guarantees at least 75% within μ ± 2σ
4
Both bounds are exact values of the probability
Solution
Idea

They are guaranteed bounds, not exact values.

  • Statement 4 is false: the bounds are often loose.
  • Answer: options 1, 2 and 3.
Revision overview
MarkovP(X ≥ a) ≤ E[X]/a
Needs X ≥ 0, uses mean only
ChebyshevP(|X − μ| ≥ kσ) ≤ 1/k²
Uses mean and variance
MeaningAt least 1 − 1/k² inside μ ± kσ
k = 2: 75%, k = 3: 88.9%
Bounding probabilitiesChapter 6
LinkChebyshev = Markov on (X − μ)²
RememberBoth are loose but always valid
Chebyshev can be tight
CompareNormal: 68, 95, 99.7%
Chebyshev: 0, 75, 88.9%
Revision: Markov and Chebyshev on one page
Next · InequalitiesJensen and Cauchy-Schwarz
07
Inequalities

Jensen and Cauchy-Schwarz

Curves, averages and the limit of correlation.

Two more famous inequalities: Jensen (what happens when you apply a curved function to a random variable) and Cauchy-Schwarz (why correlation can never go beyond ±1).

7.1Jensen's inequality

Jensen's inequality

If gg is convex (curves upward like a smile, e.g. x2x^2, exe^x, ∣x∣|x|), then

E[g(X)]≥g(E[X])E[g(X)] \ge g(E[X])

If gg is concave (curves downward like a frown, e.g. ln⁡x\ln x, x\sqrt x), the inequality reverses: E[g(X)]≤g(E[X])E[g(X)] \le g(E[X]).

Analogy. Think of an electricity bill with slabs: the more units, the higher the rate per unit. That is a convex bill. If one month burns 50 units and another 150, the average is 100 units, but the average of the two bills is more than the bill for 100 units. The heavy month costs extra. That is Jensen: a convex function pulls the average up.
Convex: the average of the outputs is at least the output of the averagex = 1x = 3E[g(X)] = 5g(E[X]) = 4X is 1 or 3, each with 1/2E[X] = 2E[X²] = (1 + 9)/2 = 5(E[X])² = 4, 5 ≥ 4 ✓The chord lies above the curve,so the average of outputs is higher.
Figure 24. Convex: the average of the outputs is at least the output of the average
Concave: the inequality flipsx = 1x = 4E[ln X] = 0.693ln E[X] = 0.916X is 1 or 4, each with 1/2E[X] = 2.5ln 1 = 0, ln 4 ≈ 1.386E[ln X] ≈ 0.693ln E[X] ≈ 0.9160.693 ≤ 0.916 ✓the chord lies below the curve
Figure 25. Concave: the inequality flips
FunctionTypeJensen says
x2x^2convexE[X2]≥(E[X])2E[X^2] \ge (E[X])^2, which is the same as Var(X) ≥ 0
exe^xconvexE[eX]≥eE[X]E[e^X] \ge e^{E[X]}
ln⁡x\ln xconcaveE[ln⁡X]≤ln⁡E[X]E[\ln X] \le \ln E[X] (for X > 0)
x\sqrt xconcaveE[X]≤E[X]E[\sqrt X] \le \sqrt{E[X]}

Check with numbers. X = −1 or 1 equally likely. E[X] = 0, so e^E[X] = 1, while E[e^X] = (e⁻¹ + e¹)/2 ≈ 1.543. Indeed 1.543 ≥ 1.

Tip: convex or concave?
  • Look at the second derivative. g″ > 0 means convex (smile). g″ < 0 means concave (frown).
  • Second derivative dekho. g″ > 0 matlab convex (smile). g″ < 0 matlab concave (frown).

7.2Cauchy-Schwarz inequality

Cauchy-Schwarz

For any two random variables:

(E[XY])2≤E[X2] E[Y2]  ⟹  (Cov⁡(X,Y))2≤Var⁡(X)Var⁡(Y)(E[XY])^2 \le E[X^2]\,E[Y^2] \;\Longrightarrow\; (\operatorname{Cov}(X, Y))^2 \le \operatorname{Var}(X)\operatorname{Var}(Y)

The second form is the first one applied to the deviations X−μXX - \mu_X and Y−μYY - \mu_Y. Dividing both sides by σX2σY2\sigma_X^2\sigma_Y^2 gives ρ2≤1\rho^2 \le 1, so −1≤ρ≤1-1 \le \rho \le 1. That is why correlation can never exceed 1 in size.

Analogy. Take two sticks with an angle θ between them. Their "togetherness" is cos θ, which is never above 1 or below −1. Correlation is exactly this: the cosine between two variables. Sticks in the same direction give 1, at 90° give 0, opposite give −1.
Correlation plays the role of cos θ between two "vectors" of deviationsρ = +1same directionρ = 0at right anglesρ = −1opposite directionscos θ never goes above 1 or below −1, and neither does ρ
Figure 26. Correlation plays the role of cos θ between two "vectors" of deviations

Equality in the covariance form holds exactly when Y=aX+bY = aX + b for some constants. Then ρ=+1\rho = +1 if a>0a > 0 and ρ=−1\rho = -1 if a<0a < 0. So a perfect straight-line relationship gives ∣ρ∣=1|\rho| = 1, and nothing can be more related than that.

7.3Going deeper

  • Jensen explains Var ≥ 0 (extra). With g(x) = x², Jensen says E[X²] ≥ (E[X])², and the gap is exactly the variance, which is why variance is never negative.
  • Equality (extra). Jensen holds with equality when X is constant, or when g is a straight line (both convex and concave).
  • Use it to compare averages (extra). A concave g (utility, log, square root) makes the average of the outcomes less than the outcome of the average: one reason risk-averse people prefer a sure amount.

7.4Exam tips and common mistakes

Exam tips
  • To use Jensen decide convex or concave first (second derivative), then write the direction before substituting numbers.
  • To test whether a covariance is possible, compare |Cov| with √(Var X · Var Y).
Common mistakes
  • Using the convex direction for ln x or √x.
  • Thinking E[g(X)] = g(E[X]) for curved g.
  • Accepting a covariance larger than √(Var X · Var Y).

Practice questions (graded-assignment style)

Q1E[X²] for X = 1 or 9

Numerical Answer Type (NAT).

X is 1 or 9 with probability 1/2 each. Find E[X²].

Solution
Idea

(1 + 81)/2.

  • (1 + 81)/2 = 41, which is at least (E[X])² = 25.
  • Answer: 41
Q2Largest possible covariance

Numerical Answer Type (NAT).

Var(X) = 4 and Var(Y) = 9. What is the largest possible value of Cov(X, Y)?

Solution
Idea

√(4 × 9).

  • By Cauchy-Schwarz |Cov| ≤ √36 = 6.
  • Answer: 6
Q3ρ for Cov = 6

Numerical Answer Type (NAT).

With Var(X) = 4, Var(Y) = 9 and Cov(X, Y) = 6, find ρ.

Solution
Idea

Cov/(σX σY).

  • 6/(2 × 3) = 1: a perfect upward line.
  • Answer: 1
Q4Jensen direction

Multiple Choice Question (MCQ): choose the one correct option.

For the concave function ln x and X > 0, Jensen says:

1
E[ln X] ≥ ln E[X]
2
E[ln X] ≤ ln E[X]
3
E[ln X] = ln E[X]
4
Nothing
Solution
Idea

Concave means the inequality flips.

  • Concave functions give E[g(X)] ≤ g(E[X]).
  • Answer: option 2.
Q5Is Cov = 7 possible?

Multiple Choice Question (MCQ): choose the one correct option.

Var(X) = 4 and Var(Y) = 9. Is Cov(X, Y) = 7 possible?

1
Yes
2
No, since 7 > 6
3
Only if X, Y are independent
4
Only if ρ = 0
Solution
Idea

Compare with √(Var X · Var Y) = 6.

  • It would make ρ = 7/6 > 1, which is impossible.
  • Answer: option 2.
Q6Convex and concave

Multiple Select Question (MSQ): select all that apply.

Which of these functions are convex?

1
x²
2
eˣ
3
|x|
4
ln x
Solution
Idea

Smile shapes.

  • ln x is concave (frown).
  • Answer: options 1, 2 and 3.
Revision overview
Jensen: convexE[g(X)] ≥ g(E[X])
x², eˣ, |x|
Jensen: concaveE[g(X)] ≤ g(E[X])
ln x and √x
UsesE[X²] ≥ (E[X])² gives Var ≥ 0
E[ln X] ≤ ln E[X]
Two more inequalitiesChapter 7
Cauchy-Schwarz(E[XY])² ≤ E[X²]E[Y²]
Cov² ≤ Var(X)Var(Y)
Consequence−1 ≤ ρ ≤ 1
ρ = cos θ
EqualityY = aX + b
ρ = +1 if a > 0, −1 if a < 0
Revision: Jensen and Cauchy-Schwarz on one page
Next · SummaryWeek 3 Summary Sheet
08
Summary

Week 3 Summary Sheet

Everything on one sheet.

Everything from this week on one sheet. Use it for quick revision before a quiz.

8.1Formula sheet

TopicFormulas
Expectation: mean of a random variableE[X]=∑xx P(X=x)E[X] = \sum_x x\,P(X = x) or ∫xf(x) dx\int x f(x)\,dx; E[aX+bY+c]=aE[X]+bE[Y]+cE[aX + bY + c] = aE[X] + bE[Y] + c (always); E[XY]=E[X]E[Y]E[XY] = E[X]E[Y] if independent; E[g(X)]=∑g(x)P(X=x)E[g(X)] = \sum g(x)P(X = x)
Variance: spread around the meanVar⁡(X)=E[X2]−(E[X])2\operatorname{Var}(X) = E[X^2] - (E[X])^2; Var⁡(aX+b)=a2Var⁡(X)\operatorname{Var}(aX + b) = a^2\operatorname{Var}(X); σ=Var⁡(X)\sigma = \sqrt{\operatorname{Var}(X)}; Bernoulli: p(1−p)p(1-p); independent: variances add
Covariance and correlation: two variablesCov⁡(X,Y)=E[XY]−E[X]E[Y]\operatorname{Cov}(X, Y) = E[XY] - E[X]E[Y]; Cov⁡(aX+b,cY+d)=acCov⁡(X,Y)\operatorname{Cov}(aX+b, cY+d) = ac\operatorname{Cov}(X, Y); ρ=Cov⁡σXσY∈[−1,1]\rho = \dfrac{\operatorname{Cov}}{\sigma_X\sigma_Y} \in [-1, 1]; Var⁡(X+Y)=Var⁡(X)+Var⁡(Y)+2Cov⁡(X,Y)\operatorname{Var}(X+Y) = \operatorname{Var}(X) + \operatorname{Var}(Y) + 2\operatorname{Cov}(X, Y)
Inequalities: guaranteed boundsMarkov: P(X≥a)≤E[X]/aP(X \ge a) \le E[X]/a (X≥0X \ge 0); Chebyshev: P(∣X−μ∣≥kσ)≤1/k2P(|X - \mu| \ge k\sigma) \le 1/k^2; Jensen: convex E[g(X)]≥g(E[X])E[g(X)] \ge g(E[X]); C-S: Cov⁡2≤Var⁡(X)Var⁡(Y)\operatorname{Cov}^2 \le \operatorname{Var}(X)\operatorname{Var}(Y)

8.2Known means and variances

DistributionMeanVariance
Bernoulli (p)(p)ppp(1−p)p(1-p)
Fair die3.535/12≈2.9235/12 \approx 2.92
Uniform (a,b)(a, b)a+b2\dfrac{a+b}{2}(b−a)212\dfrac{(b-a)^2}{12}
Exponential (λ)(\lambda)1/λ1/\lambda1/λ21/\lambda^2
Normal N(μ,σ2)N(\mu, \sigma^2)μ\muσ2\sigma^2
Check (extra). The Uniform(2, 8) variance is (8 − 2)²/12 = 3, which agrees with E[X²] − (E[X])² = 28 − 25 = 3 from Chapter 2. The exponential Exp(1/5) has variance 25, and 50 − 25 = 25 agrees too.

8.3Which tool, and what to avoid

What does the question ask?ToolFormula or note
Average of somethingExpected valueE[X]=∑xP(X=x)E[X] = \sum x P(X = x); use linearity for sums
How spread out?Variance and σE[X2]−(E[X])2E[X^2] - (E[X])^2; Var⁡(aX+b)=a2Var⁡(X)\operatorname{Var}(aX + b) = a^2\operatorname{Var}(X)
Two variables togetherCov and ρρ=Cov⁡/(σXσY)\rho = \operatorname{Cov}/(\sigma_X\sigma_Y); ρ = 0 is not independence
Probability of an extreme, only mean, X ≥ 0MarkovE[X]/aE[X]/a
Probability of an extreme, mean and σ knownChebyshev1/k21/k^2
Curved function of XJensenconvex: ≥, concave: ≤
Bound for ρ or CovCauchy-SchwarzCov⁡2≤Var⁡(X)Var⁡(Y)\operatorname{Cov}^2 \le \operatorname{Var}(X)\operatorname{Var}(Y)

8.4Common errors to avoid

MistakeCorrect idea
E[X2]=(E[X])2E[X^2] = (E[X])^2Wrong. The gap is the variance: E[X2]−(E[X])2=Var⁡(X)≥0E[X^2] - (E[X])^2 = \operatorname{Var}(X) \ge 0.
Var⁡(X−Y)=Var⁡(X)−Var⁡(Y)\operatorname{Var}(X - Y) = \operatorname{Var}(X) - \operatorname{Var}(Y)For independent variables, variances add even for a difference.
ρ=0⇒\rho = 0 \Rightarrow independentNot true. Only no straight-line relationship.
Using Markov on a variable that can be negativeMarkov needs X≥0X \ge 0.
Reading a high correlation as proof of causeLook for a hidden factor or coincidence.
Empirical rule for a roughly normal distributionμ−3σμ−2σμ−σμμ+σμ+2σμ+3σ68% (1σ)95% (2σ)99.7% (3σ)
Figure 27. Reminder: the 68-95-99.7 rule for a roughly normal distribution

8.5One last worked example (extra)

Example 28Put the tools together (extra)

Exam scores X have mean 60 and standard deviation 10. (a) Bound P(X ≥ 90) using Markov (scores are non-negative). (b) Bound P(|X − 60| ≥ 30) using Chebyshev. (c) Which bound is better?

Solution
  1. (a) Markov: P(X≥90)≤6090=23≈0.667P(X \ge 90) \le \tfrac{60}{90} = \tfrac23 \approx 0.667.
  2. (b) 30=3σ30 = 3\sigma, so k=3k = 3: P(∣X−60∣≥30)≤19≈0.111P(|X - 60| \ge 30) \le \tfrac19 \approx 0.111. This bounds both tails together, so P(X≥90)P(X \ge 90) is also at most 0.111.
  3. (c) Chebyshev is far better because it also uses the standard deviation: 0.111 against 0.667. More information gives a tighter bound.
Revision overview
ExpectationE[X] = Σ x P(X = x)
Linearity always
E[g(X)] by LOTUS
VarianceE[X²] − (E[X])²
Var(aX+b) = a² Var(X)
Independent: add
Two variablesCov and ρ
ρ in [−1, 1]
ρ = 0 is not independence
Week 3Summary sheet
BoundsMarkov: mean, X ≥ 0
Chebyshev: mean and σ
CurvesJensen: convex ≥, concave ≤
Cauchy-Schwarz: |ρ| ≤ 1
AvoidVar(X−Y) is not a difference
Correlation is not causation
Revision: all of Week 3 on one sheet
Back to top