KonkurStudy
همه کارت‌ها

Pigeonhole Principle (Residues and Parity)

If n+1n+1 items land in nn boxes, some box holds two; generalized, NN items force a box with ⌈N/n⌉\lceil N/n \rceil — the engine behind "smallest forcing nn" exam problems via residue/parity coloring.

کارت مفهوم کنکور ارشد علوم کامپیوتر

اهمیت
۰/۵

The principle

Basic form. If n+1n+1 objects are placed into nn boxes, at least one box contains ≥2\ge 2 objects.

Generalized (strong) form. If NN objects are placed into nn boxes, some box contains at least

⌈Nn⌉\left\lceil \frac{N}{n} \right\rceil

objects. Equivalently, to keep every box at ≤k\le k you can store at most knkn objects; the (kn+1)(kn+1)-th object forces a box to reach k+1k+1.

How exam problems use it

Most konkur pigeonhole questions ask for the smallest nn so that every nn-element subset of {1,…,m}\{1,\dots,m\} is guaranteed to contain a special configuration. The reliable recipe:

  1. Color (find the boxes). Translate the arithmetic condition into a finite invariant — a residue class mod qq or a parity — so the condition becomes "kk items share a color."
  2. Build the largest bad set. A subset is bad (avoids the configuration) iff it takes at most k−1k-1 items from each color class. Its maximum size is ∑classesmin⁡(class size, k−1)\sum_{\text{classes}} \min(\text{class size},\, k-1).
  3. Add one. The smallest forcing value is

 n=(max bad size)+1 .\boxed{\,n = (\text{max bad size}) + 1\,}.

At that size, pigeonhole guarantees some class has ≥k\ge k items — the configuration you wanted.

Two reductions worth memorizing

Condition Reduces to Boxes (colors)
Product of differences divisible by q2q^2 three numbers share a residue  mod  q\bmod\ q the qq residue classes mod qq
Sum of squares ≡0(mod4)\equiv 0 \pmod 4 four numbers share the same parity 22 classes (odd, even)

Why parity: even2≡0\text{even}^2 \equiv 0 and odd2≡1(mod4)\text{odd}^2 \equiv 1 \pmod 4, so a sum of four squares mod 44 just counts the odd terms; it is ≡0\equiv 0 only with 00 or 44 odds, i.e. all four of one parity.

Mini-example

Smallest nn so that every nn-subset of {1,…,49}\{1,\dots,49\} has three numbers x,y,zx,y,z with 49∣(x−y)(y−z)(z−x)49 \mid (x-y)(y-z)(z-x). Since 49=7249 = 7^2 and the numbers are distinct, no single difference is divisible by 4949, so we need all three to share a residue mod 77. Partition {1,…,49}\{1,\dots,49\} into the 77 residue classes (77 elements each). A bad set takes ≤2\le 2 per class: max bad size =7×2=14= 7 \times 2 = 14. Therefore

n=14+1=15.n = 14 + 1 = 15.

A size-1515 subset forces some class to hold ⌈15/7⌉=3\lceil 15/7 \rceil = 3 elements.

Exam trick: Never count the good configurations directly. Recolor the condition into "kk items of one color," maximize the bad set (at most k−1k-1 per color), and answer (max bad) + 1+\,1. The hard step is always step 1 — turning divisibility/sum conditions into a residue or parity coloring.

فرمول‌های کلیدی

Generalized pigeonhole
⌈Nn⌉\left\lceil \frac{N}{n} \right\rceil

Placing $N$ items in $n$ boxes forces some box to hold at least this many.

Smallest forcing size
n=(max bad size)+1n = (\text{max bad size}) + 1

Bad set takes $\le k-1$ from each color class; one more item forces $k$ in a class.

Squares mod 4
even2≡0,odd2≡1(mod4)\text{even}^2 \equiv 0,\quad \text{odd}^2 \equiv 1 \pmod 4

Lets a sum-of-squares condition collapse to a parity count.

#pigeonhole-principle#residue-classes#parity#modular-arithmetic#extremal-set#divisibility#combinatorics

سوالات تمرینی · 8/9

همهٔ 9 سؤال →