Skip to content

Read the question, then do the math

Read the instruction before trying to remember a formula. Is it asking for a probability, an average, a whole distribution, or the value of a parameter? Those are different kinds of answers.

Question. Let DUnif{1,2,3,4}D\sim\operatorname{Unif}\{1,2,3,4\} and UD=dUnif[0,d]U\mid D=d\sim\operatorname{Unif}[0,d]. Find E[U]\mathbb E[U] and Pr(U1)\Pr(U\le1).

1. Say what happens in an experiment

First roll a fair four-sided die. Its result is D. Then draw a point uniformly from the interval starting at 0 and ending at that result.

The braces in {1,2,3,4}\{1,2,3,4\} list four separate values. The brackets in [0,d][0,d] describe a continuous interval. The same distribution name is being used for two different sample spaces.

The vertical bar means “given.” A capital D is the die result before it is known; a lowercase d is a particular result.

2. Freeze D and answer the easier questions
die result dinterval for Uaverage Uchance U ≤ 1
1[0,1]1/21
2[0,2]11/2
3[0,3]3/21/3
4[0,4]21/4

The average of a uniform interval is its midpoint. The chance of landing in [0,1] is its length, 1, divided by the whole interval’s length, d.

3. Average the answers across the four cases

Each row occurs with probability 1/41/4:

E[U]=14(12+1+32+2)=54.\mathbb E[U]=\frac14\left(\frac12+1+\frac32+2\right)=\frac54. Pr(U1)=14(1+12+13+14)=2548.\Pr(U\le1)=\frac14\left(1+\frac12+\frac13+\frac14\right)=\frac{25}{48}.

These are applications of the law of total expectation and the law of total probability. Here both laws mean: answer within each group, then weight by how often that group occurs.

A tempting wrong shortcut

The average die result is 2.5. Replacing the random interval with [0,2.5] would give probability 1/2.5=0.41/2.5=0.4, which is wrong.

The required calculation is E[1/D]\mathbb E[1/D], not 1/E[D]1/\mathbb E[D]. Applying a nonlinear operation before averaging generally differs from applying it afterward. In contrast, the conditional mean d/2d/2 is linear, so E[D/2]=E[D]/2\mathbb E[D/2]=\mathbb E[D]/2 works.

Question. A variable X has values 0, 2, and 5 with probabilities 1/21/2, 1/31/3, and 1/61/6. Compute E[(X1)2]\mathbb E[(X-1)^2].

Expand the expectation into a table
x(x−1)²probabilitycontribution
011/21/2
211/31/3
5161/616/6

Add the last column: 1/2+1/3+16/6=7/21/2+1/3+16/6=7/2.

The expression inside the expectation tells you what to calculate for each value. The expectation tells you to average those results using their probabilities. It does not mean square the average of X−1.

Question. Let XUnif[0,1/5]X\sim\operatorname{Unif}[0,1/5]. Find fX(1/10)f_X(1/10) and Pr(0X1/10)\Pr(0\le X\le1/10).

Identify the two requested objects

The density is constant at height 5, because width 1/51/5 times height 5 must equal 1. So fX(1/10)=5f_X(1/10)=5.

The probability is an area: width 1/101/10 times height 5 equals 1/21/2. A density of 5 is legal. A probability of 5 would not be.

Question. You know Var(X)=Var(Y)=1\operatorname{Var}(X)=\operatorname{Var}(Y)=1. Find Var(X+Y)\operatorname{Var}(X+Y).

Check what the question leaves unspecified

The two variances do not tell you how X and Y move together. If Y=XY=X, the sum is 2X2X and its variance is 4. If Y=XY=-X, the sum is always zero and its variance is 0. Both examples satisfy the question.

The general identity is

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).

The answer is not enough information. Independence would make the covariance zero and give 2, but it was not stated. A familiar formula can have a condition that the question does not supply.

  1. Name the experiment in ordinary language.
  2. Identify what is fixed after any conditioning.
  3. Identify what varies and what probabilities weight it.
  4. Check the type of answer: a probability must be between 0 and 1; a density or an expected loss can exceed 1.

Try mixed practice with unfamiliar numbers and no topic heading to tell you the move.

Definition

Read the full glossary entry →