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.
Chapters
- 17Small Cases: The Table MethodFunctions of two variables
- 18When Tables Become Too CumbersomeFunctions of two variables
- 19Visualizing g(x, y): Contours and RegionsFunctions of two variables
- 20Adding Over ContoursFunctions of two variables
- 21Try These and Dice ExamplesTry these
- 22Functions of two variables: Revision SheetRevision
- 23The General Rule and the Sum of Two DiceSeveral variables
- 24Area of a Random RectangleSeveral variables
- 25Three Variables, Two FunctionsSeveral variables
- 26Sums of Bernoulli TrialsSeveral variables
- 27Try These: Two Functions of Three BitsTry these
- 28Several variables: Revision SheetRevision
- 29PMF of a Sum: Summing Along a LineSums and convolution
- 30Convolution for Independent VariablesSums and convolution
- 31Sum of Two Independent PoissonsSums and convolution
- 32Splitting a Poisson TotalSums and convolution
- 33A Catalogue of Sum ResultsSums and convolution
- 34Try These: Uniforms and Poisson MallsTry these
- 35Sums and convolution: Revision SheetRevision
Small Cases: The Table Method
Sums and maxima of a pair when the table is small.
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
If takes only a few values, the table method from one variable still works: list every pair with its probability and the value , then group the rows by :
17.2Example 2: the maximum
17.3Going deeper
- Independence is not needed (extra). The method only uses the joint PMF. In Example 2 the variables are actually dependent (), and the method works just the same. In Example 1 independence was only used to fill in the s.
- 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
- 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.
- 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)
Numerical Answer Type (NAT).
are i.i.d. Uniform and . Find .
Pairs (0,1) and (1,0).
- 1/4 + 1/4 = 1/2 = 0.5.
- Answer: 0.5
Numerical Answer Type (NAT).
In Example 2, find 32 × P(Z = 1).
Pairs (0,1), (1,0), (1,1).
- 8 + 2 + 1 = 11 (in 32nds).
- Answer: 11
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:
Count pairs for each sum.
- One pair gives 0, two pairs give 1, one pair gives 2.
- Answer: option 2.
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements about the table method for Z = g(X, Y).
Only the joint PMF is needed.
- Independence is not required; Example 2 has dependent X, Y.
- Answer: options 1, 3 and 4.
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?
| Situation | Values of X | Values of Y | Rows |
|---|---|---|---|
| Two fair bits | 2 | 2 | 4 |
| Example 2 | 2 | 3 | 6 |
| A pair of dice | 6 | 6 | 36 |
| Two values from 1 to 100 | 100 | 100 | 10,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.
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 = 216rows. 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
- Estimate the number of rows before starting: if it is more than about 10, switch to contours.
- Adding the numbers of values instead of multiplying them to count rows.
Practice questions (graded-assignment style)
Numerical Answer Type (NAT).
How many rows does the table method need for a function of the numbers on two dice?
6 times 6.
- 6 × 6 = 36.
- Answer: 36
Numerical Answer Type (NAT).
X and Y each take the values 1, 2, ..., 100. How many rows does the table have?
100 times 100.
- 100 × 100 = 10,000.
- Answer: 10000
Numerical Answer Type (NAT).
How many rows would a table for three dice need?
6 × 6 × 6.
- 6³ = 216.
- Answer: 216
Multiple Choice Question (MCQ): choose the one correct option.
Why do we move from tables to contours and regions?
Think about 10,000 rows.
- The table method is correct but impractical for large cases.
- Answer: option 2.
Visualizing g(x, y): Contours and Regions
Two flat pictures that replace the 3D surface.
A function of two variables could be drawn as a 3D surface, with height above each point . Computers can draw that, but it rarely helps with solving problems. Two flat pictures are far more useful.
19.1Contours and regions
19.2The sum function g(x, y) = x + y
The contour is the straight line . Every contour has slope ; changing slides the line parallel to itself. The region is everything on or below that line, so the regions are nested half-planes that grow as increases.
19.3Every function has its own shape
| Function g | Contour g = c |
|---|---|
| straight lines of slope −1 | |
| straight lines of slope +1 | |
| L-shaped corners | |
| L-shaped corners |
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
Two fair dice give , each of the 36 pairs with probability . Use the contours of to find .
- The contour is the line , of slope , inside the grid.
- For it is the main diagonal: 6 points. Each step away from it loses one point: has 5 points, has 4, and so on down to with 1 point.
- So for .
- Check: .
19.5Going deeper
- L-shapes, precisely (extra). The contour is the top edge together with the right edge of the square, so its corner is at and it points left and down. For the corner is also , 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
- Sketch the grid of (x, y) points, draw the contour for the value you need, and count its points.
- 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)
Multiple Choice Question (MCQ): choose the one correct option.
The contour is a straight line of slope:
Solve for .
- has slope .
- Answer: option 2.
Multiple Choice Question (MCQ): choose the one correct option.
The contour looks like:
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.
Numerical Answer Type (NAT).
How many points (x, y) in {1, ..., 6}² lie on the contour x + y = 7?
List them: (1,6), (2,5), ...
- (1,6), (2,5), (3,4), (4,3), (5,2), (6,1): six points.
- Answer: 6
Numerical Answer Type (NAT).
How many points (x, y) in {1, ..., 6}² have x − y = 2?
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
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements.
Recall the four shapes.
- All four statements are true.
- Answer: options 1, 2, 3 and 4.
Adding Over Contours
Find the PMF of g(X, Y) by adding the joint PMF over contours, and the CDF over regions.
Suppose has joint PMF and . Here is the contour method for finding the PMF of .
20.1The two steps
- Step I. Find the range of .
- Step II. For each possible value , add over the contour :
20.2Regions give the cumulative version
For integer-valued you can recover the PMF: . Sometimes the region is easier to count than the contour.
For two fair dice and , find from a region and then .
- The region in the grid has points: the contours hold 1, 2 and 3 points.
- So .
- The region has 3 points, so .
- , which equals the 3 points of the contour . ✓
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
- 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.
- 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)
Numerical Answer Type (NAT).
For two fair dice, how many points does the region contain?
1 + 2 + 3.
- The contours x + y = 2, 3, 4 hold 1, 2, 3 points.
- Answer: 6
Numerical Answer Type (NAT).
Given and , find .
Subtract the two regions.
- 6 − 3 = 3.
- Answer: 3
Multiple Choice Question (MCQ): choose the one correct option.
For integer-valued , equals:
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.
Numerical Answer Type (NAT).
For two fair dice and S = X + Y, find 36 × P(S ≥ 10).
Contours 10, 11, 12 have 3, 2, 1 points.
- 3 + 2 + 1 = 6, equal to the region x + y ≤ 4 by symmetry.
- Answer: 6
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
A fair die is thrown twice; let be the two numbers and . Using contours, find the PMF of . Then use a region to find directly.
- Joint PMF. The throws are independent and fair, so for every . Every point has the same weight, so is just (number of points on the contour) .
- Range. .
- Shape of the contour . The larger coordinate equals , the other is at most : the top edge together with the right edge of the square, an L-shape.
- Count the points on each L. Each edge has points and they share the corner : .
- The PMF. . Check: . ✓
- Region for . means both and : the square in the corner, with 9 points. So .
- It matches the contours: . ✓ In general the region is a square, so , and , the same formula a second way.
- Answer: P(Z = c) = (2c − 1)/36 for c = 1, ..., 6; P(Z ≤ 3) = 1/4.
| 1 | 2 | 3 | 4 | 5 | 6 | |
|---|---|---|---|---|---|---|
| 1/36 | 3/36 | 5/36 | 7/36 | 9/36 | 11/36 |
21.2Try these Q2: the sum from the joint PMF of Example 2
Using the joint PMF of Example 2, find the PMF of and the probability .
| 0 | 1 | 2 | |
|---|---|---|---|
| 0 | 1/2 | 1/4 | 1/8 |
| 1 | 1/16 | 1/32 | 1/32 |
- Rewrite over 32 to make adding easy: , , , , , .
- Range. , , so .
- Points on each contour (the anti-diagonals of the table): : , . : , . : , . : , .
- Check. . ✓
- Region . It contains the contours and : the points . .
- Complement check. The rest of the grid is with total , and . ✓
- 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)
For two fair dice find the PMF of .
- The contour is a line of slope , and the number of grid points on it is for .
- So : 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1 (over 36).
- Check: the sum of the counts is 36. ✓ The most likely sum is 7 ().
For two fair dice find the PMF of .
- The contour is an L with its corner at and arms pointing right and up: the points and .
- Each arm has points, sharing the corner, so the L has points.
- : 11, 9, 7, 5, 3, 1 (over 36), total 36. ✓
- 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
- 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.
- 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)
Numerical Answer Type (NAT).
For two fair dice, find 36 × P(max(X, Y) = 4).
2c − 1 with c = 4.
- The L has 2·4 − 1 = 7 points.
- Answer: 7
Numerical Answer Type (NAT).
For two fair dice, find 36 × P(max(X, Y) ≤ 5).
A 5 × 5 square.
- The region is a 5 × 5 square: 25 points.
- Answer: 25
Numerical Answer Type (NAT).
In Try these Q2, find 32 × P(W = 3).
Only the pair (1, 2).
- Only (1,2) has x + y = 3, with probability 1/32.
- Answer: 1
Numerical Answer Type (NAT).
In Try these Q2, find P(X + Y ≤ 1) as a decimal.
26/32.
- 26/32 = 13/16 = 0.8125.
- Answer: 0.8125
Numerical Answer Type (NAT).
For two fair dice, find 36 × P(min(X, Y) = 2).
13 − 2c with c = 2.
- 13 − 4 = 9 points.
- Answer: 9
Multiple Choice Question (MCQ): choose the one correct option.
For two fair dice, the most likely value of X + Y is:
Which contour has the most points?
- The contour x + y = 7 has 6 points, the most.
- Answer: option 2.
Functions of two variables: Revision Sheet
One page to revise everything in this section.
The big picture
- One row per pair : probability and ; 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.
- Rows = (values of X) × (values of Y).
- 6 × 6 = 36 for dice; 100 × 100 = 10⁴.
- Contour: . Region: .
- : slope ; : slope ; max, min: L-shapes.
- .
- from a region; .
- 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
| Idea | Key point |
|---|---|
| Table method | One row per : probability and ; group by value |
| Limitation | Rows grow as (values of ) × (values of ) |
| Contour | |
| Region | |
| PMF of Z | |
| CDF of Z | |
| Contour shapes | : lines of slope ; max / min: L-shapes |
Group rows by z
Add probabilities
10,000 for 1 to 100
Need a picture
Regions: g ≤ c
Flat, not 3D
Count points
Uniform: points ÷ 36
PMF = difference
Max ≤ c: c × c square
x − y: slope +1
max, min: L-shapes
Common mistakes
- Two uniform variables give a sum with more pairs on the middle values.
- The L for max = c has 2c − 1 points, not 2c.
- x + y has slope −1; slope +1 is x − y.
- Contour is "exactly c", region is "at most c". Subtract neighbouring regions to get a PMF.
- Every pair must appear exactly once, so the final PMF adds up to 1.
- The table and contour methods need only the joint PMF. Use 1/36-type weights only when the pairs are equally likely.
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 with any number of variables, and then works through dice, a random rectangle and a three-variable table.
23.1The general rule
Let have joint PMF , with the range of . Let have range . The PMF of is
(I) find the range of ; (II) for each value , add the joint PMF over all points where equals (the contour ). 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
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
- 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.
- 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)
Numerical Answer Type (NAT).
For two fair dice find 36 × P(X₁ + X₂ = 6).
Count the anti-diagonal.
- (1,5), (2,4), (3,3), (4,2), (5,1): five points.
- Answer: 5
Numerical Answer Type (NAT).
For two fair dice find 36 × P(S = 9).
6 − |s − 7| with s = 9.
- 6 − |9 − 7| = 4: (3,6), (4,5), (5,4), (6,3).
- Answer: 4
Multiple Choice Question (MCQ): choose the one correct option.
The range of S = X₁ + X₂ for two dice is:
Smallest and largest sums.
- The smallest sum is 1 + 1 = 2 and the largest is 6 + 6 = 12.
- Answer: option 2.
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements.
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.
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
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 , so is not a product. For example is possible only when : but .
- Probabilities from the uniform answer (extra). Because the 12 areas are uniform, (the areas 54, 63, 72, 88, 99, 110) and .
- 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
- 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.
- 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)
Numerical Answer Type (NAT).
In Example 2 what is ?
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
Numerical Answer Type (NAT).
In Example 2, what is the area for L = 9, B = 6?
9 × 6.
- 9 × 6 = 54.
- Answer: 54
Numerical Answer Type (NAT).
In Example 2, find 12 × P(LB > 50).
Count areas above 50.
- 54, 63, 72, 88, 99, 110: six areas.
- Answer: 6
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:
Multiply f_L and f_B|L.
- 1/4 × 1/3 = 1/12.
- Answer: option 3.
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
25.2Going deeper
- The joint PMF contains the marginals (extra). Column sums give the PMF of , row sums the PMF of . Computing the joint first is never wasted work.
- Many cells are zero (extra). Only 7 of the 12 cells of the grid are non-zero, because the nine rows land on only 7 distinct 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
- 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.
- 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)
Numerical Answer Type (NAT).
In Example 3 find 9 × P(X = 3).
Rows with g = 3.
- The rows (0,1,2), (1,0,2), (1,1,1) have g = 3: three rows.
- Answer: 3
Numerical Answer Type (NAT).
In Example 3 find 9 × P(Y = 0).
Rows with h = 0.
- Six rows have t₂t₃ = 0.
- Answer: 6
Numerical Answer Type (NAT).
In Example 3 find 9 × f_XY(2, 0).
Rows with g = 2 and h = 0.
- The rows (0,0,2) and (1,1,0).
- Answer: 2
Multiple Choice Question (MCQ): choose the one correct option.
In Example 3 are X and Y independent?
Use the zero-cell test from Chapter 4.
- The zero cell has non-zero row and column totals.
- Answer: option 2.
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
26.2Why it is true
- The sum equals exactly when of the variables are 1 and the rest are 0.
- There are such patterns (choose which positions hold the 1s).
- By independence each pattern has probability .
- So , .
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 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
- When you see "number of successes in n independent identical trials", write Binomial(n, p) at once.
- 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)
Numerical Answer Type (NAT).
Three Bernoulli trials: how many patterns give a sum of 2?
Choose which 2 of 3 are ones.
- C(3,2) = 3: 110, 101, 011.
- Answer: 3
Numerical Answer Type (NAT).
X₁..X₄ are i.i.d. Bernoulli(1/2). Find 16 × P(sum = 2).
C(4,2) / 16.
- P(sum = 2) = 6/16, so the answer is 6.
- Answer: 6
Multiple Choice Question (MCQ): choose the one correct option.
The sum of 10 i.i.d. Bernoulli(0.3) variables is:
n trials with success probability p.
- Binomial(n, p) with n = 10, p = 0.3.
- Answer: option 2.
Numerical Answer Type (NAT).
Three independent trials each succeed with probability 0.5. Find 8 × P(sum = 3).
Only the pattern 111.
- P(sum = 3) = (1/2)³ = 1/8.
- Answer: 1
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
each take values in and their joint distribution is uniform. Define and . Find the joint distribution of and .
- Joint PMF of the inputs. There are triples, each with probability .
- Table with both functions. For each row compute
g = t₁t₂ + 2t₃andh = 2t₁ + t₂(table below).
| 0 | 0 | 0 | 1/8 | 0 | 0 |
| 0 | 0 | 1 | 1/8 | 2 | 0 |
| 0 | 1 | 0 | 1/8 | 0 | 1 |
| 0 | 1 | 1 | 1/8 | 2 | 1 |
| 1 | 0 | 0 | 1/8 | 0 | 2 |
| 1 | 0 | 1 | 1/8 | 2 | 2 |
| 1 | 1 | 0 | 1/8 | 1 | 3 |
| 1 | 1 | 1 | 1/8 | 3 | 3 |
- Ranges. and .
- Group rows by the pair . All 8 rows give different pairs, so each observed pair gets and every other pair gets 0 (table below).
| 0 | 1 | 2 | 3 | ||
|---|---|---|---|---|---|
| 0 | 1/8 | 0 | 1/8 | 0 | 1/4 |
| 1 | 1/8 | 0 | 1/8 | 0 | 1/4 |
| 2 | 1/8 | 0 | 1/8 | 0 | 1/4 |
| 3 | 0 | 1/8 | 0 | 1/8 | 1/4 |
| 3/8 | 1/8 | 3/8 | 1/8 | 1 |
- Check and interpret. The 8 non-zero cells add to 1. ✓ The marginals: is uniform on (it is the binary number ), while is not uniform.
- and are dependent: but . This makes sense: can be odd only when , i.e. .
- 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
are independent, each equally likely to be 0 or 1. Find the PMF of (a) and (b) .
- Joint PMF. By independence each of the 8 triples has probability .
- Both functions depend only on how many 1s there are. Let be the number of 1s among . Then . counts the pairs that are both 1, which is .
| triples | probability | |||
|---|---|---|---|---|
| 0 | 000 | 1/8 | 0 | 0 |
| 1 | 100, 010, 001 | 3/8 | 1 | 0 |
| 2 | 110, 101, 011 | 3/8 | 2 | 1 |
| 3 | 111 | 1/8 | 3 | 3 |
- (a) Read the column: . This is , exactly as the Bernoulli-sum result predicts.
- (b) and both give , so their probabilities combine: , , . The value is impossible: two pairs of 1s would force the third pair to be 1s as well.
- Spot-check. For : . ✓ For : . ✓
- 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 . Then it is enough to work with the PMF of (binomial) and apply the functions to : 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
- 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.
- 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)
Numerical Answer Type (NAT).
In Try these Q1, find 8 × f(g = 2, h = 1).
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
Numerical Answer Type (NAT).
In Try these Q1, find 8 × P(g = 2).
Add the g = 2 column of the joint table.
- The cells (2,0), (2,1), (2,2) hold 1 each: 3/8.
- Answer: 3
Numerical Answer Type (NAT).
In Try these Q2, find P(U = 0).
k = 0 and k = 1.
- 1/8 + 3/8 = 1/2.
- Answer: 0.5
Multiple Choice Question (MCQ): choose the one correct option.
In Try these Q2 which value of U is impossible?
U = C(k, 2) for k = 0..3.
- C(k,2) takes the values 0, 0, 1, 3: never 2.
- Answer: option 3.
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements about (g, h) in Try these Q1.
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.
Several variables: Revision Sheet
One page to revise everything in this section.
The big picture
- .
- Two steps: range of g, then add the joint PMF over each contour g = t.
- , .
- P(S = 6) = 5/36.
- Build first, then apply g.
- Random rectangle: 12 pairs of 1/12; the 12 areas are all different.
- Add one column per function; group rows by the pair of values.
- Row sums and column sums give the two PMFs back.
- i.i.d. Bernoulli(p), n of them: sum Binomial(n, p).
- patterns, each .
- 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
| Idea | Key point |
|---|---|
| General rule | Two-step recipe: (I) range of ; (II) add the joint PMF over each contour |
| Conditional descriptions | Build before applying |
| Two functions at once | Add one column per function; group by the pair of values |
| Two dice sum | |
| Bernoulli sum | i.i.d. Bernoulli, of them: sum Binomial |
Add f over g = t
Works for any n
Random rectangle
Three variables
One column per function
Check totals
Row sums = PMF of h
Column sums = PMF of g
C(n, k) patterns
Binomial(n, p)
are often dependent
Zero-cell test works
Common mistakes
- Build f_XY = f_X · f_Y|X first when the second variable is given the first.
- For the joint PMF of two functions group by the pair (g, h).
- Two functions of the same variables are usually dependent. Test a zero cell.
- The Bernoulli-sum result needs i.i.d. trials.
- A value of g that no row produces has probability 0 (U = 2 in Q2).
- The smallest sum of two dice is 2, not 1.
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 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
Let and take integer values, with joint PMF , and let . For an integer , the contour is the line of points . Adding 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)
Use the joint PMF of Example 27 (Chapter 17, the maximum example) (, , , , ). Find using the line formula.
- The points on the line are and .
- , matching Example 31 (Chapter 21).
- 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 , written with the points of the contour spelled out as .
- Two equal forms (extra). Summing over or over gives the same answer, since each point of the line is counted once either way.
- Negative values (extra). The sums run from to because and may be negative; for non-negative variables they start at 0.
29.4Exam tips and common mistakes
- List the points (x, z − x) that exist in the table, then add their probabilities.
- 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)
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?
(0,3), (1,2), (2,1), (3,0).
- Four points: (0,3), (1,2), (2,1), (3,0).
- Answer: 4
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).
4/16 + 1/16.
- 1/4 + 1/16 = 5/16, so the answer is 5.
- Answer: 5
Multiple Choice Question (MCQ): choose the one correct option.
For integer-valued X, Y with joint PMF f, P(X + Y = z) equals:
The points satisfy x + y = z.
- Each point on the line has the form (x, z − x).
- Answer: option 2.
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
If and are independent, , and the formula becomes the convolution:
30.2Example 1: the sum of two uniforms
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
- For small supports build the addition table first, then count how many cells give each total.
- 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)
Numerical Answer Type (NAT).
X, Y are independent Uniform{0,1,2,3}. Find 16 × P(X + Y = 3).
Count the pairs on x + y = 3.
- Four pairs: (0,3), (1,2), (2,1), (3,0), each 1/16.
- Answer: 4
Numerical Answer Type (NAT).
X and Y are independent Uniform{0,1,2,3}. How many values does X + Y take?
Range 0 to 6.
- The values are 0, 1, ..., 6: seven values.
- Answer: 7
Multiple Choice Question (MCQ): choose the one correct option.
For independent Uniform{0,1,2,3} variables the PMF of X + Y is:
Count the ways to reach each total.
- The counts are 1, 2, 3, 4, 3, 2, 1 over 16: a triangle.
- Answer: option 2.
Numerical Answer Type (NAT).
X ~ Uniform{0,1,2}, Y ~ Uniform{0,1} independent. Find 6 × P(X + Y = 2).
Pairs (2,0) and (1,1).
- Two pairs, each 1/6, so 2/6.
- Answer: 2
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
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
- Independent Poissons: just add the rates. State independence in your answer.
- Adding the PMFs instead of the random variables.
- Forgetting independence: dependent Poissons need not add to a Poisson.
Practice questions (graded-assignment style)
Multiple Choice Question (MCQ): choose the one correct option.
X ~ Poisson(4) and Y ~ Poisson(6) are independent. X + Y is:
Add the rates.
- Independent Poissons add: Poisson(4 + 6) = Poisson(10).
- Answer: option 1.
Numerical Answer Type (NAT).
Independent Poisson variables with rates 1.5, 2.5 and 4 are added. What is the rate of the sum?
Add all three.
- 1.5 + 2.5 + 4 = 8.
- Answer: 8
Numerical Answer Type (NAT).
To find P(X + Y = 5) for independent Poissons, how many non-zero terms does the convolution sum have?
x = 0, ..., 5.
- x runs over 0, 1, ..., 5: six terms.
- Answer: 6
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements about independent X ~ Poisson(λ₁), Y ~ Poisson(λ₂).
Add the rates; convolution over x ≤ z.
- Statement 3 is false: rates add, they are not multiplied.
- Answer: options 1, 2 and 4.
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
Given the total is , each of the events independently "belongs to " with probability : its share of the total 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
- Recognise "given the total": answer is Binomial(total, rate share). Check n and p match the question.
- 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)
Numerical Answer Type (NAT).
X ~ Poisson(2), Y ~ Poisson(6) independent. Given X + Y = 8, X is Binomial(8, p). Find p.
λ₁/(λ₁ + λ₂).
- 2/(2 + 6) = 0.25.
- Answer: 0.25
Numerical Answer Type (NAT).
X ~ Poisson(5), Y ~ Poisson(15) independent. Given X + Y = 40, what is the mean of Y given the total?
Binomial(40, 15/20) has mean n p.
- p = 15/20 = 0.75 and 40 × 0.75 = 30.
- Answer: 30
Multiple Choice Question (MCQ): choose the one correct option.
X ~ Poisson(λ₁), Y ~ Poisson(λ₂) independent. X | (X + Y = n) is:
Conditional of a Poisson sum.
- The three Poisson PMFs combine into a binomial with the share of the rate as p.
- Answer: option 3.
Numerical Answer Type (NAT).
X ~ Poisson(1), Y ~ Poisson(3) independent. Find 64 × P(X = 1 | X + Y = 4).
Binomial(4, 1/4).
- P = 4 × (1/4) × (3/4)³ = 27/64.
- Answer: 27
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
| Summands | Sum | Why |
|---|---|---|
| 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 uniforms | Usually not uniform | Middle values have more contributing pairs |
33.2Why different probabilities break it
and are independent. Is binomial?
- Convolution: ; ; . Total .
- If it were Binomial(2, ), the mean forces , giving .
- But . 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
- Before using a row of the table check the conditions: independent, and the same p (or any λ for Poisson).
- Adding binomials with different p and calling the result binomial.
- Forgetting that Negative-Binomial counts trials (not failures) here.
Practice questions (graded-assignment style)
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:
Same p: add the n.
- Same success probability, so the numbers of trials add: Binomial(12, 0.3).
- Answer: option 1.
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:
The success probabilities differ.
- The same-p condition fails, so the sum is not binomial.
- Answer: option 4.
Numerical Answer Type (NAT).
Three independent Geometric(p) variables are added. The sum is Negative-Binomial(r, p). Find r.
One for each success.
- r Geometric variables give NegBin(r, p), so r = 3.
- Answer: 3
Multiple Select Question (MSQ): select all that apply.
For independent variables, which families are closed under addition (with the right parameter conditions)?
Uniform is not closed.
- The sum of two uniforms is a triangle, not a uniform.
- Answer: options 1, 2 and 3.
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
Let and be independent. Find the distribution of .
- Joint PMF. Independence gives for each of the pairs.
- Addition table. Rows are values of , columns are values of , entries are (table below).
| 0 | 2 | 8 | 10 | |
|---|---|---|---|---|
| 0 | 0 | 2 | 8 | 10 |
| 1 | 1 | 3 | 9 | 11 |
| 4 | 4 | 6 | 12 | 14 |
| 5 | 5 | 7 | 13 | 15 |
- Collect the values. Sorting the 16 entries gives : every integer from 0 to 15, each exactly once.
- Apply the rule. Each value lies on exactly one pair, so for .
- Why it worked. Write with , and with . Then : a 4-bit binary number with independent, fair bits. That is uniform on . Here the sum of two uniforms is uniform, because no two pairs ever give the same total.
- Answer: X + Y ~ Uniform{0, 1, 2, ..., 15}.
34.2Try these Q2: visitors to two malls
and 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 . (a) Find the PMF . (b) Find the conditional distribution of given .
- Translate "average". The mean of a Poisson is its parameter, so and , independent.
- (a) Poisson sum. , so , . This is option B. (A and C wrongly use the reciprocal of a rate; D ignores city 1.)
- (b) Splitting. Given , .
- Plug in . , option A.
- Sense check. City 2 has twice the rate of city 1, so of 30 visitors we expect about in city 2. Also, given the total is fixed at 30, cannot exceed 30, so a Poisson (options C, D) is impossible.
- 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
- 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).
- 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)
Numerical Answer Type (NAT).
In Try these Q1, which pair (x, y) gives the total 15? Give x + y.
The largest x and y.
- 5 + 10 = 15: the only pair with that total, so P(X + Y = 15) = 1/16.
- Answer: 15
Numerical Answer Type (NAT).
In Try these Q1, find 16 × P(X + Y = 7).
Which pair gives 7?
- The pair (5, 2) only, so the probability is 1/16.
- Answer: 1
Numerical Answer Type (NAT).
In Try these Q2, what is the mean of Y given Z = 30?
Binomial(30, 2/3).
- 30 × 2/3 = 20.
- Answer: 20
Multiple Choice Question (MCQ): choose the one correct option.
In Try these Q2 the PMF of Z = X + Y is:
Add the rates 10 and 20.
- Poisson(30).
- Answer: option 2.
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements about Try these Q2.
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.
Sums and convolution: Revision Sheet
One page to revise everything in this section.
The big picture
- .
- Only the x with both x and z − x possible contribute.
- Independent: .
- Two Uniform{0..3}: triangle 1, 2, 3, 4, 3, 2, 1 over 16.
- Independent Poisson() + Poisson() = Poisson().
- Proof: convolution + binomial theorem.
- Binomial.
- Each event belongs to X with its share of the rate.
- Bernoulli sums: Binomial; Binomial + Binomial (same p); Poisson + Poisson; Geometric sums: NegBin.
- Uniform + uniform: usually not uniform.
- 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
| Idea | Key point |
|---|---|
| PMF of a sum | |
| Convolution | Independent: |
| Poisson + Poisson | Poisson() |
| Splitting a Poisson total | |
| Bernoulli / Binomial sums | Same : Binomial |
| Geometric sums | i.i.d. Geometric → NegBin |
| Uniform + uniform | Usually not uniform (triangle), unless every total is hit once |
Only valid points
Joint PMF needed
Triangle for uniforms
Product of PMFs
Binomial theorem
Split: binomial
Poisson
NegBin (same p)
Different p: not binomial
Poisson(30)
Binomial(30, 2/3)
Common mistakes
- The product f_X f_Y needs independent variables; otherwise use the joint PMF.
- Usually a triangle. It is uniform only if every total is hit exactly once (Try these Q1).
- Rates add: λ₁ + λ₂.
- Use the rate share λ₁/(λ₁ + λ₂), not λ₁ or 1/λ₁.
- Their sum is not binomial.
- Given a fixed total the count is bounded: binomial, not Poisson.