KonkurStudy
همه کارت‌ها

Restricted Injective Assignments via the Multiplication Principle

Count injective assignments (distinct objects to distinct slots) under forbidden pairings by placing the most-constrained slot first and multiplying the shrinking choice counts.

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

اهمیت
۰/۵

Many konkur counting problems ask: in how many ways can we hand out distinct objects to distinct recipients so that no recipient gets an object it is forbidden? Each recipient gets at most one object and each object is used at most once — so we are counting injective assignments (also called systems of distinct representatives) subject to a forbidden-pairs table. The clean tool is the multiplication principle applied in the right order: fill the most-restricted slot first, then the next, accounting for objects already used.

The set-up

We assign one distinct object to each of the slots s1,…,sks_1,\dots,s_k from a pool, where slot sjs_j has an allowed set AjA_j of size aja_j (the pool minus its forbidden objects). We want the number of injective maps ff with f(sj)∈Ajf(s_j)\in A_j and f(sj)f(s_j) pairwise distinct.

The key idea: order the slots, then multiply

Process the slots from fewest allowed choices to most. When you reach a slot, its live count is its allowed size minus however many of those allowed objects were already consumed by earlier slots, so:

#ways  =  ∏j=1k(a(j)−(already-used objects that lie in A(j))),\#\text{ways} \;=\; \prod_{j=1}^{k}\bigl(a_{(j)} - (\text{already-used objects that lie in }A_{(j)})\bigr),

where (1),(2),…(1),(2),\dots is the order you chose. Starting with the tightest slot keeps the bookkeeping of "already-used" objects as small and as predictable as possible. Unrestricted slots (allowed set == whole pool of size nn) are always handled last: by then tt objects are gone, so such a slot contributes exactly n−tn-t — no case analysis needed.

When restricted slots overlap: split into cases

If two restricted slots share forbidden/allowed objects, "already-used" depends on which object the earlier slot took. The standard fix: case-split on the tight slots only (e.g. did the most-restricted slot take an object that the next restricted slot also wanted?), compute each case by the product rule, then add the cases. The unrestricted slots are multiplied in afterward as plain falling factors n−t, n−t−1,…n-t,\,n-t-1,\dots.

How to apply (recipe)

  1. Build the allowed-set table: for each slot list its forbidden objects and the size aja_j of what remains.
  2. Sort slots by ascending aja_j; the unrestricted ones go to the very end.
  3. Place objects slot-by-slot, multiplying the live counts; case-split only where restricted allowed-sets interact.
  4. Add the cases; the unrestricted tail contributes a falling-factorial  (n−t)(n−t−1)⋯\,(n-t)(n-t-1)\cdots.
  5. If the recipients themselves are chosen from a larger set (e.g. pick kk of mm children), multiply by the relevant selection count or sum over the selections.

Mini-example

Give 33 distinct prizes from {1,2,3,4}\{1,2,3,4\} to three slots P,Q,RP,Q,R, one each, where PP may not get prize 11 and QQ may not get prize 11; RR is unrestricted. Allowed sizes: aP=3a_P=3 ({2,3,4}\{2,3,4\}), aQ=3a_Q=3 ({2,3,4}\{2,3,4\}), aR=4a_R=4.

Place the tight slots first. PP has 33 choices from {2,3,4}\{2,3,4\}. QQ must avoid 11 and avoid PP's prize; since PP already took an allowed (non-11) prize, QQ has 3−1=23-1=2 choices. Now 22 objects are used, so unrestricted RR has 4−2=24-2=2 choices:

3⋅2⋅2=12.3\cdot 2\cdot 2 = 12.

(Cross-check by inclusion–exclusion on P,QP,Q avoiding 11: total injective =4⋅3⋅2=24=4\cdot3\cdot2=24; subtract those with P=1P=1 (1⋅3⋅2=61\cdot3\cdot2=6) and Q=1Q=1 (66): 24−6−6=1224-6-6=12. Both agree.)

Exam trick: always fill the most-constrained slot first and push unrestricted slots to the end, where they collapse to a falling factorial n−t, n−t−1,…n-t,\,n-t-1,\dots. If you start with an unrestricted slot you create needless cases; if you forget that distinct objects shrink later slots' counts, you over-count by treating the assignment as if repeats were allowed.

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

Ordered multiplication principle (injective assignment)
#{injective f: f(sj)∈Aj}=∏j=1k(∣A(j)∣−u(j))\#\{\text{injective } f:\ f(s_j)\in A_j\} = \prod_{j=1}^{k}\bigl(|A_{(j)}| - u_{(j)}\bigr)

Process slots in chosen order $(1),(2),\dots$; $u_{(j)}$ is how many already-placed objects lie in the allowed set $A_{(j)}$. Valid directly when the count $u_{(j)}$ is the same across all sub-cases; otherwise case-split.

Unrestricted-tail falling factorial
(n−t)(n−t−1)⋯(n−t−r+1)=(n−t)!(n−t−r)!(n-t)(n-t-1)\cdots(n-t-r+1) = \frac{(n-t)!}{(n-t-r)!}

After $t$ of the $n$ objects are used, $r$ unrestricted slots contribute this falling product, handled last.

#counting#multiplication-principle#injective-assignment#system-of-distinct-representatives#case-analysis#combinatorics

سوالات تمرینی