Statistics for
Data Science 2
Independence of two and of many random variables, and functions of one random variable: stem plots, the table method, one-to-one, many-to-one and clipping functions, with every worked example solved. This is Part 1 of 2 of the Week 2 notes.
Chapters
- 01From Independent Events to Independent Random VariablesIndependence
- 02Checking Independence From a Joint PMF TableIndependence
- 03Independence in a Real Setting: A Random 2-Digit NumberIndependence
- 04Independent vs Dependent: The Working RulesIndependence
- 05Independence: Revision SheetRevision
- 06Independence for n Random VariablesMany variables
- 07A Random 3-Digit NumberMany variables
- 08Even Parity: Pairwise Independent, Not IndependentMany variables
- 09Useful Consequences and Try TheseMany variables
- 10Many variables: Revision SheetRevision
- 11Seeing a PMF: Stem PlotsFunctions of one variable
- 12The Table MethodFunctions of one variable
- 13One-to-One FunctionsFunctions of one variable
- 14Many-to-One FunctionsFunctions of one variable
- 15Try These: Clipping FunctionsTry these
- 16Functions of one variable: Revision SheetRevision
From Independent Events to Independent Random Variables
When does knowing one random variable tell you nothing about another? The definition and the product rule.
This chapter asks one question: when does knowing the value of one random variable tell you nothing about another? The answer is independence. We carry the idea over from events, state the definition, and see that it can be tested cell by cell on a joint PMF.
1.1Recap: independent events
Two events and are independent when . Knowing that happened does not change the probability of .
A random variable defines events too: , , . So the idea of independence extends naturally from events to random variables.
1.2The definition
Let and be random variables on the same probability space, with ranges and . and are independent if every event defined using alone is independent of every event defined using alone. Equivalently, with joint PMF :
(t₁, t₂), not just a few of them.1.3Compare with the factorisation that always holds
For any two random variables the joint PMF factors as a marginal times a conditional. Independence is the special case where the conditional equals the marginal:
| Joint PMF | Conditional PMF | |
|---|---|---|
| General (always) | ||
| Independent |
For independent X and Y the joint PMF is the product of the marginals, and every conditional PMF equals the marginal PMF. Learning X = t₁ does not change the distribution of Y at all.
1.4Going deeper
- Symmetric (extra). independent of means independent of . The condition treats both the same way, so it also gives .
- Support is a full grid (extra). If and are independent, then exactly when and . So the non-zero cells always form a complete rectangle. A zero cell sitting where both its row total and column total are positive can never happen. This is the fast dependence test of Chapter 4.
- Why "same probability space" (extra). The joint PMF only makes sense if both random variables are defined on the same experiment, such as the same random pick of a student.
1.5Exam tips and common mistakes
- Write the target first: , then compute the two marginals from the table.
- If a question gives independence, use it to fill in cells: each unknown joint value is a row marginal times a column marginal.
- Calling variables independent after checking only one or two cells.
- Judging independence from the marginals alone: the same marginals fit both independent and dependent tables (Chapter 2, Example 3).
- Mixing up independent with identically distributed: independence is about the joint PMF, not whether X and Y have the same marginal.
Practice questions (graded-assignment style)
Numerical Answer Type (NAT).
and are independent with and . Find .
Joint is the product of the marginals.
- .
- Answer: 0.12
Numerical Answer Type (NAT).
and are independent, and . Find .
Always .
- The factorisation always holds: .
- By independence , so the same product is also .
- Answer: 0.28
Multiple Choice Question (MCQ): choose the one correct option.
Which equation is the definition of independence of X and Y?
The product rule must hold for every pair.
- Option 2 is the definition. Option 4 only asks for one pair, which is not enough.
- Options 1 and 3 are not the definition (a sum is not a product, and equal marginals do not mean independent).
- Answer: option 2.
Multiple Select Question (MSQ): select all that apply.
Suppose X and Y are independent. Choose the correct statements.
Recall the two forms of the definition.
- Statements 1 and 2 are the two equivalent forms.
- Statement 3 is false: the marginals can be completely different. Statement 4 is the opposite of independence.
- Answer: options 1 and 2.
Checking Independence From a Joint PMF Table
Compare the joint PMF with the product of its marginals, with one independent and two dependent tables.
In practice the joint PMF comes as a table, and we test independence by comparing it with the product of its own marginals.
2.1How to read the table
In every table below, columns are values of , and rows are values of . The last column holds (the row sums) and the last row holds (the column sums).
- Add each row to get
f_Yand each column to getf_X. Check that both add up to 1. - For a cell, multiply its column marginal and its row marginal, and compare with the entry: against .
- One failing cell means dependent. Only when every cell matches are the variables independent.
2.2Example 2: dependent
The other three cells also fail ( against , against , against ). Both tables add up to , so a mismatch in one cell is made up by the others.
2.3The conditional view
Independence also says the conditional PMF of given equals the marginal for every . Example 1 passes; Example 2 fails: and , neither of which is .
2.4Going deeper
- Fewer checks are enough in principle (extra). For an table, once the cells in the first rows and columns match the product, the last row and column match automatically, because the marginals force the totals. In the exam still check every cell unless it is cheaper to find one failing cell.
- Use common denominators (extra). Comparing 99/576 with 96/576 is easier than comparing decimals. Convert both sides to one denominator before deciding that two products differ.
2.5Exam tips and common mistakes
- Pick the cell with the simplest numbers first (often the top-left); if it fails you are done.
- When the table has a parameter, find the value that fixes one cell, then check that every other cell agrees.
- Using a row total as a column marginal. Multiply the total of the cell's column (
f_X) by the total of its row (f_Y). - Stopping at a cell that matches and declaring independence.
- Solving for the parameter from one cell but not checking the others.
Practice questions (graded-assignment style)
Multiple Choice Question (MCQ): choose the one correct option.
The joint PMF has (first argument , second ). Are and independent?
Compute both marginals and test one cell.
- and .
- , so the variables are dependent.
- Answer: option 2.
Numerical Answer Type (NAT).
The joint PMF is . For what value of are and independent?
Find the marginals, then fix one cell.
- and , whatever is.
- Independence needs .
- Check the others at : , , . All match.
- Answer: 0.1
Multiple Select Question (MSQ): select all that apply.
For the joint PMF of Example 2 (), choose the correct statements.
Add the columns and rows.
- , , and their product is .
- The product differs from , so statement 3 is false.
- Answer: options 1, 2 and 4.
Numerical Answer Type (NAT).
In Example 3 take . What is , the cell with ? (Give it as a decimal.)
Compute .
- , not , so at this the variables are dependent.
- Answer: 0.375
Independence in a Real Setting: A Random 2-Digit Number
A counting example where a natural pair of variables turns out to be dependent.
Here independence is tested on real numbers instead of a ready-made table. We build the joint distribution by counting, and find that a very natural pair of digits-based random variables is not independent.
3.1The experiment
A number from 00 to 99 is picked uniformly at random. Let X = the units digit and Y = the remainder when the number is divided by 4. Are X and Y independent?
- Marginals. Each units digit appears in exactly 10 of the 100 numbers, and each remainder appears in exactly 25 (since 4 divides 100).
- So and .
- Look for an impossible pair. If the units digit is 1, the number is odd, so it cannot be a multiple of 4.
- Hence , but .
- X and Y are not independent. The units digit fixes whether the number is odd or even, and that restricts the remainder mod 4.
3.2The whole joint table, by counting
Counting how many of the 100 numbers have each (units digit, remainder) pair gives the full picture. Each cell of the figure shows how many numbers fall there.
- For an even units digit the number is even, so the remainder is 0 or 2 (5 numbers each). For example units digit 2 and remainder 2: 2, 22, 42, 62, 82.
- For an odd units digit the remainder is 1 or 3 (5 numbers each).
- In an independent table every cell would hold numbers, which is not even a whole number. Here half the cells hold 0 and half hold 5.
3.3Related pairs, to build intuition
For the same random number let X be the tens digit and Y the units digit. Are they independent?
- Both are , so each marginal value is .
- Each pair (tens, units) is exactly one number out of 100, so every cell is .
- for all 100 cells: independent.
Now let Y be the remainder when the number is divided by 5. Are the units digit X and Y independent?
- The units digit decides the remainder mod 5: the remainder is the units digit mod 5.
- So , but and , giving a product .
- Dependent, and more strongly than in Example 4: here X completely determines Y.
Compare the three: tens and units digits carry no information about each other (independent), the units digit says a little about the remainder mod 4 (dependent), and it says everything about the remainder mod 5 (dependent).
3.4Independence in real modelling
The same thinking applies in modelling. Let X = runs scored in a cricket over and Y = wickets taken in that over. These are not independent: an over with many wickets tends to have fewer runs. Deciding whether an independence assumption is reasonable is a routine part of building a model from real data.
- Independent assumptions make life simple. If two variables are independent the joint PMF is just the two marginals multiplied. If they are not, you must model the whole joint table.
- Real data is a sanity check (extra). Ask whether one variable physically limits the other, as the units digit limits the remainder. If yes, expect dependence.
3.5Exam tips and common mistakes
- Ask first: does one variable restrict the values of the other? If so, look for an impossible pair and use it.
- For uniform sample spaces, count cases instead of using probability formulas.
- Checking only the marginals: both uniform marginals look "perfectly independent" but the pair is not.
- Forgetting that 4 divides 100, which is why each remainder appears exactly 25 times.
Practice questions (graded-assignment style)
Numerical Answer Type (NAT).
How many of the numbers 00 to 99 have units digit 1 and leave remainder 0 when divided by 4?
Units digit 1 means the number is odd.
- An odd number cannot be a multiple of 4, so there are 0 such numbers.
- That makes , which is the impossible pair used in Example 4.
- Answer: 0
Numerical Answer Type (NAT).
How many of the numbers 00 to 99 have units digit 2 and remainder 2 when divided by 4?
List the numbers ending in 2.
- The numbers ending in 2 are 2, 12, 22, ..., 92. Their remainders mod 4 alternate 2, 0, 2, 0, ...
- The ones with remainder 2 are 2, 22, 42, 62, 82: five numbers, so
f_XY(2,2) = 5/100. - Answer: 5
Multiple Choice Question (MCQ): choose the one correct option.
For a uniformly random number from 00 to 99, the tens digit and the units digit are:
Count the numbers in each (tens, units) cell.
- Every (tens, units) pair is exactly one number, so each cell is .
- Coming from the same experiment does not make variables dependent.
- Answer: option 1.
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements about X = units digit and Y = remainder mod 4.
Use counting and the odd/even argument.
- Statements 1 and 2 are the marginals found in Example 4.
- Statement 4 is the impossible pair. Statement 3 is the product , not the joint value.
- Answer: options 1, 2 and 4.
Independent vs Dependent: The Working Rules
The rules for proving each, the fastest checks, and the "Try these" questions worked out.
This chapter collects the working rules and uses them on the "Try these" questions of the lecture, with every step shown.
4.1The working rules
4.2The fastest dependence check: a zero cell
Look for a cell with whose row total and column total are both non-zero. Then but , so the product rule fails and the variables are dependent. This is exactly what happened in Example 4 with the pair (1, 0).
4.3A visual shortcut: the rows
X and Y are independent exactly when every row of the joint table is a multiple of the same row, namely . Row must equal times the vector . If two rows have different shapes, the variables are dependent.
Why it works (extra). If in every row, then adding over gives , so and the product rule holds. Reading it the other way, row divided by its total is the conditional PMF , and independence says that is always .
4.4Try these: worked solutions
Check whether X and Y are independent, given the joint PMF below.
| 0 | 1 | 2 | |
|---|---|---|---|
| 0 | 1/6 | 1/12 | 1/12 |
| 1 | 1/4 | 1/8 | 1/8 |
| 2 | 1/12 | 1/24 | 1/24 |
- Row sums. With denominator 24: , , .
- Column sums. , , .
- Sanity check. and .
- Products
f_X(t₁) f_Y(t₂): row 0 is1/6, 1/12, 1/12; row 1 is1/4, 1/8, 1/8; row 2 is1/12, 1/24, 1/24. - Compare cell by cell. All nine products match the given joint PMF exactly.
- Row shortcut. Every row is a multiple of : row 0 is of it, row 1 is of it, row 2 is of it.
- Answer: X and Y are independent.
Decide whether X and Y are independent for this joint PMF.
| 0 | 1 | 2 | |
|---|---|---|---|
| 0 | 0 | 1/8 | 1/8 |
| 1 | 1/8 | 1/8 | 1/8 |
| 2 | 1/8 | 1/8 | 1/8 |
- Spot the zero cell.
f_XY(0,0) = 0. Now check whether its row and column have non-zero totals. - Marginals. and .
- Compare. but . This is the "zero cell with non-zero marginals" case.
- Answer (a): dependent.
Decide whether X and Y are independent for this joint PMF.
| 0 | 1 | 2 | |
|---|---|---|---|
| 0 | 1/6 | 1/12 | 1/8 |
| 1 | 1/4 | 1/8 | 1/8 |
| 2 | 1/24 | 1/24 | 1/24 |
- Marginals (denominator 24): , , ; , , . Both sets add to .
- Test the cell . .
- Conclude. , so the product rule fails at .
- Row shortcut agrees. Row 0 is , while row 1 is . Different shapes, so dependent.
- Answer (b): dependent.
This table is very close to the independent one in Q1: only two cells differ (top-right and bottom-left). Near misses like this are why every cell must be checked before claiming independence.
Two fair coins give (1 for heads), independent of each other. Let and . Are and independent?
| 0 | 1 | ||
|---|---|---|---|
| 0 | 1/4 | 0 | 1/4 |
| 1 | 1/4 | 1/4 | 1/2 |
| 2 | 0 | 1/4 | 1/4 |
| 1/2 | 1/2 | 1 |
- The four equally likely outcomes give the table above.
- Zero cell. (if the first coin is heads, the sum cannot be 0), but and , so .
- Dependent. The sum depends on the first coin even though the two coins are independent. Independence of the parts does not carry over to a variable built from them.
4.5Marginals never decide it
- Many different joint PMFs share the same marginals. Example 1 and Example 3 (with x ≠ 1/4) have identical marginals but only one is independent.
- The marginals tell you what the independent table would be (their product). You still have to compare it with the actual joint table.
4.6Exam tips and common mistakes
- Order of attack: (1) look for a zero cell with non-zero marginals; (2) test one or two simple cells; (3) only if all pass, check the rest or use the row shortcut.
- Keep a common denominator for the whole table (24 in Q1 and Q2).
- Declaring independence because two marginals look similar or a few cells match.
- Treating a zero cell as proof of dependence even when its row or column total is also 0.
- Dividing a row by the wrong total when using the row shortcut: divide by that row's own total.
Practice questions (graded-assignment style)
Multiple Choice Question (MCQ): choose the one correct option.
A joint table has a cell equal to 0 whose row total and column total are both positive. Then X and Y are:
Compare the cell with the product of its marginals.
- The cell is 0 but the product of two positive marginals is positive, so the product rule fails.
- Answer: option 2.
Multiple Choice Question (MCQ): choose the one correct option.
A joint table (rows Y = 0, 1, 2; columns X = 0, 1, 2) has rows (0.06, 0.09, 0.15), (0.10, 0.15, 0.25) and (0.04, 0.06, 0.10). Are X and Y independent?
Rows must be multiples of the same vector.
- Row 0 is , row 1 is , row 2 is : the same shape.
- The table adds up: , and is that shape. So the product rule holds in every cell: independent. Different row totals are fine; only the shape must match.
- Answer: option 1.
Numerical Answer Type (NAT).
X and Y are independent, , . Find .
Multiply the two marginals.
- .
- Answer: 0.2
Multiple Select Question (MSQ): select all that apply.
Which of the following joint tables (rows Y, columns X) show independent X and Y?
Test each: zero cell, product of marginals, row shortcut.
- Table 1 (Q1) and table 4 (Example 1) are independent.
- Table 2 has a zero cell with non-zero marginals; table 3 fails at the cell (0,0): 99/576 against 96/576.
- Answer: options 1 and 4.
Independence: Revision Sheet
One page to revise everything in this section.
The big picture
- Events: .
- Variables: every event from X alone is independent of every event from Y alone.
- for all pairs.
- Equivalent: every conditional equals .
- Columns of , rows of ; last column , last row .
- One failing cell means dependent; all cells passing means independent.
- Marginals can be the same for independent and dependent tables.
- Example 3 is independent exactly when .
- Units digit and remainder mod 4: but , so dependent.
- Tens and units digits: independent (extra).
- Zero cell with non-zero row and column totals: dependent.
- Independent exactly when every row is a multiple of the same vector
f_X.
Revision sheet
| Idea | Key point |
|---|---|
| Definition | for all |
| Conditional view | Independent for every |
| Proving independence | Check every cell of the joint table |
| Proving dependence | One failing cell is enough |
| Fast dependence test | A zero cell with non-zero row and column totals |
| Row shortcut | Independent all rows are multiples of the same vector |
| Marginals alone | Never decide independence: many joint PMFs share the same marginals |
Week 2 roadmap
| Chapters | Topic | Where |
|---|---|---|
| 1 to 5 | Independence of two random variables | this note |
| 6 to 10 | Independence of multiple random variables | this note |
| 11 to 16 | Functions of one random variable | this note |
| 17 to 22 | Functions of two random variables and visualization | Week 2 · Part 2 of 2 |
| 23 to 28 | Functions of multiple random variables | Week 2 · Part 2 of 2 |
| 29 to 35 | Sums of random variables and convolution | Week 2 · Part 2 of 2 |
| 36 onwards | Minimum and maximum of random variables (coming) | Week 2 · Part 2 of 2 |
Common mistakes
- Independence needs the product rule at every cell. Dependence needs just one failing cell.
- Independent and dependent tables can share the same marginals. Always compare with the joint table.
- For a cell take its column total times its row total .
- If the whole row or column is 0 the product is 0 as well, so no failure.
- X₁, X₂ independent does not make X₁ and X₁ + X₂ independent.
- Same marginals say nothing about independence.
Independence for n Random Variables
The definition for n variables and the three-tosses example.
Chapters 1 to 5 dealt with two random variables. Often there are three, ten or a hundred (all the tosses of a coin, all the digits of a number). This chapter carries independence over to n random variables.
6.1Definition for n random variables
Let be random variables on one probability space, with the range of written . They are independent if events defined using different are mutually independent. Equivalently:
The joint PMF must split into the product of all n marginals, at every point .
6.2Example: three tosses of a fair coin
6.3Going deeper
- Number of points to check (extra). The product rule must hold at all points: for three tosses, in Try these Q1. This is why a structural argument (separate digits, separate tosses) is much quicker than checking cell by cell.
- Same idea, n tosses (extra). For fair tosses every outcome has probability , and so does the product of factors of . For the outcome (1,0,1,1,0) has probability .
6.4Exam tips and common mistakes
- If the variables come from separate, repeated experiments (tosses, rolls, trials), independence is built in. Say so and multiply.
- To disprove independence of variables find one point where the joint PMF differs from the product.
- Checking only some of the points of the product rule.
- Using only two-at-a-time checks for three or more variables. The next chapters show why that fails.
Practice questions (graded-assignment style)
Numerical Answer Type (NAT).
Five fair coin tosses are independent. What is the probability of the exact outcome (heads, tails, heads, heads, tails)?
Multiply five factors of 1/2.
- .
- Answer: 0.03125
Multiple Choice Question (MCQ): choose the one correct option.
To show are independent from the joint PMF we must check:
The product rule must hold everywhere.
- Option 2 is the definition. Pairwise checks alone are not enough (the next chapters show a counterexample).
- Answer: option 2.
Multiple Select Question (MSQ): select all that apply.
Three fair tosses give as above. Choose the correct statements.
Every outcome has probability 1/8.
- Each of the 8 outcomes has probability , which adds to 1.
- Statement 3 is false: is a single marginal, not the joint value.
- Answer: options 1, 2 and 4.
A Random 3-Digit Number
Two independent pairs and one dependent pair from the digits of a number.
A random 3-digit number is a good test bed: its digits are independent of each other, but quantities built from the same digit are not.
7.1The experiment
A number from 000 to 999 is chosen uniformly at random. Let = first digit from the left, = the number modulo 2, = first digit from the right. Are independent?
- Marginals. , , .
- Pair . Fixing the first and last digit leaves 10 choices for the middle digit, so for every pair: and are independent.
- Pair . Fixing the first digit and the parity leaves 10 middle digits and 5 last digits of the right parity: numbers. So : and are independent.
- Pair . The parity of the number is decided by its last digit. A number ending in 2 is even, so it can never have remainder 1 mod 2: , but . and are dependent.
- Conclusion. Since even one pair fails, are not independent.
7.2Why one dependent pair is enough
If X, Y, Z were independent, then every pair among them would be independent too (Chapter 9 proves this by summing out the third variable). So a single dependent pair, here (Y, Z), rules out independence of the whole collection immediately. There was no need to look at the triple joint PMF at all.
7.3Going deeper
- Rule of thumb (extra). Quantities built from different digits are independent (the digits are chosen independently). Quantities that read the same digit are a warning sign for dependence, as Y and Z both read the last digit.
- But sharing is not a verdict (extra). Take = first digit and . They share the first digit, yet for every pair : independent. The middle digit, which is uniform and independent, scrambles the parity completely. Always compute.
- Why 1000 numbers (extra). 000 to 999 includes numbers like 007 and 042, so every number has exactly three digits and each digit position is uniform.
7.4Exam tips and common mistakes
- Count numbers: fix the variable values, then count how many numbers fit, and divide by 1000.
- To disprove, find an impossible combination like an odd number ending in 2.
- Concluding that all three are independent after checking only (X, Z) and (X, Y).
- Forgetting that "number modulo 2" depends only on the last digit.
Practice questions (graded-assignment style)
Numerical Answer Type (NAT).
For the random number of Example 12, find , the probability that the first digit is 3 and the last digit is 7.
Count numbers of the form 3_7.
- The numbers 307, 317, ..., 397 are 10 numbers, so the probability is
10/1000 = 0.01. - Answer: 0.01
Numerical Answer Type (NAT).
Find : first digit 4 and the number is even.
Fix the first digit, then choose the last digit to be even.
- Middle digit: 10 choices. Last digit: 5 even choices. So
10 × 5 = 50numbers and the probability is50/1000 = 0.05. - Answer: 0.05
Multiple Choice Question (MCQ): choose the one correct option.
In Example 12 which pair is dependent?
Which two variables read the same digit?
- (the parity) and (the last digit) both depend on the last digit: but .
- Answer: option 3.
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements about X, Y, Z of Example 12.
One dependent pair rules out the whole collection.
- Statements 1, 2 and 4 are the three pair results. Statement 3 is false because the pair (Y, Z) is dependent.
- Answer: options 1, 2 and 4.
Even Parity: Pairwise Independent, Not Independent
The key counterexample: every pair unrelated, the triple tightly tied.
Can three variables be such that any two look completely unrelated, and yet the three together are strongly tied? Yes: this is the most important counterexample of the week.
8.1The even parity PMF
Let have the joint PMF below. It is called even parity because every possible outcome contains an even number of 1s. Each (each value appears in two rows). Are independent? Are they pairwise independent?
| 0 | 0 | 0 | 1/4 |
| 0 | 1 | 1 | 1/4 |
| 1 | 0 | 1 | 1/4 |
| 1 | 1 | 0 | 1/4 |
- Every pair is independent. Summing out the third variable, each pair has the same joint table (rows , columns ): every cell is , and every marginal is .
- For , and every cell is .
0 1 0 1/4 1/4 1/2 1 1/4 1/4 1/2 1/2 1/2 1 - But the three together are not independent. Take , which has an odd number of 1s: , while .
In even parity, any two variables look completely unrelated, yet the first two determine the third: .
8.2The direction that does hold
- Independent pairwise independent. Every sub-collection of independent variables is independent.
- Pairwise independent independent. Even parity is a counterexample, and Try these Q2 gives another.
8.3Going deeper
- Conditional view (extra). Given and , the third variable is forced: , whereas . Independence would have said that learning tells nothing about , but here it tells everything.
- Why the pair tables hide it (extra). A pair table only sees two coordinates at a time; the constraint "even number of 1s" lives in all three together.
- Where it appears (extra). Parity checks are used to detect errors in data: the last bit is chosen so that the number of 1s is even, which is exactly this structure.
8.4Exam tips and common mistakes
- To disprove independence of three variables look for a point with joint probability 0 but a positive product (an impossible outcome).
- To show pairwise independence sum out the third variable and test each pair table.
- Believing that "every pair independent" is the same as "independent".
- Forgetting that outcomes with probability 0 are points of the grid too. They must also satisfy the product rule, and an impossible outcome with a positive product (like (0,0,1) in even parity) is the clearest failure.
Practice questions (graded-assignment style)
Numerical Answer Type (NAT).
In the even parity PMF, what is the probability of the outcome (X1, X2, X3) = (1, 1, 0)?
It has two 1s, an even number.
- (1,1,0) is one of the four allowed outcomes, so its probability is
1/4 = 0.25. - Answer: 0.25
Numerical Answer Type (NAT).
In the even parity PMF, what is f(1, 1, 1)?
Count the 1s.
- (1,1,1) has three 1s, an odd number, so it is forbidden: probability 0. An independent triple would give 1/8.
- Answer: 0
Multiple Choice Question (MCQ): choose the one correct option.
For the even parity triple, which statement is true?
Check pairs, then the triple.
- Every pair table has all cells 1/4, so every pair is independent. The triple fails at (0,0,1).
- Answer: option 2.
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements.
Which way does the implication run?
- Statements 1 and 3 are the same fact, used in two directions. Statement 2 is false, and even parity shows it (statement 4).
- Answer: options 1, 3 and 4.
Useful Consequences and Try These
Sub-collections, functions of independent variables, i.i.d., and the two lecture questions solved.
Two useful consequences of independence, the notion of i.i.d. variables, and the two "Try these" questions of the lecture, worked out step by step.
9.1Sub-collections of independent variables
If are independent, then every pair (indeed every sub-collection) is independent: just sum the product formula over the other variables. For three variables, summing out :
The last sum is 1. So one dependent pair immediately rules out independence of the whole collection.
9.2Functions of independent variables
If and are independent, then and are independent for any functions . Reason: for values ,
For example, if and are independent then and are independent, and so are and .
Let and be independent. Check that and are independent at two points.
- for , so ; for , so ; only for , so .
- .
- . The same works for the other points.
P(X = 0, X² = 1) = 0 but P(X = 0) P(X² = 1) = 1/3 · 2/3 = 2/9.9.3i.i.d. variables
Three independent tosses each land heads with probability (so Bernoulli, i.i.d.). Find the probability of the outcome (1, 1, 0).
- By independence multiply the marginals: .
- .
- Because the tosses are identically distributed, the same formula
p^k (1 − p)^(3 − k)works for any outcome with k heads. The 8 values add up to 1.
9.4Try these: worked solutions
A number from 000 to 999 is chosen uniformly at random. Let = the hundreds digit, = the tens digit, and = the remainder when the number is divided by 5. Are independent?
- Describe the number by its digits. Write . Choosing uniformly from 1000 numbers is the same as choosing the digit triple uniformly from triples, each with probability . Here , .
- Simplify . is always a multiple of 5, so depends only on the last digit: , , and so on.
- Marginals. . Each comes from exactly two last digits ( and ), so , .
- Joint PMF. Fix , , . Then , , and must be or : exactly 2 numbers. So .
- Compare. , equal for every : all points.
- Conclude and contrast. are independent. They are built from three different digits. In Example 12, "mod 2" and "last digit" both used the last digit, which created the dependence.
- Answer: yes, X, Y and Z are independent.
Let and be independent, each equal to or with probability . Define . Show that are pairwise independent but not independent.
| 1 | 1 | 1 | 1/4 |
| 1 | −1 | −1 | 1/4 |
| −1 | 1 | −1 | 1/4 |
| −1 | −1 | 1 | 1/4 |
- Joint PMF. takes 4 equally likely values and each determines : the table above.
- Marginals. in two rows and in two rows, so is also with probability each. Same for and .
- Pair is independent by assumption.
- Pair . Given , the event means . So for all four choices of . Independent.
- Pair . The identical argument with the roles of and swapped. Independent.
- All three together. Take . It is impossible, because : .
- Conclude. Every pair is independent, but the triple is not: any two of the values fix the third. This is the same structure as even parity, written with instead of .
- Answer: pairwise independent, but X, Y, Z are not independent.
9.5Exam tips and common mistakes
- Structure first: if every variable comes from its own digit, toss or trial, independence follows without a table.
- To build a "pairwise but not independent" example, let the third variable be a function of the other two that is balanced against each of them separately (parity, product of signs).
- Applying the function rule to two functions of the same variable (X and X²).
- Forgetting that Z = N mod 5 only sees the last digit, so it is independent of the first two digits.
- Using i.i.d. when the tosses are independent but have different biases: identically distributed means the same distribution.
Practice questions (graded-assignment style)
Numerical Answer Type (NAT).
In Try these Q1, what is f_XYZ(a, b, z) for any digits a, b and any z in {0,1,2,3,4}? Give a decimal.
Two numbers out of 1000.
- Exactly two numbers fit:
2/1000 = 0.002 = 1/500. - Answer: 0.002
Numerical Answer Type (NAT).
Let X = hundreds digit, Y = tens digit and W = N mod 2 for a number from 000 to 999. What is f_XYW(a, b, w)? Give a decimal.
The last digit must have the right parity.
- Five last digits have the right parity, so
5/1000 = 0.005 = 1/10 · 1/10 · 1/2: independent, like Q1. - Answer: 0.005
Multiple Choice Question (MCQ): choose the one correct option.
For Z = XY with X, Y independent fair signs, which statement is true?
Each pair is balanced; the triple is constrained.
- Every pair has all cells , but .
- Answer: option 2.
Multiple Select Question (MSQ): select all that apply.
X and Y are independent. Which pairs are guaranteed to be independent?
The rule needs a function of X alone and a function of Y alone.
- Options 1 and 2 are a function of X and a function of Y. Option 3 uses the same variable twice, and option 4 mixes X and Y in both.
- Answer: options 1 and 2.
Numerical Answer Type (NAT).
Three i.i.d. tosses each have . Find the probability of the outcome .
Multiply 0.2, 0.2 and 0.8.
- .
- Answer: 0.032
Many variables: Revision Sheet
One page to revise everything in this section.
The big picture
- at every point.
- Equivalent: events from different variables are mutually independent.
- Example: independent; independent; dependent (both read the last digit).
- One dependent pair rules out the whole triple.
- Every pair independent, triple not: (0,0,1) has probability 0 but product 1/8.
- .
- Independent ⇒ every sub-collection independent ⇒ pairwise independent.
- Pairwise independent does not imply independent.
- .
- Not for two functions of the same variable.
- Q1: independent (joint at all 500 points).
- Q2: Z = XY is pairwise independent but not independent.
Revision sheet
| Idea | Key point |
|---|---|
| Definition | at every point |
| Independent ⇒ pairwise | Every sub-collection of independent variables is independent |
| Pairwise ⇏ independent | Even parity and Z = XY are counterexamples |
| Disproving | One dependent pair, or one failing point, is enough |
| Functions | |
| i.i.d. | Independent and identically distributed |
At every point
Mutually independent events
3-digit number
Q1: 1/500 everywhere
One failing point
Impossible outcome
Pairwise ⇏ independent
Z = XY with signs
Third is fixed by two
i.i.d. variables
Sum out to get pairs
Common mistakes
- Pairwise independence is weaker. Even parity and Z = XY pass every pair test and still fail the triple.
- For n variables the product rule is needed at every point of the grid.
- Variables reading the same digit (parity and last digit) are dependent. Compute, do not assume.
- The function rule is for a function of X and a function of Y, not X and X².
- i.i.d. needs both: independence and one common distribution.
- A point with joint probability 0 but a positive product is the quickest proof of dependence.
Seeing a PMF: Stem Plots
If X is random so is g(X). Stem plots show which values are possible and which are likely.
If is a random variable, so is : once is random, anything computed from it is random too. This chapter answers the question: what is the PMF of ? First we need a good way of looking at a PMF.
11.1Stem plots
11.2Two reference distributions
Two distributions are used through the whole part, so it helps to know both well.
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 10 | 45 | 120 | 210 | 252 | 210 | 120 | 45 | 10 | 1 | |
| Uniform | 1/11 | 1/11 | 1/11 | 1/11 | 1/11 | 1/11 | 1/11 | 1/11 | 1/11 | 1/11 | 1/11 |
| Binomial | 1/1024 | 10/1024 | 45/1024 | 120/1024 | 210/1024 | 252/1024 | 210/1024 | 120/1024 | 45/1024 | 10/1024 | 1/1024 |
- Binomial:
X = 5is the most likely value (252/1024); then 4 and 6 (210/1024 each); 3 and 7 (120/1024); and 0 and 10 are the least likely (1/1024 each). - Check: the binomial numerators add up to 1024 (they are the row of Pascal's triangle), and the eleven uniform stems add up to 1.
11.3Reading a stem plot
For both reference distributions find and say which value of is most likely.
- Uniform: the stems at 8, 9, 10 each have height , so . All values tie for most likely.
- Binomial: add the stems at 8, 9, 10: .
- The most likely binomial value is , the tallest stem, with .
11.4Going deeper
- Stems are not the whole story (extra). A stem plot only shows heights. To get a probability of several values, add stems. To get the shape of the distribution of Y, we need to know which stems of X land where: that is the table method of the next chapter.
- Symmetry (extra). The binomial stems are mirror images about X = 5:
P(X = k) = P(X = 10 − k). This symmetry is what produces the pile-up pairs in the many-to-one example.
11.5Exam tips and common mistakes
- Keep the binomial numerators 1, 10, 45, 120, 210, 252 in mind; they are reused in every example of this chapter.
- Always check that your probabilities add up to 1 (or the numerators to 1024).
- Reading a stem height as a value of X. The horizontal position is the value; the height is the probability.
- Writing the binomial probabilities without the 1024 denominator.
Practice questions (graded-assignment style)
Numerical Answer Type (NAT).
For , what is ?
.
- , so the answer is 120.
- Answer: 120
Numerical Answer Type (NAT).
For find .
Count the stems at 8, 9, 10.
- Three stems of height 1/11, so the probability is 3/11 and the answer is 3.
- Answer: 3
Multiple Choice Question (MCQ): choose the one correct option.
Which distribution has a stem plot with all stems of the same height?
Recall the two reference plots.
- The uniform gives every value the same probability, 1/11. The binomial is bell-shaped.
- Answer: option 2.
Multiple Select Question (MSQ): select all that apply.
For choose the correct statements.
Symmetry about 5.
- P(X = 0) is 1/1024 but P(X = 5) is 252/1024, so statement 3 is false. The others are true.
- Answer: options 1, 2 and 4.
The Table Method
How to find the PMF of any function of a random variable.
Given the PMF of , the table method finds the PMF of for any function , one-to-one or many-to-one.
12.1The method
To find the distribution of :
- Step I. Make a table with columns , and .
- Step II. Read off the range of (the distinct values in the column), and for each add up the probabilities of all rows with that :
It is simple, works for any function, and makes mistakes easy to spot: every row of X must appear in exactly one group, so the final probabilities must still add up to 1.
12.2A small worked example
takes the values with probabilities . Find the PMF of .
| −1 | 0.2 | 1 |
| 0 | 0.5 | 0 |
| 1 | 0.3 | 1 |
- Step I: the table above.
- Step II: the range of is .
- (two rows give ).
- .
- Check:
0.5 + 0.5 = 1.
12.3Going deeper
- Values outside the range (extra). If is not in the range of , then : no row of the table produces it.
- The range can be smaller (extra). Y never has more distinct values than X. It has the same number exactly when g is one-to-one on the values of X.
- Two kinds of function. One-to-one functions only move the probabilities (Chapter 13). Many-to-one functions make probabilities pile up (Chapter 14).
12.4Exam tips and common mistakes
- Always write the full table, even when it is long. Then colour or tick the rows by their y value before adding.
- Finish by adding all the new probabilities: the total must be 1.
- Listing the same y twice in the answer instead of merging its rows.
- Forgetting a row, so the total is less than 1.
Practice questions (graded-assignment style)
Numerical Answer Type (NAT).
takes with probabilities . Find .
Which give ?
- x = −1 and x = 1: 0.2 + 0.3 = 0.5.
- Answer: 0.5
Numerical Answer Type (NAT).
is uniform on . How many distinct values does take?
Square each value.
- The squares are 1, 4, 9, 16: all different, so 4 values, each with probability 1/4.
- Answer: 4
Multiple Choice Question (MCQ): choose the one correct option.
In the table method, P(Y = y) equals:
Add the rows that land on y.
- Option 2 is the general formula; it reduces to P(X = x) when exactly one x gives y.
- Answer: option 2.
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements.
Every row of X lands in exactly one group.
- The range of Y has at most as many values as the range of X, so statement 3 is false.
- Answer: options 1, 2 and 4.
One-to-One Functions
The probabilities stay; only their locations move.
If different always give different , each comes from exactly one , so . The probabilities are unchanged; they just move to new locations.
13.1Example: Y = X − 5
13.2Example: Y = 2X
Y = 2^X. Plain Y = 2X would give the values 0, 2, 4, ..., 20. The method is the same, and the note uses 2^X as in the table.A one-to-one function never changes the list of probabilities; it only changes where they sit. Shifting () keeps the spacing; a non-linear map like squashes small values together and spreads large ones apart.
13.3Going deeper
- Reflection (extra). For the stems are mirrored: . Still one-to-one, so probabilities are unchanged. The binomial is symmetric, so its picture looks the same.
- One-to-one on the values that occur (extra). is not one-to-one on all integers, but it is one-to-one on : the values 1, 4, 9, 16 are all different, so .
- Summing a shifted PMF (extra). The sum of all probabilities is still 1: no stem is added or removed.
13.4Exam tips and common mistakes
- If a question asks for P(Y = y) with a one-to-one g, solve g(x) = y for x and read P(X = x).
- Check one-to-one by listing the y values: if all are different, you are done.
- Changing the probabilities along with the locations. They stay exactly the same.
- Assuming a non-linear map keeps equal spacing.
Practice questions (graded-assignment style)
Numerical Answer Type (NAT).
and . What is ?
Which x gives y = −2?
- comes from , and .
- Answer: 120
Numerical Answer Type (NAT).
and . What is ?
.
- means , whose probability is .
- Answer: 252
Multiple Choice Question (MCQ): choose the one correct option.
A one-to-one function g is applied to X. What changes in the PMF?
One x for each y.
- The same probabilities sit at the new locations g(x).
- Answer: option 2.
Multiple Select Question (MSQ): select all that apply.
is Uniform. For which is still uniform on 11 values?
Which maps are one-to-one on 0, ..., 10?
- is many-to-one (4 and 6 both give 1), so the result is not uniform on 11 values.
- Answer: options 1, 2 and 4.
Many-to-One Functions
Probabilities pile up and the shape of the PMF can change.
When several values map to the same , their probabilities pile up on that . The shape of the PMF can change completely.
14.1Example: Y = (X − 5)²
14.2Another many-to-one example
Find the PMF of for the uniform, and of for the binomial.
- Uniform, mod 3. from : 4 values; from : 4 values; from : 3 values. So and (total ).
- Binomial, mod 2. when is even: , so too. (Even and odd numbers of heads are equally likely.)
14.3Going deeper
- Unevenness appears (extra). The uniform input had equal stems, but the output stems are 1/11 and 2/11. The more x values collapse onto one y, the taller its stem.
- Information is lost (extra). From Y = 1 alone you cannot tell whether X was 4 or 6. A one-to-one function loses nothing; a many-to-one function does.
- Symmetric input, folded output (extra). Because the binomial is symmetric about 5, squaring the distance from 5 folds the plot in half and doubles every stem except the one at 0.
14.4Exam tips and common mistakes
- Circle matching y values in the table before adding, so no row is missed or used twice.
- Mention which x values feed each y, as in "P(Y = 1) = P(X = 4) + P(X = 6)".
- Doubling y = 0 as well. It comes from the single value x = 5.
- Leaving the uniform answer as 1/11 each because the input was uniform.
Practice questions (graded-assignment style)
Numerical Answer Type (NAT).
, . What is ?
Which x give y = 4?
- and : .
- Answer: 240
Numerical Answer Type (NAT).
is uniform on and . What is ?
x = 0 and x = 10.
- Two values of give , each with probability : , so the answer is 2.
- Answer: 2
Multiple Choice Question (MCQ): choose the one correct option.
For the binomial and , the most likely value of is:
Compare 252, 420, 240, 90, 20, 2.
- P(Y = 1) = 420/1024 is the largest. P(Y = 0) = 252/1024 comes from the single value x = 5.
- Answer: option 2.
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements about with uniform .
Count the x values for each y.
- P(Y = 0) = 1/11 and the others are 2/11, so Y is not uniform on its range (statement 3 is false).
- Answer: options 1, 2 and 4.
Try These: Clipping Functions
The two lecture questions solved step by step.
The two "Try these" questions of the lecture, solved step by step. Both are clipping functions: everything beyond a cut-off collapses onto one value.
15.1Try these Q1
Let and for , for . Find the distribution of .
- PMF of . There are 11 values from to , so for each.
- Table method. Rows
x = −5, ..., 5each with 1/11;y = 0for the six values −5 to 0, andy = xfor 1 to 5. - Range of . The distinct values are .
- Add up probabilities for each . The value comes from six values ( to ); each positive comes from exactly one : , and for .
- Check. . ✓
| 0 | 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|---|
| 6/11 | 1/11 | 1/11 | 1/11 | 1/11 | 1/11 |
is many-to-one on the non-positive values (they all collapse to 0) and one-to-one on the positive values. Answer: and for .
15.2Try these Q2
Let and . Find the distribution of .
- PMF of . The values run from to : that is values, so .
- Understand . replaces anything below 5 by 5 and leaves values of 5 or more unchanged.
- Range of . .
- Count how many give . Every from to inclusive: values, so .
- The other values. Each comes only from , so .
- Check. There are such values: . ✓
- Answer: P(Y = 5) = 506/1001, and P(Y = y) = 1/1001 for y = 6, 7, ..., 500.
The stem plot of Y is one very tall stem at 5 (just over half the probability) followed by a flat run of tiny stems.
15.3Going deeper
- Clipping is everywhere (extra). max(X, c) models a floor (for example a minimum charge) and min(X, c) models a cap. In both, a whole tail of values collapses onto one value, which gets a big stem.
- Counting the collapsed values (extra). When the values are consecutive integers from a to b, there are
b − a + 1of them. That is why the count is 5 − (−500) + 1 = 506 here and not 505. - Cap example (extra). For X uniform on {1, ..., 10} and Y = min(X, 4): Y = 1, 2, 3 each have 1/10, and Y = 4 has 7/10 (x = 4, ..., 10).
15.4Exam tips and common mistakes
- For clipping, find the cut-off value first, then count how many x values are at or beyond it.
- Test your answer by adding all probabilities: 506 + 495 = 1001.
- Off-by-one errors when counting the collapsed values (506, not 505).
- Giving the clipped value the probability of one x only.
Practice questions (graded-assignment style)
Numerical Answer Type (NAT).
X is uniform on {1, 2, ..., 10} and Y = min(X, 4). Find P(Y = 4).
Which x give y = 4?
- x = 4, 5, ..., 10 are 7 values, so P(Y = 4) = 7/10 = 0.7.
- Answer: 0.7
Numerical Answer Type (NAT).
is uniform on and . What is ?
x = 3 and x = −3.
- Two values of x give y = 3, so P(Y = 3) = 2/11 and the answer is 2.
- Answer: 2
Numerical Answer Type (NAT).
In Try these Q1, what is ?
Count x from −5 to 0.
- Six values of x collapse to 0, so P(Y = 0) = 6/11.
- Answer: 6
Numerical Answer Type (NAT).
In Try these Q2, what is 1001 × P(Y = 5)?
Count x from −500 to 5.
- 5 − (−500) + 1 = 506 values collapse to 5.
- Answer: 506
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements about Y = max(X, 5) for X uniform on {−500, ..., 500}.
Range 5, ..., 500 has 496 values.
- Y is not uniform: one value has probability 506/1001 and the rest 1/1001.
- Answer: options 1, 2 and 3.
Functions of one variable: Revision Sheet
One page to revise everything in this section.
The big picture
- A stem of height at each value .
- Uniform: flat stems. Binomial(10, 0.5): bell-shaped, tallest at 5.
- Columns , , ; group rows by .
- .
- Same probabilities, new locations: .
- slides the stems; spreads them unevenly.
- Probabilities pile up and the shape can change.
- : uniform becomes 1/11, 2/11, ...; binomial mode moves to 1.
- : every value beyond the cut collapses onto one value.
- Q1: 6/11 at 0. Q2: 506/1001 at 5.
Revision sheet
| Idea | Key point |
|---|---|
| Stem plot | A stem of height at each value |
| Table method | Columns ; group rows by |
| General formula | |
| One-to-one | Same probabilities, new locations: |
| Many-to-one | Probabilities pile up; the shape of the PMF can change |
| Clipping, e.g. | All values beyond the cut collapse onto one value |
Uniform is flat
Binomial is a bell
Group by y
Add probabilities
Every row used once
2^X stretches
Probabilities unchanged
Pairs add up
Shape changes
max(X, 5): 506/1001
Common mistakes
- Add only the rows with the same y. Check that every row of X is used exactly once.
- They stay the same; only the locations move.
- In (X − 5)², y = 0 comes from the single value x = 5.
- From a to b inclusive there are b − a + 1 values (506, not 505).
- A many-to-one function can make the output uneven, as in 1/11, 2/11, ...
- The final PMF must add up to 1; if not, a row was missed or counted twice.