Weeks
Statistics 2Week 2 · Functions of Several Variables and Sums (Part 2 of 2)
Week 2 · Part 2 of 2 · Notes

Statistics for
Data Science 2

Functions of two and of several random variables, contours and regions, sums of Bernoulli trials, then sums, convolution and independent Poissons, with every worked example solved. This is Part 2 of 2 of Week 2; chapter numbers continue from the first note.

19 chapters80 worked examples~52 min read
ContoursRegionsConvolutionPoisson sumsBinomial sums

Chapters

  1. 17Small Cases: The Table MethodFunctions of two variables
  2. 18When Tables Become Too CumbersomeFunctions of two variables
  3. 19Visualizing g(x, y): Contours and RegionsFunctions of two variables
  4. 20Adding Over ContoursFunctions of two variables
  5. 21Try These and Dice ExamplesTry these
  6. 22Functions of two variables: Revision SheetRevision
  7. 23The General Rule and the Sum of Two DiceSeveral variables
  8. 24Area of a Random RectangleSeveral variables
  9. 25Three Variables, Two FunctionsSeveral variables
  10. 26Sums of Bernoulli TrialsSeveral variables
  11. 27Try These: Two Functions of Three BitsTry these
  12. 28Several variables: Revision SheetRevision
  13. 29PMF of a Sum: Summing Along a LineSums and convolution
  14. 30Convolution for Independent VariablesSums and convolution
  15. 31Sum of Two Independent PoissonsSums and convolution
  16. 32Splitting a Poisson TotalSums and convolution
  17. 33A Catalogue of Sum ResultsSums and convolution
  18. 34Try These: Uniforms and Poisson MallsTry these
  19. 35Sums and convolution: Revision SheetRevision
17
Functions of two variables

Small Cases: The Table Method

Sums and maxima of a pair when the table is small.

Previous: Chapters 1 to 16 (independence and functions of one variable) are in Week 2 · Part 1 of 2. References such as "Chapter 9" point to that note.

Sums, maxima and minima of random quantities appear constantly when working with data. This chapter finds their PMFs when the pair (X, Y) takes only a few values, using the table method of Chapter 12.

17.1The method for a pair

The table method for g(X, Y)

If (X,Y)(X, Y) takes only a few values, the table method from one variable still works: list every pair (x,y)(x, y) with its probability fXY(x,y)f_{XY}(x, y) and the value z=g(x,y)z = g(x, y), then group the rows by zz:

P(Z=z)=∑(x,y): g(x,y)=zfXY(x,y)P(Z = z) = \sum_{(x,y):\ g(x,y) = z} f_{XY}(x, y)

17.2Example 2: the maximum

The table method, row by row (each cell is one row of the table; colour = value of z)Example 1: Z = X + YExample 2: Z = max(X, Y)(0,0)1/4z = 0(0,1)1/4z = 1(1,0)1/4z = 1(1,1)1/4z = 2z=01/4z=11/2z=21/4(0,0)16/32z = 0(0,1)8/32z = 1(0,2)4/32z = 2(1,0)2/32z = 1(1,1)1/32z = 1(1,2)1/32z = 2z=016/32z=111/32z=25/32cells with the same colour are added together
Figure 1. Both examples: each cell is one row of the table; the colour is the value of z

17.3Going deeper

  • Independence is not needed (extra). The method only uses the joint PMF. In Example 2 the variables are actually dependent (fX(0)fY(0)=78⋅916=63128≠12f_X(0) f_Y(0) = \tfrac78 \cdot \tfrac9{16} = \tfrac{63}{128} \ne \tfrac12), and the method works just the same. In Example 1 independence was only used to fill in the 14\tfrac14s.
  • Why the sum is not uniform (extra). The value in the middle can be reached from more pairs. The more pairs on a value, the higher its probability. This idea returns with contours.
  • Same as Chapter 12 (extra). This is exactly the one-variable table method with the single column x replaced by the two columns x, y.

17.4Exam tips and common mistakes

Exam tips
  • Write one row per pair, even the zero-probability ones if there are only a few; then colour rows by z.
  • Check that the final probabilities add up to 1.
Common mistakes
  • Assuming the sum of two uniform variables is uniform.
  • Dropping a row of the joint table, so the total is below 1.

Practice questions (graded-assignment style)

Q1P(Z = 1) for the sum

Numerical Answer Type (NAT).

X,YX, Y are i.i.d. Uniform{0,1}\{0,1\} and Z=X+YZ = X + Y. Find P(Z=1)P(Z = 1).

Solution
Idea

Pairs (0,1) and (1,0).

  • 1/4 + 1/4 = 1/2 = 0.5.
  • Answer: 0.5
Q2P(max = 1), numerator

Numerical Answer Type (NAT).

In Example 2, find 32 × P(Z = 1).

Solution
Idea

Pairs (0,1), (1,0), (1,1).

  • 8 + 2 + 1 = 11 (in 32nds).
  • Answer: 11
Q3Is the sum uniform?

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

X, Y are i.i.d. Uniform{0, 1}. The PMF of X + Y over 0, 1, 2 is:

1
1/3, 1/3, 1/3
2
1/4, 1/2, 1/4
3
1/2, 0, 1/2
4
1/4, 1/4, 1/2
Solution
Idea

Count pairs for each sum.

  • One pair gives 0, two pairs give 1, one pair gives 2.
  • Answer: option 2.
Q4Table method facts

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

Choose the correct statements about the table method for Z = g(X, Y).

1
It needs one row per pair (x, y)
2
It needs X and Y to be independent
3
Rows with the same z are added
4
The final probabilities must add up to 1
Solution
Idea

Only the joint PMF is needed.

  • Independence is not required; Example 2 has dependent X, Y.
  • Answer: options 1, 3 and 4.
Next · Functions of two variablesWhen Tables Become Too Cumbersome
18
Functions of two variables

When Tables Become Too Cumbersome

Rows grow as the product of the numbers of values.

The table has one row per pair (x, y). This chapter shows how quickly that becomes unmanageable, and why a picture is needed.

18.1How many rows?

SituationValues of XValues of YRows
Two fair bits224
Example 2236
A pair of dice6636
Two values from 1 to 10010010010,000

Throwing a pair of dice already gives 6 × 6 = 36 rows for the sum, max or min: tedious and error-prone. Two variables each taking values 1 to 100 give 100 × 100 = 10⁴ rows, and the table method is hopeless. We need a picture instead.

The rule

Rows = (number of values of X) × (number of values of Y). The table method is fine for a handful of rows and not beyond.

18.2Going deeper

  • It gets worse with more variables (extra). Three dice give 6 × 6 × 6 = 216 rows. Chapter 23 handles functions of several variables, where tables are even less practical.
  • The next idea (extra). Instead of writing every pair, look at the shape of the set of pairs with the same value of z, and count its points. That set is a contour.

18.3Exam tips and common mistakes

Exam tips
  • Estimate the number of rows before starting: if it is more than about 10, switch to contours.
Common mistakes
  • Adding the numbers of values instead of multiplying them to count rows.

Practice questions (graded-assignment style)

Q1Rows for two dice

Numerical Answer Type (NAT).

How many rows does the table method need for a function of the numbers on two dice?

Solution
Idea

6 times 6.

  • 6 × 6 = 36.
  • Answer: 36
Q2Rows for 1..100

Numerical Answer Type (NAT).

X and Y each take the values 1, 2, ..., 100. How many rows does the table have?

Solution
Idea

100 times 100.

  • 100 × 100 = 10,000.
  • Answer: 10000
Q3Rows for three dice

Numerical Answer Type (NAT).

How many rows would a table for three dice need?

Solution
Idea

6 × 6 × 6.

  • 6³ = 216.
  • Answer: 216
Q4Why contours?

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

Why do we move from tables to contours and regions?

1
Tables are wrong
2
The number of rows is (values of X) × (values of Y), which explodes
3
Contours need no probabilities
4
Tables only work for dice
Solution
Idea

Think about 10,000 rows.

  • The table method is correct but impractical for large cases.
  • Answer: option 2.
Next · Functions of two variablesVisualizing g(x, y): Contours and Regions
19
Functions of two variables

Visualizing g(x, y): Contours and Regions

Two flat pictures that replace the 3D surface.

A function g(x,y)g(x, y) of two variables could be drawn as a 3D surface, with height g(x,y)g(x,y) above each point (x,y)(x, y). Computers can draw that, but it rarely helps with solving problems. Two flat pictures are far more useful.

19.1Contours and regions

ContoursAll (x,y)(x, y) with g(x,y)=cg(x, y) = c, drawn for several values of cc.
RegionsAll (x,y)(x, y) with g(x,y)≤cg(x, y) \le c, drawn for several values of cc.

19.2The sum function g(x, y) = x + y

The contour x+y=cx + y = c is the straight line y=c−xy = c - x. Every contour has slope −1-1; changing cc slides the line parallel to itself. The region x+y≤cx + y \le c is everything on or below that line, so the regions are nested half-planes that grow as cc increases.

Contours and regions of g(x, y) = x + y on the grid 1..6 x 1..6contours x + y = c: parallel linesregions x + y <= c: nested112233445566amber: the contour x + y = 7 (6 points)112233445566green: x + y <= 4; blue: added up to 7
Figure 2. Left: contours of x + y are parallel lines of slope −1. Right: the regions x + y ≤ c are nested

19.3Every function has its own shape

Function gContour g = c
x+yx + ystraight lines of slope −1
x−yx - ystraight lines of slope +1
max⁡(x,y)\max(x, y)L-shaped corners
min⁡(x,y)\min(x, y)L-shaped corners
Each function has its own contour shapex + y = 6slope -1 linex - y = 1slope +1 linemax(x, y) = 3L-shape (top-right)min(x, y) = 3L-shape (bottom-left)
Figure 3. The four contour shapes

Once you know the shape, you can see which (x, y) pairs to add without listing all of them.

19.4Counting the points on a contour

Example 28Difference of two dice (extra)

Two fair dice give (X,Y)(X, Y), each of the 36 pairs with probability 136\tfrac1{36}. Use the contours of x−yx - y to find P(X−Y=d)P(X - Y = d).

Solution
  1. The contour x−y=dx - y = d is the line y=x−dy = x - d, of slope +1+1, inside the 6×66 \times 6 grid.
  2. For d=0d = 0 it is the main diagonal: 6 points. Each step away from it loses one point: d=±1d = \pm1 has 5 points, d=±2d = \pm 2 has 4, and so on down to d=±5d = \pm5 with 1 point.
  3. So P(X−Y=d)=6−∣d∣36P(X - Y = d) = \dfrac{6 - |d|}{36} for d=−5,…,5d = -5, \dots, 5.
  4. Check: 6+2(5+4+3+2+1)=366 + 2(5 + 4 + 3 + 2 + 1) = 36.

19.5Going deeper

  • L-shapes, precisely (extra). The contour max⁡(x,y)=c\max(x, y) = c is the top edge {(1,c),…,(c,c)}\{(1,c), \dots, (c,c)\} together with the right edge {(c,1),…,(c,c)}\{(c,1), \dots, (c,c)\} of the c×cc \times c square, so its corner is at (c,c)(c, c) and it points left and down. For min⁡(x,y)=c\min(x, y) = c the corner is also (c,c)(c,c), but the two arms point right and up.
  • Regions versus contours (extra). A region is a union of contours: {g ≤ c} contains the contours for every value of g up to c.

19.6Exam tips and common mistakes

Exam tips
  • Sketch the grid of (x, y) points, draw the contour for the value you need, and count its points.
Common mistakes
  • Using slope +1 for x + y. It is −1; slope +1 belongs to x − y.
  • Drawing a contour outside the grid: only the points that exist count.

Practice questions (graded-assignment style)

Q1Slope of the sum contour

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

The contour x+y=cx + y = c is a straight line of slope:

1
+1
2
−1
3
0
4
2
Solution
Idea

Solve for yy.

  • y=c−xy = c - x has slope −1-1.
  • Answer: option 2.
Q2Shape of the maximum contour

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

The contour max⁡(x,y)=c\max(x, y) = c looks like:

1
A straight line of slope −1
2
A straight line of slope +1
3
An L-shaped corner
4
A circle
Solution
Idea

One coordinate equals c and the other is at most c.

  • That is the top edge together with the right edge of a square: an L.
  • Answer: option 3.
Q3Points on x + y = 7

Numerical Answer Type (NAT).

How many points (x, y) in {1, ..., 6}² lie on the contour x + y = 7?

Solution
Idea

List them: (1,6), (2,5), ...

  • (1,6), (2,5), (3,4), (4,3), (5,2), (6,1): six points.
  • Answer: 6
Q4Points with difference 2

Numerical Answer Type (NAT).

How many points (x, y) in {1, ..., 6}² have x − y = 2?

Solution
Idea

x = y + 2, y = 1..4.

  • (3,1), (4,2), (5,3), (6,4): four points, so P(X − Y = 2) = 4/36.
  • Answer: 4
Q5Contour shapes

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

Choose the correct statements.

1
x + y contours are lines of slope −1
2
x − y contours are lines of slope +1
3
min(x, y) contours are L-shapes
4
Regions x + y ≤ c are nested
Solution
Idea

Recall the four shapes.

  • All four statements are true.
  • Answer: options 1, 2, 3 and 4.
Next · Functions of two variablesAdding Over Contours
20
Functions of two variables

Adding Over Contours

Find the PMF of g(X, Y) by adding the joint PMF over contours, and the CDF over regions.

Suppose (X,Y)(X, Y) has joint PMF fXYf_{XY} and Z=g(X,Y)Z = g(X, Y). Here is the contour method for finding the PMF of ZZ.

20.1The two steps

Adding over contours
  1. Step I. Find the range of ZZ.
  2. Step II. For each possible value zz, add fXYf_{XY} over the contour g(x,y)=zg(x, y) = z:
P(Z=z)=∑(x,y): g(x,y)=zfXY(x,y)P(Z = z) = \sum_{(x,y):\ g(x,y) = z} f_{XY}(x, y)

20.2Regions give the cumulative version

P(Z≤c)=∑(x,y): g(x,y)≤cfXY(x,y)P(Z \le c) = \sum_{(x,y):\ g(x,y) \le c} f_{XY}(x, y)

For integer-valued ZZ you can recover the PMF: P(Z=c)=P(Z≤c)−P(Z≤c−1)P(Z = c) = P(Z \le c) - P(Z \le c - 1). Sometimes the region is easier to count than the contour.

Remember. Contour = "exactly c", region = "at most c". The contour gives the PMF directly; the region gives the cumulative probability, and the PMF is the difference of two neighbouring regions.
Example 29PMF back from regions (extra)

For two fair dice and S=X+YS = X + Y, find P(S≤4)P(S \le 4) from a region and then P(S=4)P(S = 4).

Solution
  1. The region x+y≤4x + y \le 4 in the 6×66 \times 6 grid has 1+2+3=61 + 2 + 3 = 6 points: the contours x+y=2,3,4x + y = 2, 3, 4 hold 1, 2 and 3 points.
  2. So P(S≤4)=636=16P(S \le 4) = \tfrac6{36} = \tfrac16.
  3. The region x+y≤3x + y \le 3 has 3 points, so P(S≤3)=336P(S \le 3) = \tfrac3{36}.
  4. P(S=4)=636−336=336P(S = 4) = \tfrac6{36} - \tfrac3{36} = \tfrac3{36}, which equals the 3 points of the contour x+y=4x + y = 4. ✓
Points on each contour x + y = s for two dice (out of 36)1223344556675849310211112the middle value 7 has the most points: 6
Figure 4. Points on each contour x + y = s for two dice

20.3Going deeper

  • When all points have the same weight (extra). If the joint PMF is uniform (like two fair dice), every point weighs 1/36, so the PMF is just (number of points on the contour) ÷ 36. With unequal weights, add the actual probabilities, as in Example 2.
  • Upper tails (extra). Use a region on the other side: P(Z ≥ c) = 1 − P(Z ≤ c − 1).
  • Complement check (extra). Adding the probabilities of a region and of the rest of the grid must give 1.

20.4Exam tips and common mistakes

Exam tips
  • Use the region when the question asks for "at most" or when the contour is awkward to count; use the contour for an exact value.
Common mistakes
  • Using the contour when the question asks for a cumulative probability, or the other way round.
  • Forgetting to subtract the previous region when recovering the PMF.

Practice questions (graded-assignment style)

Q1Region count

Numerical Answer Type (NAT).

For two fair dice, how many points does the region x+y≤4x + y \le 4 contain?

Solution
Idea

1 + 2 + 3.

  • The contours x + y = 2, 3, 4 hold 1, 2, 3 points.
  • Answer: 6
Q2PMF from regions

Numerical Answer Type (NAT).

Given P(S≤4)=636P(S \le 4) = \tfrac6{36} and P(S≤3)=336P(S \le 3) = \tfrac3{36}, find 36×P(S=4)36 \times P(S = 4).

Solution
Idea

Subtract the two regions.

  • 6 − 3 = 3.
  • Answer: 3
Q3Which formula?

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

For integer-valued ZZ, P(Z=c)P(Z = c) equals:

1
P(Z≤c)+P(Z≤c−1)P(Z \le c) + P(Z \le c-1)
2
P(Z≤c)−P(Z≤c−1)P(Z \le c) - P(Z \le c-1)
3
P(Z≤c)⋅P(Z≤c−1)P(Z \le c) \cdot P(Z \le c-1)
4
1−P(Z≤c)1 - P(Z \le c)
Solution
Idea

Difference of two neighbouring regions.

  • The region up to c minus the region up to c − 1 leaves exactly the contour at c.
  • Answer: option 2.
Q4Upper tail

Numerical Answer Type (NAT).

For two fair dice and S = X + Y, find 36 × P(S ≥ 10).

Solution
Idea

Contours 10, 11, 12 have 3, 2, 1 points.

  • 3 + 2 + 1 = 6, equal to the region x + y ≤ 4 by symmetry.
  • Answer: 6
Next · Try theseTry These and Dice Examples
21
Try these

Try These and Dice Examples

The two lecture questions solved step by step, plus the sum and minimum of two dice.

The two "Try these" questions of the lecture, worked step by step, followed by two extra dice examples that use the same ideas.

21.1Try these Q1: the maximum of two dice

Example 30Try these Q1: P(max = c) and P(max ≤ 3)

A fair die is thrown twice; let X,YX, Y be the two numbers and Z=max⁡(X,Y)Z = \max(X, Y). Using contours, find the PMF of ZZ. Then use a region to find P(Z≤3)P(Z \le 3) directly.

Solution
  1. Joint PMF. The throws are independent and fair, so fXY(x,y)=136f_{XY}(x,y) = \tfrac1{36} for every (x,y)∈{1,…,6}2(x,y) \in \{1,\dots,6\}^2. Every point has the same weight, so P(Z=c)P(Z = c) is just (number of points on the contour) ÷36\div 36.
  2. Range. Z∈{1,2,3,4,5,6}Z \in \{1, 2, 3, 4, 5, 6\}.
  3. Shape of the contour max⁡(x,y)=c\max(x,y) = c. The larger coordinate equals cc, the other is at most cc: the top edge {(1,c),…,(c,c)}\{(1,c),\dots,(c,c)\} together with the right edge {(c,1),…,(c,c)}\{(c,1),\dots,(c,c)\} of the c×cc \times c square, an L-shape.
  4. Count the points on each L. Each edge has cc points and they share the corner (c,c)(c,c): #{max⁡(x,y)=c}=c+c−1=2c−1\#\{\max(x,y) = c\} = c + c - 1 = 2c - 1.
  5. The PMF. P(Z=c)=2c−136P(Z = c) = \dfrac{2c - 1}{36}. Check: 1+3+5+7+9+11=361 + 3 + 5 + 7 + 9 + 11 = 36. ✓
  6. Region for P(Z≤3)P(Z \le 3). max⁡(x,y)≤3\max(x,y) \le 3 means both x≤3x \le 3 and y≤3y \le 3: the 3×33 \times 3 square in the corner, with 9 points. So P(Z≤3)=936=14P(Z \le 3) = \tfrac9{36} = \tfrac14.
  7. It matches the contours: 1+3+536=936\tfrac{1 + 3 + 5}{36} = \tfrac9{36}. ✓ In general the region is a c×cc \times c square, so P(Z≤c)=c236P(Z \le c) = \tfrac{c^2}{36}, and P(Z=c)=c2−(c−1)236=2c−136P(Z = c) = \tfrac{c^2 - (c-1)^2}{36} = \tfrac{2c-1}{36}, the same formula a second way.
  8. Answer: P(Z = c) = (2c − 1)/36 for c = 1, ..., 6; P(Z ≤ 3) = 1/4.
zz123456
P(Z=z)P(Z=z)1/363/365/367/369/3611/36
Each point of the 6 x 6 grid labelled with max(x, y)xy123456223456333456444456555556666666112233445566max = 11 points= 1/36max = 23 points= 3/36max = 35 points= 5/36max = 47 points= 7/36max = 59 points= 9/36max = 611 points= 11/36region max(x, y) <= 33 x 3 square = 9 points = 1/4
Figure 5. The L-shaped contours of the maximum of two dice, and the 3 × 3 region

21.2Try these Q2: the sum from the joint PMF of Example 2

Example 31Try these Q2: P(W = w) and P(X + Y ≤ 1)

Using the joint PMF of Example 2, find the PMF of W=X+YW = X + Y and the probability P(X+Y≤1)P(X + Y \le 1).

Solution
X\YX\backslash Y012
01/21/41/8
11/161/321/32
  1. Rewrite over 32 to make adding easy: f(0,0)=1632f(0,0) = \tfrac{16}{32}, f(0,1)=832f(0,1) = \tfrac8{32}, f(0,2)=432f(0,2) = \tfrac4{32}, f(1,0)=232f(1,0) = \tfrac2{32}, f(1,1)=132f(1,1) = \tfrac1{32}, f(1,2)=132f(1,2) = \tfrac1{32}.
  2. Range. x∈{0,1}x \in \{0,1\}, y∈{0,1,2}y \in \{0,1,2\}, so W∈{0,1,2,3}W \in \{0,1,2,3\}.
  3. Points on each contour x+y=wx + y = w (the anti-diagonals of the table): w=0w=0: (0,0)(0,0), 1632\tfrac{16}{32}. w=1w=1: (0,1),(1,0)(0,1), (1,0), 8+232=1032\tfrac{8+2}{32} = \tfrac{10}{32}. w=2w=2: (0,2),(1,1)(0,2), (1,1), 4+132=532\tfrac{4+1}{32} = \tfrac5{32}. w=3w=3: (1,2)(1,2), 132\tfrac1{32}.
  4. Check. 16+10+5+1=3216 + 10 + 5 + 1 = 32. ✓
  5. Region x+y≤1x + y \le 1. It contains the contours w=0w = 0 and w=1w = 1: the points (0,0),(0,1),(1,0)(0,0), (0,1), (1,0). P(X+Y≤1)=16+8+232=2632=1316P(X + Y \le 1) = \tfrac{16 + 8 + 2}{32} = \tfrac{26}{32} = \tfrac{13}{16}.
  6. Complement check. The rest of the grid is (0,2),(1,1),(1,2)(0,2), (1,1), (1,2) with total 4+1+132=632\tfrac{4+1+1}{32} = \tfrac6{32}, and 2632+632=1\tfrac{26}{32} + \tfrac6{32} = 1. ✓
  7. Answer: P(W = 0, 1, 2, 3) = 16/32, 10/32, 5/32, 1/32; P(X + Y ≤ 1) = 13/16.

21.3Two more dice examples (extra)

Example 32The sum of two dice (extra)

For two fair dice find the PMF of S=X+YS = X + Y.

Solution
  1. The contour x+y=sx + y = s is a line of slope −1-1, and the number of grid points on it is 6−∣s−7∣6 - |s - 7| for s=2,…,12s = 2, \dots, 12.
  2. So P(S=s)=6−∣s−7∣36P(S = s) = \dfrac{6 - |s - 7|}{36}: 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1 (over 36).
  3. Check: the sum of the counts is 36. ✓ The most likely sum is 7 (636=16\tfrac6{36} = \tfrac16).
Example 33The minimum of two dice (extra)

For two fair dice find the PMF of M=min⁡(X,Y)M = \min(X, Y).

Solution
  1. The contour min⁡(x,y)=c\min(x,y) = c is an L with its corner at (c,c)(c,c) and arms pointing right and up: the points (c,c),(c+1,c),…,(6,c)(c,c), (c+1,c), \dots, (6,c) and (c,c+1),…,(c,6)(c,c+1), \dots, (c,6).
  2. Each arm has 6−c+1=7−c6 - c + 1 = 7 - c points, sharing the corner, so the L has 2(7−c)−1=13−2c2(7-c) - 1 = 13 - 2c points.
  3. P(M=c)=13−2c36P(M = c) = \dfrac{13 - 2c}{36}: 11, 9, 7, 5, 3, 1 (over 36), total 36. ✓
  4. Compare with the maximum, whose counts are 1, 3, 5, 7, 9, 11: the minimum is the mirror image.

21.4Going deeper

  • Min and max are linked (extra). For two numbers, min(x, y) + max(x, y) = x + y, so the sums of the two dice split the same 36 points in different ways.
  • Next (extra). The later chapters build on this: functions of several variables, sums and convolution, and the minimum and maximum in general.

21.5Exam tips and common mistakes

Exam tips
  • For max, think "both at most c" (a square). For min, think "both at least c".
  • Always finish with the "add to 1" check, e.g. 1 + 3 + 5 + 7 + 9 + 11 = 36.
Common mistakes
  • Counting the corner (c, c) twice, giving 2c instead of 2c − 1.
  • Forgetting that the table in Q2 is arranged with rows X and columns Y when finding the anti-diagonals.

Practice questions (graded-assignment style)

Q1P(max = 4)

Numerical Answer Type (NAT).

For two fair dice, find 36 × P(max(X, Y) = 4).

Solution
Idea

2c − 1 with c = 4.

  • The L has 2·4 − 1 = 7 points.
  • Answer: 7
Q2P(max ≤ 5)

Numerical Answer Type (NAT).

For two fair dice, find 36 × P(max(X, Y) ≤ 5).

Solution
Idea

A 5 × 5 square.

  • The region is a 5 × 5 square: 25 points.
  • Answer: 25
Q3W = 3 in Q2

Numerical Answer Type (NAT).

In Try these Q2, find 32 × P(W = 3).

Solution
Idea

Only the pair (1, 2).

  • Only (1,2) has x + y = 3, with probability 1/32.
  • Answer: 1
Q4P(X + Y ≤ 1) in Q2

Numerical Answer Type (NAT).

In Try these Q2, find P(X + Y ≤ 1) as a decimal.

Solution
Idea

26/32.

  • 26/32 = 13/16 = 0.8125.
  • Answer: 0.8125
Q5Minimum of two dice

Numerical Answer Type (NAT).

For two fair dice, find 36 × P(min(X, Y) = 2).

Solution
Idea

13 − 2c with c = 2.

  • 13 − 4 = 9 points.
  • Answer: 9
Q6Most likely sum

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

For two fair dice, the most likely value of X + Y is:

1
6
2
7
3
8
4
12
Solution
Idea

Which contour has the most points?

  • The contour x + y = 7 has 6 points, the most.
  • Answer: option 2.
Next · RevisionFunctions of two variables: Revision Sheet
22
Revision

Functions of two variables: Revision Sheet

One page to revise everything in this section.

The big picture

Table method
  • One row per pair (x,y)(x,y): probability and g(x,y)g(x,y); group rows by value.
  • Sum of two Uniform{0,1}: 1/4, 1/2, 1/4. Max in Example 2: 1/2, 11/32, 5/32.
Why it breaks
  • Rows = (values of X) × (values of Y).
  • 6 × 6 = 36 for dice; 100 × 100 = 10⁴.
Contours and regions
  • Contour: g(x,y)=cg(x,y) = c. Region: g(x,y)≤cg(x,y) \le c.
  • x+yx+y: slope −1-1; x−yx-y: slope +1+1; max, min: L-shapes.
Adding over contours
  • P(Z=z)=∑g(x,y)=zfXY(x,y)P(Z=z) = \sum_{g(x,y)=z} f_{XY}(x,y).
  • P(Z≤c)P(Z \le c) from a region; P(Z=c)=P(Z≤c)−P(Z≤c−1)P(Z=c) = P(Z \le c) - P(Z \le c-1).
Try these
  • Q1: max of two dice, P(Z = c) = (2c − 1)/36, P(Z ≤ 3) = 1/4.
  • Q2: P(W = 0..3) = 16, 10, 5, 1 (over 32); P(X + Y ≤ 1) = 13/16.

Revision sheet

IdeaKey point
Table methodOne row per (x,y)(x,y): probability and g(x,y)g(x,y); group by value
LimitationRows grow as (values of XX) × (values of YY)
Contour{(x,y):g(x,y)=c}\{(x,y) : g(x,y) = c\}
Region{(x,y):g(x,y)≤c}\{(x,y) : g(x,y) \le c\}
PMF of ZP(Z=z)=∑g(x,y)=zfXY(x,y)P(Z=z) = \sum_{g(x,y)=z} f_{XY}(x,y)
CDF of ZP(Z≤c)=∑g(x,y)≤cfXY(x,y)P(Z \le c) = \sum_{g(x,y)\le c} f_{XY}(x,y)
Contour shapesx+yx+y: lines of slope −1-1; max / min: L-shapes
Revision overview
Small casesList every pair
Group rows by z
Add probabilities
Too big36 rows for dice
10,000 for 1 to 100
Need a picture
PictureContours: g = c
Regions: g ≤ c
Flat, not 3D
Functions of two variablesWeek 2
Contour sumsAdd f over g = z
Count points
Uniform: points ÷ 36
RegionsCumulative P(Z ≤ c)
PMF = difference
Max ≤ c: c × c square
Shapesx + y: slope −1
x − y: slope +1
max, min: L-shapes
Revision: functions of two random variables in one view

Common mistakes

Assuming the sum is uniform
  • Two uniform variables give a sum with more pairs on the middle values.
Counting the corner twice
  • The L for max = c has 2c − 1 points, not 2c.
Wrong slope
  • x + y has slope −1; slope +1 is x − y.
Contour versus region
  • Contour is "exactly c", region is "at most c". Subtract neighbouring regions to get a PMF.
Dropping a row
  • Every pair must appear exactly once, so the final PMF adds up to 1.
Using independence by habit
  • The table and contour methods need only the joint PMF. Use 1/36-type weights only when the pairs are equally likely.
Next · Several variablesThe General Rule and the Sum of Two Dice
23
Several variables

The General Rule and the Sum of Two Dice

The PMF of g(X1, ..., Xn) in two steps, and the sum of two dice.

Chapters 11 to 22 handled one and two variables. This chapter gives the general rule for g(X1,…,Xn)g(X_1, \dots, X_n) with any number of variables, and then works through dice, a random rectangle and a three-variable table.

23.1The general rule

PMF of a function of several variables

Let X1,…,XnX_1, \dots, X_n have joint PMF fX1⋯Xnf_{X_1\cdots X_n}, with TXiT_{X_i} the range of XiX_i. Let g:TX1×⋯×TXn→Rg : T_{X_1} \times \cdots \times T_{X_n} \to \mathbb{R} have range TgT_g. The PMF of X=g(X1,…,Xn)X = g(X_1, \dots, X_n) is

fX(t)=P(g(X1,…,Xn)=t)=∑(t1,…,tn): g(t1,…,tn)=tfX1⋯Xn(t1,…,tn),t∈Tgf_X(t) = P\big(g(X_1,\dots,X_n) = t\big) = \sum_{(t_1,\dots,t_n):\ g(t_1,\dots,t_n) = t} f_{X_1\cdots X_n}(t_1,\dots,t_n), \qquad t \in T_g
The same two steps as before

(I) find the range of gg; (II) for each value tt, add the joint PMF over all points where gg equals tt (the contour g=tg = t). For one variable this is Chapter 12, for two variables Chapter 20; only the number of coordinates has grown.

23.2Example 1: the sum of two dice

The contour x1 + x2 = 6 on the 6 x 6 grid112233445566x1x2(1, 5)(2, 4)(3, 3)(4, 2)(5, 1)the five points5 of 36 equally likely pairsP(S = 6) = 5/36
Figure 6. Each anti-diagonal x₁ + x₂ = s is one contour; counting its points gives the triangular PMF of S

23.3Going deeper

  • Nothing new for n = 2 (extra). The general rule is exactly the Chapter 20 formula with the points written as tuples. What changes with more variables is only how hard it is to draw the contour.
  • Why a table is still safe (extra). Listing the rows works for any n; it only becomes long. The "add one column per function" idea of Chapter 25 keeps it organised.

23.4Exam tips and common mistakes

Exam tips
  • Say it in two lines: range first, then "add the joint PMF over g = t".
  • Check by adding all the PMF values: they must total 1.
Common mistakes
  • Writing the range of S as 1 to 12; the smallest sum is 2.
  • Forgetting that the 36 pairs are ordered, so (1,5) and (5,1) both count.

Practice questions (graded-assignment style)

Q1P(S = 6) numerator

Numerical Answer Type (NAT).

For two fair dice find 36 × P(X₁ + X₂ = 6).

Solution
Idea

Count the anti-diagonal.

  • (1,5), (2,4), (3,3), (4,2), (5,1): five points.
  • Answer: 5
Q2P(S = 9) numerator

Numerical Answer Type (NAT).

For two fair dice find 36 × P(S = 9).

Solution
Idea

6 − |s − 7| with s = 9.

  • 6 − |9 − 7| = 4: (3,6), (4,5), (5,4), (6,3).
  • Answer: 4
Q3Range of S

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

The range of S = X₁ + X₂ for two dice is:

1
{1, ..., 12}
2
{2, ..., 12}
3
{2, ..., 11}
4
{0, ..., 12}
Solution
Idea

Smallest and largest sums.

  • The smallest sum is 1 + 1 = 2 and the largest is 6 + 6 = 12.
  • Answer: option 2.
Q4The general rule

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

Choose the correct statements.

1
f_X(t) adds the joint PMF over points with g = t
2
The range of g must be found first
3
The PMF of S has its peak at s = 7
4
The rule needs the variables to be independent
Solution
Idea

Only the joint PMF is needed.

  • Independence is not required; it only helps to fill in the joint PMF.
  • Answer: options 1, 2 and 3.
Next · Several variablesArea of a Random Rectangle
24
Several variables

Area of a Random Rectangle

When the second variable is given the first, build the joint PMF first.

Here the second variable is described given the first. The joint PMF must be built before the function is applied.

24.1Example 2: the area of a random rectangle

The lesson

When the second variable is described given the first, build the joint PMF with f_XY = f_X · f_Y|X first. Only then apply the function.

24.2Going deeper

  • The two variables are dependent (extra). The breadth\'s range moves with ll, so fLBf_{LB} is not a product. For example B=2B = 2 is possible only when L=5L = 5: fLB(7,2)=0f_{LB}(7, 2) = 0 but fL(7)fB(2)>0f_L(7) f_B(2) > 0.
  • Probabilities from the uniform answer (extra). Because the 12 areas are uniform, P(LB>50)=612=12P(LB > 50) = \tfrac6{12} = \tfrac12 (the areas 54, 63, 72, 88, 99, 110) and P(LB≥60)=512P(LB \ge 60) = \tfrac5{12}.
  • A trap (extra). Here every area happened to be different. In general, rows with the same product must be added, exactly as in the table method.

24.3Exam tips and common mistakes

Exam tips
  • Write "given" statements as f_Y|X and multiply by f_X straight away.
  • Check the count of pairs: 4 values of L times 3 values of B for each L = 12 pairs.
Common mistakes
  • Treating L and B as independent and using the same B-range for every L.
  • Dividing by 4 × 4 instead of 4 × 3.

Practice questions (graded-assignment style)

Q1Joint value

Numerical Answer Type (NAT).

In Example 2 what is 12×fLB(9,7)12 \times f_{LB}(9, 7)?

Solution
Idea

Every allowed pair has probability 1/12.

  • The pair (9, 7) is allowed (7 is one of 8, 7, 6), so f = 1/12.
  • Answer: 1
Q2An area

Numerical Answer Type (NAT).

In Example 2, what is the area for L = 9, B = 6?

Solution
Idea

9 × 6.

  • 9 × 6 = 54.
  • Answer: 54
Q3Large areas

Numerical Answer Type (NAT).

In Example 2, find 12 × P(LB > 50).

Solution
Idea

Count areas above 50.

  • 54, 63, 72, 88, 99, 110: six areas.
  • Answer: 6
Q4Which is the joint PMF?

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

Given L uniform on four values and B uniform on three values for each L, f_LB(l, b) is:

1
1/4
2
1/3
3
1/12
4
1/7
Solution
Idea

Multiply f_L and f_B|L.

  • 1/4 × 1/3 = 1/12.
  • Answer: option 3.
Next · Several variablesThree Variables, Two Functions
25
Several variables

Three Variables, Two Functions

One table gives both PMFs and their joint PMF.

Sometimes we need the PMF of two functions of the same variables and their joint PMF. One table does everything: add a column for each function.

25.1Example 3: three variables, two functions

Nine rows, two functions: g = t1 + t2 + t3 and h = t2 t3(0,0,0)g=0h=0joint PMF of (X, Y): count rows by (g, h)gh012301/92/92/91/91001/91/920001/9(0,0,1)g=1h=0(0,0,2)g=2h=0(0,1,1)g=2h=1(0,1,2)g=3h=2(1,0,0)g=1h=0(1,0,2)g=3h=0(1,1,0)g=2h=0(1,1,1)g=3h=1column sums give the PMF of Xrow sums give the PMF of Yf(0,1) = 0 but fX(0) fY(1) = 2/81: dependent
Figure 8. One table gives the PMF of X, the PMF of Y and their joint PMF

25.2Going deeper

  • The joint PMF contains the marginals (extra). Column sums give the PMF of XX, row sums the PMF of YY. Computing the joint first is never wasted work.
  • Many cells are zero (extra). Only 7 of the 12 cells of the 4×34 \times 3 grid are non-zero, because the nine rows land on only 7 distinct (g,h)(g, h) pairs. The 2 in a cell means two rows landed there.
  • Same recipe for any number of functions (extra). Two columns give a joint table; three functions would give a three-way table.

25.3Exam tips and common mistakes

Exam tips
  • Build the full table of rows first, with one column per function, then read all three answers from it.
  • Use row and column sums to verify the marginals.
Common mistakes
  • Writing the joint PMF of (X, Y) as the product of the PMFs of X and Y without checking.
  • Counting rows by g only when the question asks for the pair (g, h).

Practice questions (graded-assignment style)

Q1P(X = 3)

Numerical Answer Type (NAT).

In Example 3 find 9 × P(X = 3).

Solution
Idea

Rows with g = 3.

  • The rows (0,1,2), (1,0,2), (1,1,1) have g = 3: three rows.
  • Answer: 3
Q2P(Y = 0)

Numerical Answer Type (NAT).

In Example 3 find 9 × P(Y = 0).

Solution
Idea

Rows with h = 0.

  • Six rows have t₂t₃ = 0.
  • Answer: 6
Q3f_XY(2, 0)

Numerical Answer Type (NAT).

In Example 3 find 9 × f_XY(2, 0).

Solution
Idea

Rows with g = 2 and h = 0.

  • The rows (0,0,2) and (1,1,0).
  • Answer: 2
Q4Independent?

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

In Example 3 are X and Y independent?

1
Yes
2
No, because f_XY(0,1) = 0 but f_X(0) f_Y(1) > 0
3
No, because f_Y is not uniform
4
Cannot say
Solution
Idea

Use the zero-cell test from Chapter 4.

  • The zero cell has non-zero row and column totals.
  • Answer: option 2.
Next · Several variablesSums of Bernoulli Trials
26
Several variables

Sums of Bernoulli Trials

Independent Bernoulli trials add up to a binomial.

The most important sum of all: adding independent coin-like trials gives the binomial distribution.

26.1The result

Sum of i.i.d. BernoulliIf X1,…,XnX_1, \dots, X_n are i.i.d. Bernoulli(p)(p), then X1+⋯+Xn∼Binomial(n,p)X_1 + \cdots + X_n \sim \text{Binomial}(n, p).

26.2Why it is true

  1. The sum equals kk exactly when kk of the nn variables are 1 and the rest are 0.
  2. There are (nk)\binom{n}{k} such patterns (choose which kk positions hold the 1s).
  3. By independence each pattern has probability pk(1−p)n−kp^k (1-p)^{n-k}.
  4. So P(X1+⋯+Xn=k)=(nk)pk(1−p)n−kP(X_1 + \cdots + X_n = k) = \binom{n}{k} p^k (1-p)^{n-k}, k=0,1,…,nk = 0, 1, \dots, n.
Three Bernoulli trials: patterns grouped by the number k of ones (q = 1 - p)k = 00001 x p^0q^3C(3,0) = 1k = 11000100013 x p^1q^2C(3,1) = 3k = 21101010113 x p^2q^1C(3,2) = 3k = 31111 x p^3q^0C(3,3) = 1P(sum = k) = C(3, k) p^k q^(3-k): the binomial formula
Figure 9. Three Bernoulli trials: the patterns grouped by the number of ones

26.3Going deeper

  • Independence is essential (extra). Without it the pattern probabilities are not p^k(1−p)^(n−k), and the sum need not be binomial. Even parity from Chapter 8 (three fair bits that are not independent) has sum 0 or 2 only.
  • Identical is essential too (extra). If the trials have different success probabilities the sum is not binomial (it is a "Poisson binomial"), because patterns with the same kk no longer have the same probability.
  • Link to Chapter 11 (extra). Binomial(10, 0.5) from Chapter 11 is the sum of ten fair bits.

26.4Exam tips and common mistakes

Exam tips
  • When you see "number of successes in n independent identical trials", write Binomial(n, p) at once.
Common mistakes
  • Forgetting the binomial coefficient and using only p^k (1−p)^(n−k).
  • Using Binomial for trials that are not independent.

Practice questions (graded-assignment style)

Q1Count of patterns

Numerical Answer Type (NAT).

Three Bernoulli trials: how many patterns give a sum of 2?

Solution
Idea

Choose which 2 of 3 are ones.

  • C(3,2) = 3: 110, 101, 011.
  • Answer: 3
Q2Binomial value

Numerical Answer Type (NAT).

X₁..X₄ are i.i.d. Bernoulli(1/2). Find 16 × P(sum = 2).

Solution
Idea

C(4,2) / 16.

  • P(sum = 2) = 6/16, so the answer is 6.
  • Answer: 6
Q3Which distribution?

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

The sum of 10 i.i.d. Bernoulli(0.3) variables is:

1
Uniform
2
Binomial(10, 0.3)
3
Binomial(0.3, 10)
4
Bernoulli(3)
Solution
Idea

n trials with success probability p.

  • Binomial(n, p) with n = 10, p = 0.3.
  • Answer: option 2.
Q4Biased binomial

Numerical Answer Type (NAT).

Three independent trials each succeed with probability 0.5. Find 8 × P(sum = 3).

Solution
Idea

Only the pattern 111.

  • P(sum = 3) = (1/2)³ = 1/8.
  • Answer: 1
Next · Try theseTry These: Two Functions of Three Bits
27
Try these

Try These: Two Functions of Three Bits

The two lecture questions solved step by step.

The two "Try these" questions of the lecture, solved step by step.

27.1Try these Q1: two functions of three bits

Example 38Try these Q1: g = X₁X₂ + 2X₃ and h = 2X₁ + X₂

X1,X2,X3X_1, X_2, X_3 each take values in {0,1}\{0, 1\} and their joint distribution is uniform. Define g=X1X2+2X3g = X_1X_2 + 2X_3 and h=2X1+X2h = 2X_1 + X_2. Find the joint distribution of gg and hh.

Solution
  1. Joint PMF of the inputs. There are 23=82^3 = 8 triples, each with probability 18\tfrac18.
  2. Table with both functions. For each row compute g = t₁t₂ + 2t₃ and h = 2t₁ + t₂ (table below).
t1t_1t2t_2t3t_3ffgghh
0001/800
0011/820
0101/801
0111/821
1001/802
1011/822
1101/813
1111/833
  1. Ranges. g∈{0,1,2,3}g \in \{0,1,2,3\} and h∈{0,1,2,3}h \in \{0,1,2,3\}.
  2. Group rows by the pair (g,h)(g,h). All 8 rows give different pairs, so each observed pair gets 18\tfrac18 and every other pair gets 0 (table below).
h\gh\backslash g0123fhf_h
01/801/801/4
11/801/801/4
21/801/801/4
301/801/81/4
fgf_g3/81/83/81/81
  1. Check and interpret. The 8 non-zero cells add to 1. ✓ The marginals: hh is uniform on {0,1,2,3}\{0,1,2,3\} (it is the binary number t1t2t_1t_2), while gg is not uniform.
  2. gg and hh are dependent: f(1,0)=0f(1, 0) = 0 but fg(1)fh(0)=18⋅14=132≠0f_g(1) f_h(0) = \tfrac18 \cdot \tfrac14 = \tfrac1{32} \ne 0. This makes sense: gg can be odd only when t1=t2=1t_1 = t_2 = 1, i.e. h=3h = 3.
  3. Answer: (g, h) takes the 8 values (0,0), (2,0), (0,1), (2,1), (0,2), (2,2), (1,3), (3,3), each with probability 1/8.

27.2Try these Q2: sums of three fair bits

Example 39Try these Q2: X + Y + Z and U = XY + YZ + ZX

X,Y,ZX, Y, Z are independent, each equally likely to be 0 or 1. Find the PMF of (a) X+Y+ZX + Y + Z and (b) U=XY+YZ+ZXU = XY + YZ + ZX.

Solution
  1. Joint PMF. By independence each of the 8 triples has probability 12⋅12⋅12=18\tfrac12 \cdot \tfrac12 \cdot \tfrac12 = \tfrac18.
  2. Both functions depend only on how many 1s there are. Let kk be the number of 1s among X,Y,ZX, Y, Z. Then X+Y+Z=kX + Y + Z = k. UU counts the pairs that are both 1, which is (k2)\binom k2.
kktriplesprobabilityX+Y+ZX+Y+ZU=(k2)U = \binom k2
00001/800
1100, 010, 0013/810
2110, 101, 0113/821
31111/833
  1. (a) Read the kk column: P(X+Y+Z=0,1,2,3)=18,38,38,18P(X+Y+Z = 0, 1, 2, 3) = \tfrac18, \tfrac38, \tfrac38, \tfrac18. This is Binomial(3,12)\text{Binomial}(3, \tfrac12), exactly as the Bernoulli-sum result predicts.
  2. (b) k=0k = 0 and k=1k = 1 both give U=0U = 0, so their probabilities combine: P(U=0)=18+38=12P(U = 0) = \tfrac18 + \tfrac38 = \tfrac12, P(U=1)=38P(U = 1) = \tfrac38, P(U=3)=18P(U = 3) = \tfrac18. The value U=2U = 2 is impossible: two pairs of 1s would force the third pair to be 1s as well.
  3. Spot-check. For (1,1,0)(1,1,0): U=1⋅1+1⋅0+0⋅1=1U = 1\cdot1 + 1\cdot0 + 0\cdot1 = 1. ✓ For (1,1,1)(1,1,1): U=3U = 3. ✓
  4. Answer: (a) 1/8, 3/8, 3/8, 1/8 on {0, 1, 2, 3}; (b) P(U = 0) = 1/2, P(U = 1) = 3/8, P(U = 3) = 1/8.

27.3Going deeper

  • Functions of a count (extra). In Q2 both functions depend on the triple only through kk. Then it is enough to work with the PMF of kk (binomial) and apply the functions to kk: a many-to-one step as in Chapter 14.
  • Q1 reads like a binary code (extra). h = 2t₁ + t₂ is just the number written by the bits t₁t₂, which is why it is uniform on 0 to 3.

27.4Exam tips and common mistakes

Exam tips
  • When functions depend only on a count, group the triples by that count first.
  • For two functions, always list all 8 (or 9) rows with both values before grouping.
Common mistakes
  • Saying U = 2 has probability 3/8: no triple gives U = 2.
  • Reading (g, h) as uniform on 16 cells because both g and h have 4 values.

Practice questions (graded-assignment style)

Q1A cell of the (g, h) table

Numerical Answer Type (NAT).

In Try these Q1, find 8 × f(g = 2, h = 1).

Solution
Idea

Which triple has t₁t₂ + 2t₃ = 2 and 2t₁ + t₂ = 1?

  • The triple (0,1,1) gives g = 0 + 2 = 2 and h = 1: one triple.
  • Answer: 1
Q2P(g = 2)

Numerical Answer Type (NAT).

In Try these Q1, find 8 × P(g = 2).

Solution
Idea

Add the g = 2 column of the joint table.

  • The cells (2,0), (2,1), (2,2) hold 1 each: 3/8.
  • Answer: 3
Q3P(U = 0)

Numerical Answer Type (NAT).

In Try these Q2, find P(U = 0).

Solution
Idea

k = 0 and k = 1.

  • 1/8 + 3/8 = 1/2.
  • Answer: 0.5
Q4Impossible value

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

In Try these Q2 which value of U is impossible?

1
0
2
1
3
2
4
3
Solution
Idea

U = C(k, 2) for k = 0..3.

  • C(k,2) takes the values 0, 0, 1, 3: never 2.
  • Answer: option 3.
Q5Q1 facts

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

Choose the correct statements about (g, h) in Try these Q1.

1
h is uniform on {0,1,2,3}
2
g is uniform on {0,1,2,3}
3
g and h are dependent
4
Exactly 8 cells of the 4 × 4 table are non-zero
Solution
Idea

Read the marginals off the table.

  • g has PMF 3/8, 1/8, 3/8, 1/8, so it is not uniform.
  • Answer: options 1, 3 and 4.
Next · RevisionSeveral variables: Revision Sheet
28
Revision

Several variables: Revision Sheet

One page to revise everything in this section.

The big picture

The general rule
  • fX(t)=∑g(t1,…,tn)=tfX1⋯Xn(t1,…,tn)f_X(t) = \sum_{g(t_1,\dots,t_n)=t} f_{X_1\cdots X_n}(t_1,\dots,t_n).
  • Two steps: range of g, then add the joint PMF over each contour g = t.
Two dice
  • P(S=s)=6−∣s−7∣36P(S = s) = \dfrac{6-|s-7|}{36}, s=2,…,12s = 2,\dots,12.
  • P(S = 6) = 5/36.
Conditional descriptions
  • Build fXY=fXfY∣Xf_{XY} = f_X f_{Y\mid X} first, then apply g.
  • Random rectangle: 12 pairs of 1/12; the 12 areas are all different.
Two functions at once
  • Add one column per function; group rows by the pair of values.
  • Row sums and column sums give the two PMFs back.
Bernoulli sums
  • i.i.d. Bernoulli(p), n of them: sum ∼\sim Binomial(n, p).
  • (nk)\binom nk patterns, each pk(1−p)n−kp^k(1-p)^{n-k}.
Try these
  • Q1: (g, h) takes 8 values, each 1/8; g, h dependent.
  • Q2: X+Y+Z is Binomial(3, 1/2); U is 0, 1, 3 with 1/2, 3/8, 1/8.

Revision sheet

IdeaKey point
General ruleTwo-step recipe: (I) range of gg; (II) add the joint PMF over each contour g=tg = t
Conditional descriptionsBuild fXY=fXfY∣Xf_{XY} = f_X f_{Y\mid X} before applying gg
Two functions at onceAdd one column per function; group by the pair of values
Two dice sumP(S=s)=(6−∣s−7∣)/36P(S=s) = (6 - |s-7|)/36
Bernoulli sumi.i.d. Bernoulli(p)(p), nn of them: sum ∼\sim Binomial(n,p)(n, p)
Revision overview
General ruleRange of g
Add f over g = t
Works for any n
ExamplesTwo dice sum
Random rectangle
Three variables
MethodBuild the joint first
One column per function
Check totals
Many variablesWeek 2
Two functionsGroup by the pair
Row sums = PMF of h
Column sums = PMF of g
Bernoulli sumsn independent trials
C(n, k) patterns
Binomial(n, p)
DependenceFunctions of the same variables
are often dependent
Zero-cell test works
Revision: functions of several random variables in one view

Common mistakes

Skipping the joint PMF
  • Build f_XY = f_X · f_Y|X first when the second variable is given the first.
Counting by one function only
  • For the joint PMF of two functions group by the pair (g, h).
Independence by habit
  • Two functions of the same variables are usually dependent. Test a zero cell.
Binomial without independence
  • The Bernoulli-sum result needs i.i.d. trials.
Impossible values
  • A value of g that no row produces has probability 0 (U = 2 in Q2).
Range slips
  • The smallest sum of two dice is 2, not 1.
Next · Sums and convolutionPMF of a Sum: Summing Along a Line
29
Sums and convolution

PMF of a Sum: Summing Along a Line

The PMF of X + Y by adding the joint PMF along a line.

This chapter finds the PMF of X+YX + Y for integer-valued random variables, gives the convolution formula for independent ones, and proves the classic result that independent Poissons add up to a Poisson.

29.1Summing along a line

PMF of a sum

Let XX and YY take integer values, with joint PMF fXYf_{XY}, and let Z=X+YZ = X + Y. For an integer zz, the contour x+y=zx + y = z is the line of points (x, z−x)(x,\ z - x). Adding the joint PMF along it:

P(Z=z)=∑x=−∞∞P(X=x, Y=z−x)=∑x=−∞∞fXY(x, z−x)=∑y=−∞∞fXY(z−y, y)P(Z = z) = \sum_{x=-\infty}^{\infty} P(X = x,\ Y = z - x) = \sum_{x=-\infty}^{\infty} f_{XY}(x,\ z - x) = \sum_{y=-\infty}^{\infty} f_{XY}(z - y,\ y)
The contour x + y = z is a line of points (x, z - x)00112233xythe four points on the line z = 3(x, z - x) = (0, 3)(x, z - x) = (1, 2)(x, z - x) = (2, 1)(x, z - x) = (3, 0)add the joint PMF along the lineP(Z=3) = f(0,3)+f(1,2)+f(2,1)+f(3,0)
Figure 10. The contour x + y = z is a line; add the joint PMF along it

In practice only finitely many terms are non-zero: just those x for which both x and z − x are possible values.

29.2A dependent example (extra)

Example 40P(X + Y = 1) from a joint table (extra)

Use the joint PMF of Example 27 (Chapter 17, the maximum example) (f(0,0)=12f(0,0) = \tfrac12, f(0,1)=14f(0,1) = \tfrac14, f(0,2)=18f(0,2) = \tfrac18, f(1,0)=116f(1,0) = \tfrac1{16}, f(1,1)=f(1,2)=132f(1,1) = f(1,2) = \tfrac1{32}). Find P(X+Y=1)P(X + Y = 1) using the line formula.

Solution
  1. The points on the line x+y=1x + y = 1 are (0,1)(0, 1) and (1,0)(1, 0).
  2. P(X+Y=1)=f(0,1)+f(1,0)=14+116=516=1032P(X + Y = 1) = f(0,1) + f(1,0) = \tfrac14 + \tfrac1{16} = \tfrac5{16} = \tfrac{10}{32}, matching Example 31 (Chapter 21).
  3. Nothing here needed independence: the formula uses only the joint PMF.

29.3Going deeper

  • Same as Chapters 20 and 23 (extra). This is the contour sum for g(x,y)=x+yg(x,y) = x + y, written with the points of the contour spelled out as (x,z−x)(x, z - x).
  • Two equal forms (extra). Summing over xx or over yy gives the same answer, since each point of the line is counted once either way.
  • Negative values (extra). The sums run from −∞-\infty to ∞\infty because XX and YY may be negative; for non-negative variables they start at 0.

29.4Exam tips and common mistakes

Exam tips
  • List the points (x, z − x) that exist in the table, then add their probabilities.
Common mistakes
  • Including points whose x or z − x is not a possible value (their probability is 0, but listing them wastes time and causes slips).

Practice questions (graded-assignment style)

Q1Points on the line

Numerical Answer Type (NAT).

X and Y take values 0, 1, 2, 3. How many points (x, y) with both values possible lie on x + y = 3?

Solution
Idea

(0,3), (1,2), (2,1), (3,0).

  • Four points: (0,3), (1,2), (2,1), (3,0).
  • Answer: 4
Q2P(X + Y = 1)

Numerical Answer Type (NAT).

With f(0,1) = 1/4 and f(1,0) = 1/16 the only points on x + y = 1, find 16 × P(X + Y = 1).

Solution
Idea

4/16 + 1/16.

  • 1/4 + 1/16 = 5/16, so the answer is 5.
  • Answer: 5
Q3Which formula?

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

For integer-valued X, Y with joint PMF f, P(X + Y = z) equals:

1
∑xf(x,z)\sum_x f(x, z)
2
∑xf(x,z−x)\sum_x f(x, z - x)
3
f(z,z)f(z, z)
4
∑xf(x,x−z)\sum_x f(x, x - z)
Solution
Idea

The points satisfy x + y = z.

  • Each point on the line has the form (x, z − x).
  • Answer: option 2.
Next · Sums and convolutionConvolution for Independent Variables
30
Sums and convolution

Convolution for Independent Variables

The convolution formula and the triangle from two uniforms.

When the variables are independent the joint PMF is a product, and the sum along the line becomes a convolution.

30.1The convolution formula

Convolution

If XX and YY are independent, fXY(x,z−x)=fX(x) fY(z−x)f_{XY}(x, z - x) = f_X(x)\, f_Y(z - x), and the formula becomes the convolution:

fX+Y(z)=∑x=−∞∞fX(x) fY(z−x)f_{X+Y}(z) = \sum_{x=-\infty}^{\infty} f_X(x)\, f_Y(z - x)

30.2Example 1: the sum of two uniforms

X, Y independent Uniform{0, 1, 2, 3}: the PMF of Z = X + Y (numerators over 16)1/1602/1613/1624/1633/1642/1651/166the middle value can be reached in more ways: a triangle
Figure 11. The triangle: two independent Uniform{0,1,2,3} added

30.3Going deeper

  • Convolution as a table (extra). Write the PMF of X along a row and the PMF of Y down a column; the entries of the table are the products f_X(x) f_Y(y), and each anti-diagonal sums to one value of f_{X+Y}. That is the addition table of Chapter 17 with probabilities in it.
  • Different numbers of values (extra). If X has m values and Y has n values in a row, X + Y has m + n − 1 values: 4 + 4 − 1 = 7 above, 3 + 2 − 1 = 4 in the extra example.
  • Symmetric in X and Y (extra). Since X + Y = Y + X, the convolution can be summed over either variable.

30.4Exam tips and common mistakes

Exam tips
  • For small supports build the addition table first, then count how many cells give each total.
Common mistakes
  • Using the convolution when X and Y are not independent. Then use the full joint PMF.
  • Giving the sum of two uniforms the uniform PMF.

Practice questions (graded-assignment style)

Q1P(Z = 3)

Numerical Answer Type (NAT).

X, Y are independent Uniform{0,1,2,3}. Find 16 × P(X + Y = 3).

Solution
Idea

Count the pairs on x + y = 3.

  • Four pairs: (0,3), (1,2), (2,1), (3,0), each 1/16.
  • Answer: 4
Q2Number of values

Numerical Answer Type (NAT).

X and Y are independent Uniform{0,1,2,3}. How many values does X + Y take?

Solution
Idea

Range 0 to 6.

  • The values are 0, 1, ..., 6: seven values.
  • Answer: 7
Q3Shape of the sum

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

For independent Uniform{0,1,2,3} variables the PMF of X + Y is:

1
Uniform on 0..6
2
A triangle peaking at 3
3
Binomial(6, 1/2)
4
Constant
Solution
Idea

Count the ways to reach each total.

  • The counts are 1, 2, 3, 4, 3, 2, 1 over 16: a triangle.
  • Answer: option 2.
Q4P(X + Y = 2), extra example

Numerical Answer Type (NAT).

X ~ Uniform{0,1,2}, Y ~ Uniform{0,1} independent. Find 6 × P(X + Y = 2).

Solution
Idea

Pairs (2,0) and (1,1).

  • Two pairs, each 1/6, so 2/6.
  • Answer: 2
Next · Sums and convolutionSum of Two Independent Poissons
31
Sums and convolution

Sum of Two Independent Poissons

Poisson plus Poisson is Poisson, by convolution and the binomial theorem.

The most important convolution: the sum of two independent Poisson variables.

31.1Example 2: Poisson plus Poisson

PMFs of Poisson(2), Poisson(3) and Poisson(5)X ~ Poisson(2)Y ~ Poisson(3)X + Y ~ Poisson(5)0123456789101112the convolution of the first two is the third
Figure 12. Poisson(2) + Poisson(3) is Poisson(5)

31.2Going deeper

  • More than two (extra). By repeating the result, a sum of independent Poissons with rates λ₁, λ₂, ..., λₖ is Poisson(λ₁ + ... + λₖ). Think of events from several independent sources adding up.
  • Why the binomial theorem appears (extra). The terms of the convolution are exactly the terms of (λ₁ + λ₂)^z divided by z!, which is how the exponent and the factorial reassemble.
  • Contrast with uniforms (extra). Poisson is closed under addition; uniform is not (the sum of two uniforms is a triangle).

31.3Exam tips and common mistakes

Exam tips
  • Independent Poissons: just add the rates. State independence in your answer.
Common mistakes
  • Adding the PMFs instead of the random variables.
  • Forgetting independence: dependent Poissons need not add to a Poisson.

Practice questions (graded-assignment style)

Q1Poisson sum

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

X ~ Poisson(4) and Y ~ Poisson(6) are independent. X + Y is:

1
Poisson(10)
2
Poisson(24)
3
Poisson(5)
4
Binomial(10, 0.5)
Solution
Idea

Add the rates.

  • Independent Poissons add: Poisson(4 + 6) = Poisson(10).
  • Answer: option 1.
Q2The new rate

Numerical Answer Type (NAT).

Independent Poisson variables with rates 1.5, 2.5 and 4 are added. What is the rate of the sum?

Solution
Idea

Add all three.

  • 1.5 + 2.5 + 4 = 8.
  • Answer: 8
Q3Terms in the convolution

Numerical Answer Type (NAT).

To find P(X + Y = 5) for independent Poissons, how many non-zero terms does the convolution sum have?

Solution
Idea

x = 0, ..., 5.

  • x runs over 0, 1, ..., 5: six terms.
  • Answer: 6
Q4Poisson sums

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

Choose the correct statements about independent X ~ Poisson(λ₁), Y ~ Poisson(λ₂).

1
X + Y ~ Poisson(λ₁ + λ₂)
2
The proof uses the binomial theorem
3
X + Y ~ Poisson(λ₁ λ₂)
4
P(X + Y = z) sums over x = 0, ..., z
Solution
Idea

Add the rates; convolution over x ≤ z.

  • Statement 3 is false: rates add, they are not multiplied.
  • Answer: options 1, 2 and 4.
Next · Sums and convolutionSplitting a Poisson Total
32
Sums and convolution

Splitting a Poisson Total

X given X + Y is binomial.

Given the total of two independent Poisson counts, how is it shared between them? The answer is binomial.

32.1Example 3: the conditional distribution of X given X + Y

Interpretation

Given the total is nn, each of the nn events independently "belongs to XX" with probability λ1/(λ1+λ2)\lambda_1/(\lambda_1+\lambda_2): its share of the total rate.

Given that the total is n = 8, each event belongs to X or YXYYYXYYYX ~ Poisson(2), Y ~ Poisson(6), total Z = 8P(an event belongs to X)l1 / (l1 + l2) = 2/8 = 1/4P(an event belongs to Y)l2 / (l1 + l2) = 6/8 = 3/4so X given Z = 8 is Binomial(8, 1/4) and Y given Z = 8 is Binomial(8, 3/4)
Figure 13. Given the total, each event belongs to X with its share of the rate

32.2Going deeper

  • The conditional does not depend on the size of the rates, only on their ratio (extra). Poisson(2) and Poisson(6) give the same split as Poisson(1) and Poisson(3): p = 1/4.
  • X given the total cannot exceed the total (extra). A binomial is bounded by n, which is why a Poisson answer is impossible for the conditional (see Try these Q2).
  • Links to Chapter 1 (extra). X and Y are independent, yet given X + Y they are dependent: knowing the total and X determines Y. Conditioning on a sum creates dependence.

32.3Exam tips and common mistakes

Exam tips
  • Recognise "given the total": answer is Binomial(total, rate share). Check n and p match the question.
Common mistakes
  • Using the reciprocal of a rate as the probability, or p = λ₁ for X (it is the share λ₁/(λ₁ + λ₂)).
  • Answering Poisson for the conditional distribution.

Practice questions (graded-assignment style)

Q1The split probability

Numerical Answer Type (NAT).

X ~ Poisson(2), Y ~ Poisson(6) independent. Given X + Y = 8, X is Binomial(8, p). Find p.

Solution
Idea

λ₁/(λ₁ + λ₂).

  • 2/(2 + 6) = 0.25.
  • Answer: 0.25
Q2Expected share

Numerical Answer Type (NAT).

X ~ Poisson(5), Y ~ Poisson(15) independent. Given X + Y = 40, what is the mean of Y given the total?

Solution
Idea

Binomial(40, 15/20) has mean n p.

  • p = 15/20 = 0.75 and 40 × 0.75 = 30.
  • Answer: 30
Q3Which distribution?

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

X ~ Poisson(λ₁), Y ~ Poisson(λ₂) independent. X | (X + Y = n) is:

1
Poisson(λ₁)
2
Poisson(n)
3
Binomial(n, λ₁/(λ₁ + λ₂))
4
Binomial(n, λ₁)
Solution
Idea

Conditional of a Poisson sum.

  • The three Poisson PMFs combine into a binomial with the share of the rate as p.
  • Answer: option 3.
Q4A conditional probability

Numerical Answer Type (NAT).

X ~ Poisson(1), Y ~ Poisson(3) independent. Find 64 × P(X = 1 | X + Y = 4).

Solution
Idea

Binomial(4, 1/4).

  • P = 4 × (1/4) × (3/4)³ = 27/64.
  • Answer: 27
Next · Sums and convolutionA Catalogue of Sum Results
33
Sums and convolution

A Catalogue of Sum Results

Which families are closed under addition, and which are not.

A catalogue of sum results to know. All of them follow from the convolution formula or by counting, with all variables independent.

33.1The table

SummandsSumWhy
n i.i.d. Bernoulli(p)Binomial(n, p)Counts successes in n trials
Binomial(n, p) + Binomial(m, p)Binomial(n + m, p)Successes in n trials, then m more
Poisson(λ₁) + Poisson(λ₂)Poisson(λ₁ + λ₂)Convolution + binomial theorem (Chapter 31)
r i.i.d. Geometric(p)Negative-Binomial(r, p)Trials until the 1st success, then the 2nd, ..., then the r-th
NegBin(r, p) + NegBin(s, p)NegBin(r + s, p)Wait for r successes, then s more
Two independent uniformsUsually not uniformMiddle values have more contributing pairs
Remember. The same success probability p is essential in the Binomial and Negative-Binomial rows. Binomial(n, p₁) + Binomial(m, p₂) with p₁ ≠ p₂ is not binomial.

33.2Why different probabilities break it

Example 47Bernoulli(1/2) + Bernoulli(1/4) (extra)

X∼Bernoulli(12)X \sim \text{Bernoulli}(\tfrac12) and Y∼Bernoulli(14)Y \sim \text{Bernoulli}(\tfrac14) are independent. Is X+YX + Y binomial?

Solution
  1. Convolution: P(X+Y=0)=12⋅34=38P(X+Y=0) = \tfrac12\cdot\tfrac34 = \tfrac38; P(X+Y=1)=12⋅34+12⋅14=12P(X+Y=1) = \tfrac12\cdot\tfrac34 + \tfrac12\cdot\tfrac14 = \tfrac12; P(X+Y=2)=12⋅14=18P(X+Y=2) = \tfrac12\cdot\tfrac14 = \tfrac18. Total 38+48+18=1\tfrac38+\tfrac48+\tfrac18 = 1.
  2. If it were Binomial(2, qq), the mean 34\tfrac34 forces q=38q = \tfrac38, giving P(0)=(1−q)2=2564P(0) = (1 - q)^2 = \tfrac{25}{64}.
  3. But P(X+Y=0)=38=2464≠2564P(X+Y=0) = \tfrac38 = \tfrac{24}{64} \ne \tfrac{25}{64}. Not binomial.

33.3Going deeper

  • Geometric sums (extra). For two Geometric(p) variables (trials until first success), P(Z = n) = (n − 1) p² (1 − p)^(n−2) for n ≥ 2: the Negative-Binomial(2, p) PMF. The factor n − 1 counts where the first success can fall.
  • A pattern (extra). Binomial and Poisson are "closed under addition" for the parameter that measures how much happened (n, or λ); uniform has no such parameter, so it is not closed.

33.4Exam tips and common mistakes

Exam tips
  • Before using a row of the table check the conditions: independent, and the same p (or any λ for Poisson).
Common mistakes
  • Adding binomials with different p and calling the result binomial.
  • Forgetting that Negative-Binomial counts trials (not failures) here.

Practice questions (graded-assignment style)

Q1Binomial plus binomial

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

X ~ Binomial(5, 0.3) and Y ~ Binomial(7, 0.3) are independent. X + Y is:

1
Binomial(12, 0.3)
2
Binomial(35, 0.3)
3
Binomial(12, 0.6)
4
Not binomial
Solution
Idea

Same p: add the n.

  • Same success probability, so the numbers of trials add: Binomial(12, 0.3).
  • Answer: option 1.
Q2Different p

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

X ~ Binomial(5, 0.3) and Y ~ Binomial(7, 0.6) are independent. X + Y is:

1
Binomial(12, 0.3)
2
Binomial(12, 0.6)
3
Binomial(12, 0.45)
4
Not binomial
Solution
Idea

The success probabilities differ.

  • The same-p condition fails, so the sum is not binomial.
  • Answer: option 4.
Q3NegBin parameter

Numerical Answer Type (NAT).

Three independent Geometric(p) variables are added. The sum is Negative-Binomial(r, p). Find r.

Solution
Idea

One for each success.

  • r Geometric variables give NegBin(r, p), so r = 3.
  • Answer: 3
Q4Closed under addition

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

For independent variables, which families are closed under addition (with the right parameter conditions)?

1
Binomial (same p)
2
Poisson
3
Negative-Binomial (same p)
4
Uniform
Solution
Idea

Uniform is not closed.

  • The sum of two uniforms is a triangle, not a uniform.
  • Answer: options 1, 2 and 3.
Next · Try theseTry These: Uniforms and Poisson Malls
34
Try these

Try These: Uniforms and Poisson Malls

The two lecture questions solved step by step.

The two "Try these" questions of the lecture, solved step by step.

34.1Try these Q1: two odd-looking uniforms

Example 48Try these Q1: Uniform{0,1,4,5} + Uniform{0,2,8,10}

Let X∼Uniform{0,1,4,5}X \sim \text{Uniform}\{0, 1, 4, 5\} and Y∼Uniform{0,2,8,10}Y \sim \text{Uniform}\{0, 2, 8, 10\} be independent. Find the distribution of X+YX + Y.

Solution
  1. Joint PMF. Independence gives fXY(x,y)=14⋅14=116f_{XY}(x,y) = \tfrac14 \cdot \tfrac14 = \tfrac1{16} for each of the 4×4=164 \times 4 = 16 pairs.
  2. Addition table. Rows are values of XX, columns are values of YY, entries are x+yx + y (table below).
x\yx\backslash y02810
002810
113911
4461214
5571315
  1. Collect the values. Sorting the 16 entries gives 0,1,2,3,…,150, 1, 2, 3, \dots, 15: every integer from 0 to 15, each exactly once.
  2. Apply the rule. Each value zz lies on exactly one pair, so P(X+Y=z)=116P(X + Y = z) = \tfrac1{16} for z=0,1,…,15z = 0, 1, \dots, 15.
  3. Why it worked. Write X=a+4bX = a + 4b with a,b∈{0,1}a, b \in \{0,1\}, and Y=2c+8dY = 2c + 8d with c,d∈{0,1}c, d \in \{0,1\}. Then X+Y=a+2c+4b+8dX + Y = a + 2c + 4b + 8d: a 4-bit binary number with independent, fair bits. That is uniform on {0,…,15}\{0, \dots, 15\}. Here the sum of two uniforms is uniform, because no two pairs ever give the same total.
  4. Answer: X + Y ~ Uniform{0, 1, 2, ..., 15}.

34.2Try these Q2: visitors to two malls

Example 49Try these Q2: Poisson(10) + Poisson(20)

XX and YY are the numbers of people visiting shopping malls in city 1 and city 2 in a one-hour interval. They are independent Poisson variables with means 10 and 20 per hour. Let Z=X+YZ = X + Y. (a) Find the PMF fZ(z)f_Z(z). (b) Find the conditional distribution of YY given Z=30Z = 30.

Solution
  1. Translate "average". The mean of a Poisson is its parameter, so X∼Poisson(10)X \sim \text{Poisson}(10) and Y∼Poisson(20)Y \sim \text{Poisson}(20), independent.
  2. (a) Poisson sum. Z=X+Y∼Poisson(10+20)=Poisson(30)Z = X + Y \sim \text{Poisson}(10 + 20) = \text{Poisson}(30), so fZ(z)=e−30 30zz!f_Z(z) = \dfrac{e^{-30}\,30^z}{z!}, z=0,1,2,…z = 0, 1, 2, \dots. This is option B. (A and C wrongly use the reciprocal of a rate; D ignores city 1.)
  3. (b) Splitting. Given Z=nZ = n, Y∣(Z=n)∼Binomial ⁣(n,λ2λ1+λ2)=Binomial ⁣(n,2030)Y \mid (Z = n) \sim \text{Binomial}\!\left(n, \dfrac{\lambda_2}{\lambda_1 + \lambda_2}\right) = \text{Binomial}\!\left(n, \dfrac{20}{30}\right).
  4. Plug in n=30n = 30. Y∣(Z=30)∼Binomial(30,23)Y \mid (Z = 30) \sim \text{Binomial}(30, \tfrac23), option A.
  5. Sense check. City 2 has twice the rate of city 1, so of 30 visitors we expect about 30⋅23=2030 \cdot \tfrac23 = 20 in city 2. Also, given the total is fixed at 30, YY cannot exceed 30, so a Poisson (options C, D) is impossible.
  6. Answer: (a) B, Z ~ Poisson(30); (b) A, (Y | Z = 30) ~ Binomial(30, 2/3).

34.3Going deeper

  • Binary-code trick (extra). Q1 works because the supports {0,1,4,5} and {0,2,8,10} use different binary digits. Changing 10 to 9 would make some totals repeat, and the sum would stop being uniform.
  • Q2 numbers (extra). The mean of Y given the total is 20 and the variance of the conditional binomial is 30 · (2/3) · (1/3) = 20/3 ≈ 6.67, much smaller than the unconditional variance of Y (20): knowing the total removes uncertainty.

34.4Exam tips and common mistakes

Exam tips
  • For small supports write the addition table and sort the entries; if all are different, the sum is uniform on them.
  • In multiple-choice, rule out options whose range is impossible (a Poisson given a fixed total).
Common mistakes
  • Assuming a sum of uniforms is never uniform; check the totals.
  • Using the rate of X instead of Y in the split probability.

Practice questions (graded-assignment style)

Q1A total in Q1

Numerical Answer Type (NAT).

In Try these Q1, which pair (x, y) gives the total 15? Give x + y.

Solution
Idea

The largest x and y.

  • 5 + 10 = 15: the only pair with that total, so P(X + Y = 15) = 1/16.
  • Answer: 15
Q2Probability in Q1

Numerical Answer Type (NAT).

In Try these Q1, find 16 × P(X + Y = 7).

Solution
Idea

Which pair gives 7?

  • The pair (5, 2) only, so the probability is 1/16.
  • Answer: 1
Q3Mean in Q2(b)

Numerical Answer Type (NAT).

In Try these Q2, what is the mean of Y given Z = 30?

Solution
Idea

Binomial(30, 2/3).

  • 30 × 2/3 = 20.
  • Answer: 20
Q4Q2(a)

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

In Try these Q2 the PMF of Z = X + Y is:

1
e−1/30(1/30)z/z!e^{-1/30}(1/30)^z/z!
2
e−3030z/z!e^{-30}30^z/z!
3
e−1/20(1/20)z/z!e^{-1/20}(1/20)^z/z!
4
e−2020z/z!e^{-20}20^z/z!
Solution
Idea

Add the rates 10 and 20.

  • Poisson(30).
  • Answer: option 2.
Q5Q2 facts

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

Choose the correct statements about Try these Q2.

1
Z ~ Poisson(30)
2
Y | (Z = 30) ~ Binomial(30, 2/3)
3
Y | (Z = 30) ~ Poisson(20)
4
Y | (Z = 30) can exceed 30
Solution
Idea

Given the total, Y is at most 30.

  • A conditional Poisson would allow values above 30, which is impossible once the total is 30.
  • Answer: options 1 and 2.
Next · RevisionSums and convolution: Revision Sheet
35
Revision

Sums and convolution: Revision Sheet

One page to revise everything in this section.

The big picture

Sum along a line
  • P(X+Y=z)=∑xfXY(x,z−x)P(X+Y=z) = \sum_x f_{XY}(x, z-x).
  • Only the x with both x and z − x possible contribute.
Convolution
  • Independent: fX+Y(z)=∑xfX(x)fY(z−x)f_{X+Y}(z) = \sum_x f_X(x) f_Y(z-x).
  • Two Uniform{0..3}: triangle 1, 2, 3, 4, 3, 2, 1 over 16.
Poisson + Poisson
  • Independent Poisson(λ1\lambda_1) + Poisson(λ2\lambda_2) = Poisson(λ1+λ2\lambda_1+\lambda_2).
  • Proof: convolution + binomial theorem.
Splitting a total
  • X∣X+Y=n∼X \mid X+Y=n \sim Binomial(n,λ1/(λ1+λ2))(n, \lambda_1/(\lambda_1+\lambda_2)).
  • Each event belongs to X with its share of the rate.
Catalogue
  • Bernoulli sums: Binomial; Binomial + Binomial (same p); Poisson + Poisson; Geometric sums: NegBin.
  • Uniform + uniform: usually not uniform.
Try these
  • Q1: Uniform{0,1,4,5} + Uniform{0,2,8,10} = Uniform{0..15}.
  • Q2: Poisson(10) + Poisson(20) = Poisson(30); Y | Z = 30 ~ Binomial(30, 2/3).

Revision sheet

IdeaKey point
PMF of a sumP(X+Y=z)=∑xfXY(x,z−x)P(X+Y=z) = \sum_x f_{XY}(x, z-x)
ConvolutionIndependent: fX+Y(z)=∑xfX(x)fY(z−x)f_{X+Y}(z) = \sum_x f_X(x) f_Y(z-x)
Poisson + PoissonPoisson(λ1+λ2\lambda_1+\lambda_2)
Splitting a Poisson totalX∣X+Y=n∼Binomial(n,λ1/(λ1+λ2))X \mid X+Y=n \sim \text{Binomial}(n, \lambda_1/(\lambda_1+\lambda_2))
Bernoulli / Binomial sumsSame pp: Binomial(n+m,p)(n+m, p)
Geometric sumsrr i.i.d. Geometric(p)(p) → NegBin(r,p)(r, p)
Uniform + uniformUsually not uniform (triangle), unless every total is hit once
Revision overview
Sum of twoAdd along x + y = z
Only valid points
Joint PMF needed
IndependentConvolution
Triangle for uniforms
Product of PMFs
PoissonRates add
Binomial theorem
Split: binomial
Sums of variablesWeek 2
Closed familiesBinomial (same p)
Poisson
NegBin (same p)
Not closedUniform: triangle
Different p: not binomial
Try theseUniform{0..15}
Poisson(30)
Binomial(30, 2/3)
Revision: sums of random variables and convolution in one view

Common mistakes

Convolution without independence
  • The product f_X f_Y needs independent variables; otherwise use the joint PMF.
Uniform plus uniform is uniform
  • Usually a triangle. It is uniform only if every total is hit exactly once (Try these Q1).
Multiplying the Poisson rates
  • Rates add: λ₁ + λ₂.
Wrong split probability
  • Use the rate share λ₁/(λ₁ + λ₂), not λ₁ or 1/λ₁.
Binomials with different p
  • Their sum is not binomial.
Poisson for the conditional
  • Given a fixed total the count is bounded: binomial, not Poisson.
Back to top