Sub topic 8
Casework and Organised Listing
This chapter assumes you know basic counting (factorials, combinations), divisibility, remainders and simple linear equations. It also assumes you have read the earlier chapters on parsing a question and using integer conditions. Here we cover what to do when no single formula finishes the problem and you have to split it into cases and list the outcomes in an orderly way.
Why casework matters for TITA
A TITA question gives you no options to test against. When a question asks "how many", "what is the sum of all possible values" or "what is the largest value", the answer is often a count or a sum over several situations. Casework splits the problem into smaller situations that you can solve one at a time. Organised listing makes sure you do not miss a situation or count one twice.
Casework is a good fit when:
- the question has a condition like "or", "at least" or "at most";
- a variable can take only a small set of values after you apply bounds;
- a formula exists but only for part of the range (for example, the sign of an expression changes);
- the numbers are small enough that a list of 10 to 30 items is realistic.
It is a poor fit when the list could run past about 40 items. In that case, look for a formula or a symmetry first.
The three rules of a good case split
A case split is only useful if it is correct. Check these three rules before you start.
- Exhaustive. Together the cases cover every possibility.
- Mutually exclusive. No outcome falls into two cases. If it does, you will count it twice.
- Easy inside. Each case is simpler than the original problem. If a case is as hard as the whole problem, choose a different split.
Choosing what to split on
Good split variables are usually:
- The most restricted variable. If one variable can take only 4 values, split on it.
- A digit position. For digit problems, split on the first digit or the last digit, because those carry the special rules (no leading zero, or divisibility by 2, 5 or 10).
- A remainder class. For divisibility questions, split by remainder modulo a small number.
- A sign or range. For absolute values and inequalities, split at the point where the expression changes sign.
- A size order. For problems with identical items or ordered triples, assume an order such as a ≤ b ≤ c and then adjust for arrangements.
Worked example 1: Counting with a restricted digit
Question. How many three-digit numbers with distinct digits are divisible by 5?
A number is divisible by 5 only if it ends in 0 or 5. Split on the last digit. The two cases are exhaustive and exclusive.
Case 1: last digit is 0. The hundreds digit can be any of 1 to 9, which is 9 choices. The tens digit can be any of the remaining 8 digits (10 digits minus the 0 and the hundreds digit). That gives 9 × 8 = 72.
Case 2: last digit is 5. The hundreds digit cannot be 0 or 5, so it has 8 choices. The tens digit cannot be the 5 or the hundreds digit, but it can be 0, so it has 8 choices. That gives 8 × 8 = 64.
Total = 72 + 64 = 136.
The edge case here is the zero. It is allowed in the tens place but not in the hundreds place. Splitting on the last digit made that visible. If you had started with the hundreds digit, you would have had to track whether 0 or 5 was already used, which is messier.
You can confirm the count with a short program.
count = 0
for n in range(100, 1000):
s = str(n)
if len(set(s)) == 3 and n % 5 == 0:
count += 1
print(count) # 136Worked example 2: Casework on absolute values
Question. How many integer values of x satisfy |x − 3| + |x + 2| = 9?
The expression changes form at x = 3 and x = −2. These points split the number line into three ranges.
| Range | Column | x − 3 | Column | Column | x + 2 | Column | Equation | Solution |
|---|---|---|---|---|---|---|---|---|
| x ≥ 3 | x − 3 | x + 2 | 2x − 1 = 9 | x = 5 (valid, since 5 ≥ 3) | ||||
| −2 ≤ x < 3 | 3 − x | x + 2 | 5 = 9 | No solution | ||||
| x < −2 | 3 − x | −x − 2 | 1 − 2x = 9 | x = −4 (valid, since −4 < −2) |
There are 2 integer solutions: x = 5 and x = −4.
Two points matter here. First, always check that a solution lies inside the range of its case. A value that solves the equation but falls outside the range is not a solution. Second, the middle case gives a constant (5), which means the sum can never reach 9 there. This also tells you the minimum value of the expression is 5.
Worked example 3: Organised listing with a sum constraint
Question. In how many ways can you pay exactly 50 using coins of 5, 10 and 20, where you must use at least one coin of each type and the order of coins does not matter?
Let the numbers of coins be a, b and c for 5, 10 and 20. Then 5a + 10b + 20c = 50, which simplifies to a + 2b + 4c = 10, with a, b, c ≥ 1.
Split on c, the variable with the fewest options. Since 4c ≤ 10 − 1 − 2 = 7, c can only be 1.
- c = 1: a + 2b = 6, with a, b ≥ 1. Then b = 1 gives a = 4, and b = 2 gives a = 2. The value b = 3 would give a = 0, which is not allowed.
So there are 2 ways: (a, b, c) = (4, 1, 1) and (2, 2, 1).
Notice how the bound did most of the work. Before listing anything, we used the "at least one of each" condition to cut c down to a single value. Combine casework with the integer conditions from the previous chapter whenever you can.
Organised listing: techniques that prevent misses
Listing is where most casework errors happen. These habits help.
- Fix an order. List by the smallest variable first, then the next. For example, list (a, b, c) with a ≤ b ≤ c in increasing order of a.
- Use a table. Put the split variable down the left and the solved quantity across the top. Gaps and repeats are easier to see.
- Write the stopping rule. Before you start, state why the list ends (for example, "b ≤ 3 because 2b ≤ 6").
- Count each case separately, then add. Do not merge cases mentally.
- Convert ordered to unordered carefully. If you count ordered triples, divide only when all items are distinct. If two items are equal, the number of arrangements is smaller.
Ordered and unordered outcomes
Suppose you need positive integer triples (x, y, z) with x + y + z = 8 where order does not matter. List with x ≤ y ≤ z:
| x | y | z |
|---|---|---|
| 1 | 1 | 6 |
| 1 | 2 | 5 |
| 1 | 3 | 4 |
| 2 | 2 | 4 |
| 2 | 3 | 3 |
There are 5 unordered triples. If the question asked for ordered triples, you would count the arrangements of each row: 3, 6, 6, 3 and 3, which add up to 21. The stars-and-bars formula gives C(7, 2) = 21, which matches. This is a useful check: a formula and a list should agree.
Using a formula inside cases
Casework does not replace formulas. It lets you apply a formula where it is valid. Consider the inclusion-exclusion count from the plan: how many integers from 1 to 100 are divisible by 3 or 5?
- Divisible by 3: 33
- Divisible by 5: 20
- Divisible by both (that is, by 15): 6
The two sets overlap, so you subtract the overlap once: 33 + 20 − 6 = 47. This is the "exclusive cases" rule applied to sets. The same 47 can be built from three disjoint cases: only 3 (27), only 5 (14) and both (6), and 27 + 14 + 6 = 47.
count = sum(1 for n in range(1, 101) if n % 3 == 0 or n % 5 == 0)
print(count) # 47Common errors
- Overlapping cases. Splitting "even" and "multiple of 3" as if they were separate cases counts multiples of 6 twice. Fix the overlap or split into "even only", "multiple of 3 only" and "both".
- Missing the boundary. In absolute value problems, the boundary points (x = 3 and x = −2 above) belong to exactly one case. Decide which one and stay consistent.
- Forgetting the special value. Zero, one and repeated values often need their own case, especially in digit problems and in problems with identical objects.
- Not checking the case condition. A solution found inside a case must satisfy that case's range.
- Stopping too early. A list that looks complete after three items may have a fourth. Use the stopping rule.
- Casework on a problem with a clean formula. If the question is a straight stars-and-bars count, listing 36 triples wastes time.
When to stop listing and switch method
Casework costs time, and the exam is timed. Use this rule of thumb.
- Estimate the size of the list before you begin. If the bound shows about 10 items or fewer, list them.
- If it is 10 to 30 items, list them only if each item is quick to produce, such as in a table with one formula per row.
- If it is more than 30, look for a pattern (an arithmetic progression, a symmetry, a formula) and count the pattern.
Many lists turn into arithmetic progressions. For example, if the solutions to a + 2b = 40 with a, b ≥ 1 are b = 1, 2, ..., 19 (since a = 40 − 2b ≥ 1 gives b ≤ 19), then the count is simply 19 with no list needed.
Checking a casework answer
Before entering the number, run at least one of these checks.
- Recount by a different split. In example 1, split on the hundreds digit instead and see whether you still get 136.
- Use a formula as a cross-check. The stars-and-bars result of 21 matched the ordered list above.
- Test the smallest case. Shrink the problem (two-digit numbers instead of three-digit) and check that your method gives the correct small answer.
- Use a short program when practising, as with the code blocks above. In the exam you have no computer, so practise until your hand check is reliable.
Exercise
How many positive integer solutions (x, y) satisfy 3x + 5y = 62 where x and y are both at least 1?
Show answer
Rewrite as 3x = 62 − 5y. The value 62 − 5y must be positive and divisible by 3. Since 62 leaves remainder 2 when divided by 3 and 5y leaves remainder 2y, we need 2y ≡ 2 (mod 3), so y ≡ 1 (mod 3). Also 5y < 62 gives y ≤ 12. The values of y are 1, 4, 7, 10. Check: y = 1 gives x = 19; y = 4 gives x = 14; y = 7 gives x = 9; y = 10 gives x = 4. All are positive integers. The answer is 4.
Exercise
How many integer values of x satisfy |x − 1| + |x − 6| = 7?
Show answer
The boundary points are 1 and 6. For x ≥ 6, the equation is 2x − 7 = 7, so x = 7, which is valid. For 1 ≤ x < 6, the sum is 5, so there is no solution. For x < 1, the equation is 7 − 2x = 7, so x = 0, which is valid. The answer is 2 (x = 0 and x = 7).
Exercise
How many four-digit numbers with distinct digits end in 0 and have a hundreds digit greater than the thousands digit? Split on the thousands digit.
Show answer
The number has the form T H U 0 with T from 1 to 9, H > T, and U different from T, H and 0. For a given T, H can take 9 − T values (H from T + 1 to 9). Then U can be any digit other than 0, T and H, which gives 7 choices. The count for each T is 7 × (9 − T). Summing for T = 1 to 8 (T = 9 gives 0): 7 × (8 + 7 + 6 + 5 + 4 + 3 + 2 + 1) = 7 × 36 = 252. The answer is 252.