In one sentence
The principle of classification: let be the whole collection of objects you are studying. Split it into classes that are pairwise disjoint and whose union is (a partition of ), then deal with the classes one at a time.
Classifying is not hard in itself; the hard part is choosing the criterion. A good criterion passes one test: once you know which class an object is in, you can decide the question you are asking. The workbench above counts “pairs whose sum is a multiple of ”, and only one of the three criteria passes this test.
Count the pairs from 1–12 whose sum is a multiple of 3
Step 1 / 4- Brute force
There are pairs; checking them one by one gives . A computer can do this, a person cannot, and once is large it gets out of hand.
Stop 1 · Divisibility: classify by remainder
In how many ways can you choose two numbers from whose product is a multiple of ? Classifying by parity seems natural, but in the “odd·even” cell fails while works. What should you classify by to make it clean?
Classifying by remainder mod makes it clean. But there are so many ✓ cells that adding them up is tiring. It is easier to count the pairs that fail instead: the product is not a multiple of only for “two odd numbers” ( pairs) or “an odd number with a number that leaves mod ” ( pairs). So the answer is .
Stop 2 · Equations: classify by sign
Absolute value is defined piecewise, so equations with absolute values call for cases: the zeros cut the number line into pieces, and on each piece every absolute value can simply be removed.
Predict first
How many real solutions does have?
The zeros are and , giving three pieces:
- : gives , which lies in this piece ✓.
- : , no solution.
- : gives ✓.
There are solutions: or . Geometrically, is the sum of the distances from to and to . It is constantly on the middle piece and only grows outside it.
The you find on each piece only counts if it lies in that piece. This is the check most often forgotten in case analysis.
Stop 3 · Counting: classify by the largest element
In how many ways can you choose numbers from ? The answer is of course , but classifying by “what the largest number is” gives an identity:
Classify by the largest element
Step 1 / 3- Classify
The largest of the three numbers can only be one of . Splitting by it gives classes, with nothing left out and nothing counted twice.
The same objects counted in two ways: this is the seed of “counting in two ways”. The largest element is chosen as the criterion precisely because, once it is fixed, the remaining choices no longer depend on each other.
Practice
In how many ways can you choose two different numbers from whose sum is a multiple of ?
Solve .
In how many ways can you choose two different numbers from such that is a multiple of ?
In how many ways can you choose different numbers from whose sum is a multiple of ?