Week 10: Expectation & Variance of Discrete RVs
3087 words
15 min read
2026-09-12T00:00:00.000Z
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
Expected value E[X], linearity of expectation, variance Var(X), properties of variance, and standard deviation. # Statistics for Data Science I — Week 10: Expectation & Variance of Discrete RVs IITM’s Week 10 covers **expectation of a discrete random variable, variance, and standard deviation of a discrete random va...

Statistics for Data Science I — Week 10: Expectation & Variance of Discrete RVs
IITM’s Week 10 covers expectation of a discrete random variable, variance, and standard deviation of a discrete random variable.
TL;DR
Week 9 gave us the distribution of a random variable:
Week 10 compresses that distribution into two major numerical summaries:
for the long-run average / center, and:
for spread.
The most important formulas are:
where:
And the computational shortcut:
Standard deviation:
1. Expectation
The expected value of a discrete random variable is its probability-weighted average.
If X takes values:
with probabilities:
then:
or:
2. Why it is called expectation
Expected value does not necessarily mean:
the value you literally expect to observe on the next trial.
It is better interpreted as:
the long-run average over many repetitions of the same experiment.
3. Fair die example
Let:
Then:
So:
Thus:
4. Expected value need not be possible
A die can never show:
Yet:
So:
This is a very common conceptual trap.
5. Expectation as weighted mean
Compare ordinary mean:
For a random variable:
Probability acts like a weight.
So expectation is just a weighted average.
6. Example
Suppose:
| x | P(X=x) |
|---|---|
| 0 | 0.2 |
| 1 | 0.5 |
| 2 | 0.3 |
Then:
Thus:
7. Long-run interpretation
Suppose the experiment is repeated many times:
The empirical average:
often approaches:
as n becomes large, under suitable conditions.
This connects probability back to descriptive statistics.
8. Expected value of a function
If:
then:
You do not necessarily need to first construct the full distribution of Y.
9. Example: E[X2]
Suppose:
| x | p(x) |
|---|---|
| 0 | 0.2 |
| 1 | 0.5 |
| 2 | 0.3 |
Then:
Thus:
This quantity is needed for variance.
10. Linearity of expectation
A crucial property:
for constants:
11. Example
If:
and:
then:
12. Expectation of a constant
If:
always, then:
No uncertainty exists.
13. Sum of random variables
Linearity extends to sums:
This does not require independence.
That is an important result.
14. More generally
E[aX+bY+c]=aE[X]+bE[Y]+cAgain, independence is unnecessary for expectation linearity.
15. Example: total score
Suppose:
If:
and:
then:
No independence assumption is required for this statement.
16. Indicator random variables
Recall:
Then:
Therefore:
This is a very useful probability trick.
17. Example
Suppose:
Then:
with probability 0.7 and 0 otherwise.
Therefore:
18. Variance
Expectation describes the center.
But two random variables can have the same expected value and very different spread.
Variance measures dispersion around the mean.
Let:
Then:
19. Why square deviations?
If we tried:
we would always get:
Because positive and negative deviations cancel.
So variance squares deviations:
This makes all contributions nonnegative.
20. Discrete variance formula
For a discrete random variable:
where:
21. Example
Suppose:
| x | p(x) |
|---|---|
| 0 | 0.2 |
| 1 | 0.5 |
| 2 | 0.3 |
We already found:
Then:
22. Compute terms
First:
Second:
Third:
So:
23. Standard deviation
Variance is measured in squared units.
To return to the original units, take square root:
For the previous example:
24. Variance shortcut
The direct variance formula can be tedious.
A very important identity is:
This is often much faster.
25. Derivation
Start:
Expand:
Take expectation:
Since:
we get:
Therefore:
26. Shortcut on previous example
We found:
and:
Thus:
Same answer.
27. Variance is always nonnegative
Because:
its expectation must satisfy:
A negative variance means the calculation is wrong.
28. Zero variance
If:
then X has no spread.
In the ordinary discrete setting:
with probability 1 for some constant c.
So:
29. Variance of a constant
If:
then:
because:
always.
30. Adding a constant
Suppose:
Then:
Adding a constant shifts every value equally but does not change spread.
31. Example
Suppose temperatures all increase by:
The mean increases by 5:
But variance stays the same:
32. Multiplying by a constant
Suppose:
Then:
Variance scales by the square of the multiplier.
33. General transformation
For:
and:
Standard deviation:
34. Why b disappears from variance
Variance measures distance from the mean.
If all values shift by:
the mean also shifts by:
So relative deviations stay exactly the same.
35. Example transformation
Suppose:
and:
Let:
Then:
Variance:
Standard deviation:
36. Expectation vs variance transformation
Memorize the contrast:
but:
The +b disappears from variance.
37. Fair die variance
For a fair die:
Now calculate:
Numerator:
Thus:
38. Die variance
Using shortcut:
Common denominator:
Approximately:
39. Die standard deviation
σ=1235 ≈1.708.40. Expected gain / loss
Expectation is useful for games, insurance, business and decision-making.
Suppose:
- win ₹100 with probability 0.2
- lose ₹20 with probability 0.8
Define payoff:
Then:
Long-run average gain per play:
41. Expected value does not guarantee profit
Even if:
you can still lose on a particular trial.
Expectation describes long-run average, not certainty.
42. Fair game
A game is often called fair if expected net payoff is:
If:
it favors the player.
If:
it favors the other side, assuming X is the player's payoff.
43. Example: find fair entry fee
Suppose a game pays:
- ₹100 with probability 0.1
- ₹0 otherwise
Expected gross payout:
So a fair entry fee is:
After paying ₹10, expected net payoff becomes:
44. Probability distribution completion + expectation
Suppose:
| x | p(x) |
|---|---|
| 0 | k |
| 1 | 2k |
| 2 | 3k |
First normalize:
Thus:
45. Then expectation
E[X]=0(61)+1(62)+2(63). =62+66 =34.46. Then E[X2]
E[X2]=02(61)+12(62)+22(63). =62+612 =37.47. Then variance
Var(X)=E[X2]−[E[X]]2.Thus:
48. Standard deviation
σ=95 =35.This sequence is a standard exam workflow:
textNormalize PMF ↓ Find E[X] ↓ Find E[X²] ↓ Variance = E[X²] - E[X]² ↓ SD = √Variance
49. Variance vs standard deviation
Variance:
has squared units.
If X is measured in:
variance is measured in:
Standard deviation:
returns to:
So standard deviation is often easier to interpret physically.
50. Mean and variance describe different things
Suppose:
RV A
P(X=9)=0.5 P(X=11)=0.5.Mean:
RV B
P(Y=0)=0.5 P(Y=20)=0.5.Mean:
Same expected value.
But Y has vastly greater variability.
51. Compute variance of A
Mean:
Variance:
52. Compute variance of B
(0−10)2(0.5)+(20−10)2(0.5) =100(0.5)+100(0.5) =100.Same center, radically different risk/spread.
53. Variance of sums — general idea
For two random variables:
is not always simply:
Their relationship matters.
The general form involves covariance:
This is useful context, though Week 10's official syllabus specifically emphasizes expectation and variance of discrete RVs.
54. Independent case
If X and Y are independent, then:
Therefore:
for independent random variables.
55. Variance of difference
In general:
If independent:
Notice variance terms still add for an independent difference.
56. Why?
The minus sign gets squared in the variance scaling:
So independent uncertainties add in variance even when variables are subtracted.
57. Bernoulli preview
Suppose:
with:
Then:
Expectation:
58. Bernoulli variance preview
Since:
for X∈{0,1},
Thus:
This becomes extremely important in Week 11.
Common mistake: expected value must be likely
No.
A random variable might have:
while almost never taking a value close to 100.
Expectation is an average, not necessarily the most probable value.
Common mistake: expected value = mode
No.
Expectation
Probability-weighted average.
Mode
Most probable value.
They can be completely different.
Common mistake:
E[X2]=(E[X])2
Usually false.
Indeed:
They are equal only when variance is zero.
So generally:
Common mistake: variance can be negative
No.
If your shortcut gives negative variance, recalculate.
Common mistake: SD = variance
No.
Variance and standard deviation are different quantities.
Common mistake: scaling variance linearly
If:
wrong:
Correct:
because variance uses squared deviations.
Common mistake: adding constants affects variance
If:
mean changes:
Variance does not:
Common mistake: independence needed for expectation addition
No.
Always:
when expectations exist.
Independence becomes relevant for simple variance addition.
Common mistake: probabilities omitted
Expectation is not:
It is:
Every value must be weighted by its probability.
Common mistake: use frequencies instead of probabilities incorrectly
If data are given as frequencies:
| x | frequency |
|---|---|
| 0 | 2 |
| 1 | 5 |
| 2 | 3 |
Total:
Convert frequencies to probabilities:
Then compute expectation.
Equivalent shortcut:
69. Expectation formula sheet
Basic expectation
E[X]=x∑xpX(x)Function of X
E[g(X)]=x∑g(x)pX(x)Linear transformation
E[aX+b]=aE[X]+bSum
E[X+Y]=E[X]+E[Y]70. Variance formula sheet
Definition
Var(X)=E[(X−E[X])2]Shortcut
Var(X)=E[X2]−[E[X]]2Linear transformation
Var(aX+b)=a2Var(X)Standard deviation
SD(X)=Var(X)71. Exam workflow
When given a discrete probability table:
text1. Check probabilities sum to 1 2. Solve unknown constant if needed 3. Compute E[X] = Σxp(x) 4. Compute E[X²] = Σx²p(x) 5. Compute Var(X) = E[X²] - E[X]² 6. Compute SD = √Var(X)
This workflow handles a large fraction of Week 10 problems.
72. Full worked example
Suppose:
Find:
- k
- E[X]
- Var(X)
- standard deviation
73. Normalize
k(1+2+3+4)=1. 10k=1.Therefore:
74. Expectation
E[X]=∑x(kx)=k∑x2.Thus:
75. Compute E[X2]
E[X2]=∑x2(kx)=k∑x3.So:
76. Variance
Var(X)=10−32.Therefore:
77. Standard deviation
SD(X)=1=1.78. Week 9 → Week 10 connection
Week 9 gave:
Week 10 asks:
Can we summarize that distribution with a few useful numbers?
Center:
Spread:
This mirrors Week 3 descriptive statistics:
but now applied to a theoretical random variable rather than just an observed dataset.
79. Statistics vs probability connection
Observed-data mean:
Theoretical probability mean:
Observed-data spread:
Theoretical distribution spread:
The two sides of the course are now connecting.
80. What you should actually master
By the end of Stats 1 Week 10, you should be able to:
- Define expected value.
- Calculate: E[X]=x∑xp(x).
- Interpret expectation as a long-run average.
- Understand that expected value need not be a possible outcome.
- Compute: E[g(X)].
- Use: E[aX+b]=aE[X]+b.
- Use linearity of expectation.
- Define variance.
- Compute variance directly.
- Use: Var(X)=E[X2]−E[X]2.
- Compute standard deviation.
- Know: Var(X)≥0.
- Use: Var(aX+b)=a2Var(X).
- Understand that adding a constant changes mean but not variance.
- Solve a full PMF → expectation → variance → SD question.
If those are comfortable, Stats 1 Week 10 is under control.
Quick Recall & Flashcards
Test your active recall before proceeding to practice problems. Format:
Question :: Answer.- Week 10 Diagnostic: Let X take values 1 and 3 with probabilities 0.4 and 0.6 respectively. What is E[X]? :: Answer: 2.2 — E[X] = 1*(0.4) + 3*(0.6) = 0.4 + 1.8 = 2.2.
- Week 10 Diagnostic: If Var(X) = 4, what is Var(3X + 5)? :: Answer: 36 — Var(aX + b) = a^2 * Var(X). Here a = 3, so Var(3X + 5) = 3^2 * 4 = 9 * 4 = 36.
Practice & Self-Check
Attempt these diagnostic questions to verify your operational understanding.
1
Question 1
Let X take values 1 and 3 with probabilities 0.4 and 0.6 respectively. What is E[X]?
NAT
3 Unit Assessment
2
Question 2
If Var(X) = 4, what is Var(3X + 5)?
NAT
3 Unit Assessment