foundation23 min studyLesson 116 in Mathematics

Finite cardinality: force a collision without locating it

Use injections and occupancy bounds to prove that some category must contain several objects.

On this page

What you’ll understand

  • State the finite pigeonhole principle as a claim about functions.
  • Apply the ceiling occupancy bound with explicit objects and boxes.
  • Use residues or intervals as deliberately chosen categories.

You can know a duplicate must exist before finding it. If seven records receive only six available labels, some label is reused, regardless of the assignment procedure. The pigeonhole principle turns limited capacity into an existence proof. Its power comes from choosing useful categories: remainder classes, intervals, possible sums, or signatures. Naming the objects, the boxes, and the assignment usually does more work than the final inequality.

Finite size forbids an impossible injection

A finite set has size n when it can be bijected with n standard positions. If more than n objects are assigned to n positions, the assignment cannot be injective: at least two objects share a position. The conclusion is unavoidable but nonconstructive in a practical sense. It identifies neither the repeated position nor the pair unless the argument is supplemented with a search. It also gives no probability distribution over which collision occurs.

The finite restriction is essential. An infinite set can be bijected with a proper subset, as doubling matches natural numbers with even natural numbers. For finite sets, deleting even one element strictly decreases size. This distinction explains why finite capacity arguments need a genuine finite bound on their categories; saying an unbounded process uses integers is not enough to force a repeated integer. State both the size comparison and the function connecting the two sets.

∣A∣>∣B∣,A,B finite,f:A→B⟹∃x≠y in A: f(x)=f(y)|A|>|B|,\quad A,B\text{ finite},\quad f:A\to B\quad\Longrightarrow\quad \exists x\ne y\text{ in }A:\ f(x)=f(y)
When the domain is larger than the finite codomain, every assignment has a collision. No randomness is assumed.↔ Scroll wide equations horizontally.

Raise the occupancy guarantee

If N objects occupy m possible boxes, with m positive, at least one box contains the ceiling of N divided by m objects. To prove it, suppose all occupancies were smaller than that integer bound and add their capacities. The resulting total would be too small. A particularly convenient version says that more than km objects force some box to contain at least k plus one. The strict inequality matters exactly at the threshold.

The bound is sharp when objects can be distributed as evenly as possible. For ten objects in three boxes, occupancies four, three, and three show that four is guaranteed but five is not. A guarantee is a worst-case claim across every assignment, not an average outcome. Empty boxes are allowed; saying there are m boxes does not assert every box is occupied. Their existence only supplies an upper bound on the number of possible categories.

max⁡1≤i≤mni≥⌈Nm⌉,ni∈Z≥0,∑i=1mni=N,m≥1\max_{1\le i\le m}n_i\ge\left\lceil\frac Nm\right\rceil,\qquad n_i\in\mathbb Z_{\ge0},\quad \sum_{i=1}^{m}n_i=N,\quad m\ge1
The occupancies sum to N. Their maximum cannot be smaller than the ceiling of their mean.↔ Scroll wide equations horizontally.

Design boxes that encode the desired conclusion

Remainders make useful boxes because equal remainders imply divisibility of a difference. Among any six integers, two have the same remainder modulo five, so their difference is divisible by five. Intervals make another choice: divide a bounded range into short pieces, and two points sharing a piece must be close. Assign boundaries carefully so each object enters exactly one box, for example by using half-open intervals except at the final endpoint.

Sometimes the objects to classify are derived quantities rather than the original inputs. Partial sums turn a consecutive-sum problem into a comparison of two sums. If two partial sums share a remainder, their difference is a consecutive block with the desired divisibility. Before invoking the principle, ask what equality of category labels would mean. If sharing a box does not imply the target property, the count may be correct but the proof still misses its goal.

A consecutive block divisible by five

Show that any list of five integers has a nonempty consecutive block whose sum is divisible by five.

  1. Form the five partial sums s1 through s5, where sj is the sum of the first j entries. If any partial sum has remainder zero modulo five, its initial block already works.

  2. Otherwise all five partial sums lie in only four remainder classes: 1, 2, 3, and 4. By the pigeonhole principle, two partial sums si and sj share a remainder, with i < j.

  3. Subtract the earlier partial sum from the later one. The difference is exactly entries i + 1 through j, a nonempty consecutive block, and equal remainders make that difference divisible by five.

The result

A suitable block exists for every integer list, including lists with negative entries. The proof supplies a way to search via partial-sum remainders.

Explore the model

Interactive lab

Interactive lab · reliability

Check a finite threshold precisely

Change replica count n and unavailable count k, and predict whether the remaining n − k replicas meet floor(n/2) + 1. Compare odd and even n at the boundary. This is a deterministic finite-count exercise like a pigeonhole threshold; the lab does not assign arbitrary objects to boxes or establish replication consistency from a majority count.

Check a finite threshold preciselyA replica count and a majority threshold, without a consensus protocol. Playback highlights fixed replica states. Having a majority alone does not establish linearizability, durability or failure independence. Current readings: Available replicas: 4 of 5; Majority needed: 3; Majority available?: Yes. All parameters are adjustable with the labeled controls below.Majority available · need 3 of 5Playback highlights fixed statesR1 · upR2 · upR3 · upR4 · upR5 · downCyan mark: majority threshold
AvailableUnavailableMajority threshold
Available replicas
4 of 5
Majority needed
3
Majority available?
Yes
t = 0 s

A replica count and a majority threshold, without a consensus protocol. Playback highlights fixed replica states. Having a majority alone does not establish linearizability, durability or failure independence. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forThe exact integer threshold, including rounding and strict inequalities, determines a finite guarantee.

Check your understanding

What is the fewest objects that guarantees a box with at least five objects when there are six boxes?

Try it yourself

Prove that among any nine integers, three have pairwise differences divisible by four. Show that eight integers need not guarantee such a triple.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Use the four remainder classes and construct occupancies two per class for the boundary example.

Compare with the solution

Assign each integer its remainder modulo four. Nine objects in four boxes force one occupancy at least ceiling(9/4) = 3. Any two integers in that box have a difference divisible by four, so the selected triple has the stated property. For sharpness, the eight integers 0 through 7 have exactly two in each remainder class, so no three share a remainder and no required triple exists.

Take it with you

  • State the objects, finite boxes, and assignment before using a capacity argument.
  • The ceiling of average occupancy gives a sharp worst-case lower bound.
  • Useful categories make a shared label imply the property you want to prove.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.