Method stop · When and why do we use it?

The Principle of Classification

In the Chinese book: 分类原则

Split a messy whole into disjoint classes; the art is choosing the criterion.

📖 Chapter 7 of 《集合》M7 Parity lineM14 Coloring line

Before this stop, visit:Properties of Sets (Concept)

One idea, one pictureFirst, without classifying, see what the computer gets by checking every pair. Then try the three classifications. Which one makes every cell just ✓ or ✗?

Loading figure…

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
Loading figure…
  1. 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?

Loading figure…
Classify by remainder mod , and every cell can be decided.

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?

Choose an answer first; then you can see the result.

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
  1. 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

Exercise 1Basic

In how many ways can you choose two different numbers from whose sum is a multiple of ?

Exercise 2Basic

Solve .

Exercise 3Advanced

In how many ways can you choose two different numbers from such that is a multiple of ?

Exercise 4Challenge

In how many ways can you choose different numbers from whose sum is a multiple of ?

Mistake Museum · Exhibits from this stop

Before you leave, look at the traps other people fell into here.See every exhibit in the museum →

Exhibit

Leaving out the boundary points in a case split

The wrong step: Solve . When : …; when : …; when : …
What went wrong? Think first, then open

Diagnosis and belong to no case: something is left out. And this equation holds at every point of , including both endpoints, so leaving them out gives a wrong answer.

The right step: The cases must cover everything: , , . A boundary point may go on either side, but it must go on one side, and only one.

“Nothing left out (the union is everything); nothing counted twice (the classes are pairwise disjoint)”

Exhibit

Mixing two criteria, so the classes overlap

The wrong step: Split into the two classes “even numbers” and “multiples of ”, count each, and add.
What went wrong? Think first, then open

Diagnosis are both even and multiples of , so they are counted twice; and are in neither class. This is not a partition.

The right step: Use one criterion at a time (for example, “the remainder on division by ”), or handle the overlap with inclusion–exclusion.

“One classification, one criterion”