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.
Chapters
- 01Expected Value and Casino MathExpectation
- 02Expected Value of a Random VariableExpectation
- 03Scatter Plots and SpreadSpread
- 04Variance and Standard DeviationSpread
- 05Covariance and CorrelationRelationships
- 06Markov and ChebyshevInequalities
- 07Jensen and Cauchy-SchwarzInequalities
- 08Week 3 Summary SheetSummary
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?
The expected value (also called the mean) is the long-run average of . 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.
1.2A fair die
For a fair die . 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 .
1.3A 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].
| Value x | P(X = x) | x · P(X = x) |
|---|---|---|
| 1, 2, 3, 4, 5 (each) | 0.1 | 0.1, 0.2, 0.3, 0.4, 0.5 |
| 6 | 0.5 | 3.0 |
- The first five rows add to
0.1 + 0.2 + 0.3 + 0.4 + 0.5 = 1.5. - Add the 6:
1.5 + 3.0 = 4.5. E[X] = 4.5. - This is higher than the fair die's 3.5 because 6 is much more likely.
1.4The indicator variable
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.
The expected gain is . The casino keeps about 2.7 paise out of every rupee bet.
1.6Judging a game
| Expected net gain | Verdict | Meaning |
|---|---|---|
| good for you | play it | |
| a fair game | no one wins on average | |
| bad for you | this is how casinos earn |
Net gain = what you win on average minus what you pay. Always subtract the price before judging the game.
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
- Write the table first: value, probability, value × probability. Add the last column.
- For games, state the net gain (winnings minus price) before deciding.
- 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)
Numerical Answer Type (NAT).
A die shows 1 to 5 with probability 0.1 each and 6 with probability 0.5. Find E[X].
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
Numerical Answer Type (NAT).
10% of people are left-handed. X = 1 for a left-hander and 0 otherwise. Find E[X].
An indicator's mean is its probability.
- E[X] = p = 0.1.
- Answer: 0.1
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?
Fair price = expected prize.
- 100000 × 1/10000 = 10.
- Answer: 10
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?
Per bet −100/37.
- Per bet: 100·18/37 − 100·19/37 = −100/37. Over 37 bets: 37 × (−100/37) = −100.
- Answer: -100
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:
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.
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements.
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.
Balance point
Value × chance, then add
Indicator: E[X] = p
Roulette: −1/37 per ₹1
Net = winnings − price
Lottery: ₹10 for ₹1,00,000 at 1/10,000
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
| Rule | Formula | In simple words |
|---|---|---|
| Linearity | Split the sum, pull out multipliers. Always true, no independence needed. | |
| Constant | A number that never changes has that number as its average. | |
| Product | Only if X and Y are independent. | |
| LOTUS | To average a function of X, change the values first, keep the same probabilities. |
E[X] = 5 and E[Y] = 3. Find E[4X − 2Y + 7].
- .
- .
- No joint distribution and no independence were needed, only the two means.
Find the expected sum of two fair dice without listing the 36 outcomes.
- Each die has mean .
- By linearity , and the two dice need not even be independent.
- 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
100 people each flip a fair coin and X is the total number of heads. Find E[X] using linearity.
- Let if person gets heads, else 0. Then .
- Each is an indicator, so .
- By linearity . This still holds if the coins are not independent.
2.3LOTUS: the expected value of a function
To find you do not need the distribution of . Take each value , apply , multiply by , and add. The most common choice is , which we need for variance in Chapter 4.
X takes the values −1, 0, 2 with probabilities 0.3, 0.2, 0.5. Find E[X²] and compare it with (E[X])².
- Using LOTUS: .
- The mean is , so .
- : squaring the average is not the same as averaging the squares. The gap 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 :
| Distribution | Mean E[X] |
|---|---|
| Uniform | (the middle of the interval) |
| Exponential | |
| Normal | (the centre of symmetry) |
| Bernoulli , Binomial , Poisson | , , |
For X ~ Uniform(2, 8) find E[X] and E[X²]. For X ~ Exp(1/5) find E[X] and E[X²].
- Uniform(2, 8). . By LOTUS with density : .
- Exp(1/5). , so and . If customers arrive every 5 minutes on average, the waiting time has mean 5 minutes.
- Note and : again .
2.5Going deeper
- LOTUS for a continuous variable (extra). The same idea works with an integral: . 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 they agree, but for curved 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
| Distribution | Mean | Variance | Where it comes from |
|---|---|---|---|
| Bernoulli | ; since , , so | ||
| Binomial | a sum of independent Bernoulli; means add, and (by independence) variances add | ||
| Geometric (trials until the first success, ) | first-step argument below | ||
| Poisson | , so | ||
| Hypergeometric | each draw is Type 1 with probability (linearity); draws are dependent, so the variance is the binomial one times |
Why for the geometric. Look at the first trial. With probability it succeeds and . With probability it fails, you have used one trial, and you are back at the start, so the expected total is . Hence
Worked values.
- Binomial: mean , variance , standard deviation . (Computing from the full PMF gives exactly and .)
- Geometric (throw a die until the first 1): throws, , standard deviation . The spread is as big as the mean: waiting times are very variable.
- Poisson: mean , variance , and .
- Hypergeometric: mean , variance . (Binomial would have variance ; sampling without replacement lowers it.)
B. Sums and products of two variables
- Always: , independent or not.
- If and are independent: and .
- In general: and .
- Two independent fair dice: sum has mean and variance ; the product has .
C. Conditional expectation and the law of total expectation
The conditional expectation of given an event (with ) is the average of over the conditional PMF:
If partition the sample space, then
This is the law of total probability carried over to averages: the overall average is the weighted average of the group averages.
- A die. , , so ✓.
- From a joint PMF. Let , , , . Then , , , , and , which matches computed directly ✓.
D. Standardising
For with mean and standard deviation , the standardised variable has and (by the rules for ). The value says "how many standard deviations is from the mean". Example: marks with mean 60 and standard deviation 8: a score of 76 has .
2.7Exam tips and common mistakes
- 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.
- 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)
Numerical Answer Type (NAT).
E[X] = 5 and E[Y] = 3. Find E[4X − 2Y + 7].
4·5 − 2·3 + 7.
- 20 − 6 + 7 = 21.
- Answer: 21
Numerical Answer Type (NAT).
X takes −1, 0, 2 with probabilities 0.3, 0.2, 0.5. Find E[X²].
Square the values, keep the probabilities.
- 1(0.3) + 0(0.2) + 4(0.5) = 2.3.
- Answer: 2.3
Numerical Answer Type (NAT).
100 fair coins are flipped (not necessarily independently). Find the expected number of heads.
100 indicators with mean 1/2.
- By linearity: 100 × 1/2 = 50.
- Answer: 50
Numerical Answer Type (NAT).
X ~ Exp(1/5) (mean 5). Using E[X²] = 2/λ², find E[X²].
λ = 1/5.
- 2/λ² = 2 × 25 = 50.
- Answer: 50
Multiple Choice Question (MCQ): choose the one correct option.
Which of these is guaranteed only when X and Y are independent?
Linearity needs nothing.
- Linearity (sums, multipliers, constants) is always true; the product rule is the one that needs independence.
- Answer: option 3.
Multiple Select Question (MSQ): select all that apply.
Choose the correct means.
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.
Numerical Answer Type (NAT).
is Binomial. Find .
is a sum of 10 independent Bernoulli(0.3), each with variance .
- .
- Answer: 2.1
Numerical Answer Type (NAT).
A fair die is thrown repeatedly until the first 6 appears. What is the expected number of throws?
The number of trials to the first success is Geometric with .
- , so . The variance is .
- Answer: 6
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements.
Plug into the table.
- 1 ✓ for the Poisson the mean and variance are both .
- 2 ✓ and .
- 3 ✗ , not .
- 4 ✓ .
- Answer: options 1, 2 and 4.
Numerical Answer Type (NAT).
A fair die is thrown. What is ?
Given "even", the outcomes are equally likely, each with conditional probability .
- .
- Answer: 4
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?
Weighted average of the group means: .
- .
- Answer: 380
Numerical Answer Type (NAT).
Two independent fair dice are thrown. What is the variance of the sum? (Give a decimal rounded to 2 places.)
For independent variables, the variances add.
- One die has variance . The sum has .
- Answer: 5.83
Numerical Answer Type (NAT).
Marks have mean 60 and standard deviation 8. What is the standardised value of a score of 76?
.
- : the score is two standard deviations above the mean.
- Answer: 2
Always true, no independence
E[XY] = E[X]E[Y] if independent
E[X²] ≠ (E[X])²
Sum becomes integral
Normal μ, Binomial np
E = sum of probabilities
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)
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.
3.3Measuring spread
The mean says where the centre is, but not how scattered the values are. Three common measures of spread:
| Measure | What it is | Good / bad |
|---|---|---|
| Range | Very simple, but one outlier changes it a lot. | |
| IQR | (the spread of the middle 50% of the data) | Ignores extreme values, so it is robust. |
| Variance | average squared distance from the mean | The standard measure (next chapter). |
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
- Describe a scatter plot in three words: direction, strength, shape.
- When asked to compare two data sets, give both the centre and the spread.
- 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)
Numerical Answer Type (NAT).
Find the range of the data set {2, 6, 10, 14, 18}.
max − min.
- 18 − 2 = 16.
- Answer: 16
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.
(4 + 1 + 0 + 1 + 4)/5.
- 10/5 = 2.
- Answer: 2
Numerical Answer Type (NAT).
Find the variance of {2, 6, 10, 14, 18} (mean 10).
(64 + 16 + 0 + 16 + 64)/5.
- 160/5 = 32.
- Answer: 32
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.
Q₃ − Q₁ = 14 − 11.
- 14 − 11 = 3, the same as without the outlier.
- Answer: 3
Multiple Choice Question (MCQ): choose the one correct option.
Which measure of spread is least affected by one extreme outlier?
Think of the middle 50%.
- The IQR uses only the middle half of the data.
- Answer: option 2.
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements.
Correlation is not causation.
- Statement 3 is false: correlation does not prove cause.
- Answer: options 1, 2 and 4.
Ask: direction, strength, shape
Curved: r may be near 0
Always look at the plot
IQR = Q3 − Q1 (robust)
Variance: next chapter
Watch for a hidden factor
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.
With :
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. , , so .
- Bernoulli variable. If is 1 with chance and 0 otherwise, then (since ), so .
4.2Standard deviation
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 , most students score within , that is between 60 and 80. If , scores are packed between 68 and 72.
4.3Rules for variance
| Rule | Formula | In simple words |
|---|---|---|
| Constant | A fixed number has no spread. | |
| Shift and scale | Adding b only moves everything; it does not change spread. Multiplying by a multiplies the variance by a². | |
| Sum (independent) | Variances add, even for a difference. | |
| Sum (general) | Needs the covariance term (Chapter 5). | |
| SD of aX + b | The standard deviation scales by |a| only. |
- Many students write . This is wrong. For independent variables it is . 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σ.
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
- 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.
- 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)
Numerical Answer Type (NAT).
X takes 1, 3, 5 with probabilities 0.2, 0.5, 0.3. Find Var(X).
E[X²] − (E[X])².
- E[X] = 3.2, E[X²] = 12.2, so Var = 12.2 − 10.24 = 1.96.
- Answer: 1.96
Numerical Answer Type (NAT).
X has mean 60 and standard deviation 10. Find Var(2X + 5).
Ignore the +5, square the 2.
- 2² × 100 = 400.
- Answer: 400
Numerical Answer Type (NAT).
X, Y are independent with Var(X) = 9 and Var(Y) = 16. Find the standard deviation of X − Y.
Variances add, then take the root.
- Var = 9 + 16 = 25, σ = 5.
- Answer: 5
Numerical Answer Type (NAT).
X is 1 with probability 0.5 and 0 otherwise. Find Var(X).
p(1 − p).
- 0.5 × 0.5 = 0.25.
- Answer: 0.25
Multiple Choice Question (MCQ): choose the one correct option.
Heights follow N(175, 49) cm. About what percentage lie between 161 and 189 cm?
σ = 7; 161 and 189 are μ ∓ 2σ.
- Within 2σ of the mean: about 95%.
- Answer: option 2.
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements.
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.
Shortcut E[X²] − (E[X])²
Always ≥ 0
Same units as X
Independent: variances add
Fair die: 35/12
95% within 2σ, 99.7% within 3σ
Var(aX) = a² Var(X)
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.
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
| Rule | Formula | In simple words |
|---|---|---|
| Itself | Variance is the covariance of a variable with itself. | |
| Opposite | Perfectly opposite, so as negative as possible. | |
| Shift and scale | Constants b, d do nothing. Only the multipliers a, c matter. | |
| Independent | Independent variables have zero covariance. The reverse is not true. | |
| Variance of a sum | The extra term vanishes when X, Y are independent. |
5.3Correlation: covariance without units
Dividing by both standard deviations removes the units, so the answer always lies between and .
5.4Properties of correlation
- always (proved in Chapter 7).
- exactly when (a perfect straight line). The sign of is the sign of .
- Symmetric: .
- Independent gives , but does not give independent (except for the bivariate normal).
- Under a change of scale: . Flipping one variable flips the sign.
5.5Zero correlation does not mean no relationship
only detects straight-line relationships. Take and . Here , and (odd powers of a symmetric variable average to 0). So , yet is completely decided by .
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.
- 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
- 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.
- 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)
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).
E[XY] − E[X]E[Y] = 0.4 − 0.7 × 0.6.
- 0.4 − 0.42 = −0.02.
- Answer: -0.02
Numerical Answer Type (NAT).
ρ(A, B) = 0.8. Find ρ(2A + 1, −3B + 5).
The product of multipliers 2 × (−3) is negative.
- The sign flips and the magnitude stays: −0.8.
- Answer: -0.8
Numerical Answer Type (NAT).
Cov(X, Y) = 5. Find Cov(2X + 3, 4Y − 1).
2 × 4 × 5.
- Constants do nothing: 8 × 5 = 40.
- Answer: 40
Numerical Answer Type (NAT).
Var(X) = 4, Var(Y) = 9, Cov(X, Y) = −6. Find Var(X + Y).
Add 2Cov.
- 4 + 9 + 2(−6) = 1.
- Answer: 1
Multiple Choice Question (MCQ): choose the one correct option.
For X ~ N(0, 1) and Y = X², the correlation is 0. Therefore:
Y is exactly X².
- Y is decided by X, so they are dependent; ρ only measures straight-line relationships.
- Answer: option 2.
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements.
ρ = 0 is weaker than independence.
- Statements 2 and 4 are false.
- Answer: options 1 and 3.
+ same way, − opposite way
Cov(aX+b, cY+d) = ac Cov(X, Y)
Unit-free, in [−1, 1]
Only sees straight lines
Correlation is only a hint
Cov term vanishes if independent
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
If and , then
In simple words: if the average is small, very large values must be rare. We only needed the mean.
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.
6.2Chebyshev's inequality: using mean and variance
For any random variable with mean and standard deviation , and any ,
In simple words: at least a fraction of the values lie within standard deviations of the mean. This is stronger than Markov because it uses the variance too.
| k | At most outside (1/k²) | At least inside |
|---|---|---|
| 1 | 1 | 0% (no information) |
| 2 | 1/4 | 75% |
| 3 | 1/9 | 88.9% |
| 4 | 1/16 | 93.75% |
| 5 | 1/25 | 96% |
Where it comes from. Apply Markov to the non-negative variable with : .
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.
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
- 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.
- 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)
Numerical Answer Type (NAT).
The average salary is ₹50,000. Bound P(X ≥ 2,00,000) (give the bound as a decimal).
E[X]/a.
- 50000/200000 = 0.25.
- Answer: 0.25
Numerical Answer Type (NAT).
Mean 500, σ = 100. For the interval 300 to 700 what is k?
Distance 200 divided by σ.
- 200/100 = 2.
- Answer: 2
Numerical Answer Type (NAT).
Mean 500, σ = 100. At least what probability does the quantity lie between 200 and 800? Give 9 × the answer.
k = 3 gives 1 − 1/9.
- 1 − 1/9 = 8/9, and 9 × 8/9 = 8.
- Answer: 8
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.
1/8 + 1/8.
- 0.125 + 0.125 = 0.25 = 1/k² for k = 2: Chebyshev is tight here.
- Answer: 0.25
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)?
Only the mean is known.
- Markov uses only the mean and X ≥ 0.
- Answer: option 2.
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements.
They are guaranteed bounds, not exact values.
- Statement 4 is false: the bounds are often loose.
- Answer: options 1, 2 and 3.
Needs X ≥ 0, uses mean only
Uses mean and variance
k = 2: 75%, k = 3: 88.9%
Chebyshev can be tight
Chebyshev: 0, 75, 88.9%
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
If is convex (curves upward like a smile, e.g. , , ), then
If is concave (curves downward like a frown, e.g. , ), the inequality reverses: .
| Function | Type | Jensen says |
|---|---|---|
| convex | , which is the same as Var(X) ≥ 0 | |
| convex | ||
| concave | (for X > 0) | |
| concave |
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.
- 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
For any two random variables:
The second form is the first one applied to the deviations and . Dividing both sides by gives , so . That is why correlation can never exceed 1 in size.
Equality in the covariance form holds exactly when for some constants. Then if and if . So a perfect straight-line relationship gives , 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
- 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).
- 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)
Numerical Answer Type (NAT).
X is 1 or 9 with probability 1/2 each. Find E[X²].
(1 + 81)/2.
- (1 + 81)/2 = 41, which is at least (E[X])² = 25.
- Answer: 41
Numerical Answer Type (NAT).
Var(X) = 4 and Var(Y) = 9. What is the largest possible value of Cov(X, Y)?
√(4 × 9).
- By Cauchy-Schwarz |Cov| ≤ √36 = 6.
- Answer: 6
Numerical Answer Type (NAT).
With Var(X) = 4, Var(Y) = 9 and Cov(X, Y) = 6, find ρ.
Cov/(σX σY).
- 6/(2 × 3) = 1: a perfect upward line.
- Answer: 1
Multiple Choice Question (MCQ): choose the one correct option.
For the concave function ln x and X > 0, Jensen says:
Concave means the inequality flips.
- Concave functions give E[g(X)] ≤ g(E[X]).
- Answer: option 2.
Multiple Choice Question (MCQ): choose the one correct option.
Var(X) = 4 and Var(Y) = 9. Is Cov(X, Y) = 7 possible?
Compare with √(Var X · Var Y) = 6.
- It would make ρ = 7/6 > 1, which is impossible.
- Answer: option 2.
Multiple Select Question (MSQ): select all that apply.
Which of these functions are convex?
Smile shapes.
- ln x is concave (frown).
- Answer: options 1, 2 and 3.
x², eˣ, |x|
ln x and √x
E[ln X] ≤ ln E[X]
Cov² ≤ Var(X)Var(Y)
ρ = cos θ
ρ = +1 if a > 0, −1 if a < 0
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
| Topic | Formulas |
|---|---|
| Expectation: mean of a random variable | or ; (always); if independent; |
| Variance: spread around the mean | ; ; ; Bernoulli: ; independent: variances add |
| Covariance and correlation: two variables | ; ; ; |
| Inequalities: guaranteed bounds | Markov: (); Chebyshev: ; Jensen: convex ; C-S: |
8.2Known means and variances
| Distribution | Mean | Variance |
|---|---|---|
| Bernoulli | ||
| Fair die | 3.5 | |
| Uniform | ||
| Exponential | ||
| Normal |
8.3Which tool, and what to avoid
| What does the question ask? | Tool | Formula or note |
|---|---|---|
| Average of something | Expected value | ; use linearity for sums |
| How spread out? | Variance and σ | ; |
| Two variables together | Cov and ρ | ; ρ = 0 is not independence |
| Probability of an extreme, only mean, X ≥ 0 | Markov | |
| Probability of an extreme, mean and σ known | Chebyshev | |
| Curved function of X | Jensen | convex: ≥, concave: ≤ |
| Bound for ρ or Cov | Cauchy-Schwarz |
8.4Common errors to avoid
| Mistake | Correct idea |
|---|---|
| Wrong. The gap is the variance: . | |
| For independent variables, variances add even for a difference. | |
| independent | Not true. Only no straight-line relationship. |
| Using Markov on a variable that can be negative | Markov needs . |
| Reading a high correlation as proof of cause | Look for a hidden factor or coincidence. |
8.5One last worked example (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?
- (a) Markov: .
- (b) , so : . This bounds both tails together, so is also at most 0.111.
- (c) Chebyshev is far better because it also uses the standard deviation: 0.111 against 0.667. More information gives a tighter bound.
Linearity always
E[g(X)] by LOTUS
Var(aX+b) = a² Var(X)
Independent: add
ρ in [−1, 1]
ρ = 0 is not independence
Chebyshev: mean and σ
Cauchy-Schwarz: |ρ| ≤ 1
Correlation is not causation