Worked examples — Inclusion-exclusion principle
4.9.2 · D3· Maths › Probability Theory & Statistics › Inclusion-exclusion principle
Shuru karne se pehle, sirf ek rule ka reminder, words mein:
Scenario matrix
Har inclusion–exclusion problem jo kabhi milegi woh in cells mein se ek hogi. Right column mein us example ka naam hai jo usse clearly explain karta hai.
| # | Case class | Kya cheez tricky banati hai | Explained by |
|---|---|---|---|
| C1 | 2 sets, generic overlap | ek baar subtract karna yaad rakho | Ex 1 |
| C2 | 2 sets, disjoint () | overlap term zero hai | Ex 2 |
| C3 | 2 sets, ek doosre ke andar () | union bade set pe collapse ho jaata hai | Ex 2 |
| C4 | 3 sets, full formula | "+triple" restoration | Ex 3 |
| C5 | Complement trick ("inme se koi nahi" / "kam se kam ek") | opposite count karo, total se subtract karo | Ex 4 |
| C6 | Probability version (measures, counts nahi) | universe se divide karo / use karo | Ex 5 |
| C7 | Degenerate: sab sets equal | union = unme se koi bhi ek | Ex 6 |
| C8 | Limiting behaviour (derangement ratio jab ) | infinite sign-alternating sum | Ex 7 |
| C9 | Exam twist: "exactly " nahi "at least one" | alag coefficients | Ex 8 |
| C10 | 4 sets, real-world word problem | four-way sign bookkeeping | Ex 9 |
Ex 1 — C1: do sets, generic overlap
Steps.
- Sets name karo. = French padhne wale, ; = German, ; . Yeh step kyun? Inclusion–exclusion ko overlap size explicitly naam chahiye — yahi toh poora point hai.
- Singles add karo: . Yeh step kyun? Isse "dono" wale har student do baar count hote hain, toh yeh zyada hai.
- Overlap ek baar subtract karo: . Yeh step kyun? dono-wale students do baar count hue the; subtract karne se woh ek baar count hote hain.
Verify: disjoint pieces mein partition karo — sirf French , sirf German , dono . Sum . ✓ Aur , toh class mein fit hota hai. ✓
Ex 2 — C2 & C3: disjoint sets, aur ek set doosre ke andar
Steps for (a) — disjoint case C2.
- Disjoint matlab , toh . Yeh step kyun? General formula tab bhi apply hoti hai — zero overlap bas ek special value hai.
- .
Verify (a): koi overlap nahi toh kuch double-count nahi hua, seedha addition already sahi hai. . ✓
Steps for (b) — nested case C3.
- matlab har chess player already games club mein hai, toh aur . Yeh step kyun? Overlap wahi chhota set hota hai jab ek set doosre ke andar ho.
- .
Verify (b): union bas bada set hai, toh hona chahiye. ✓ Formula ne naive nahi diya — kyunki chess players naye log nahi hain.
Ex 3 — C4: teen sets, full formula (figure ke saath)
Figure dekho: centre region (teeno) har pairwise lens ke andar hai.

Steps.
- Singles add karo: . Yeh step kyun? Jo do drinks mein hai woh do baar count hua; jo teeno mein hai woh teen baar count hua.
- Pairs subtract karo: , deta hai . Yeh step kyun? Yeh sirf-pair wale logon ki double-counting fix karta hai, lekin all-three group ko over-erase karta hai.
- All-three group of track karo: step 1 mein baar add hua, step 2 mein baar subtract hua → net . Yeh galat hai; hum chahte hain . Yeh step kyun? Isi liye triple exist karta hai — figure mein dark centre dekho.
- Triple wapas add karo: .
Verify: "koi nahi" . 7 disjoint Venn regions mein bhi decompose karke sum karo: sirf-T , sirf-C , sirf-J , T∩C-only , T∩J-only , C∩J-only , teeno . Total . ✓
Ex 4 — C5: complement trick ("at least one" via "none")
Yahan naya tool kyun: " ya ya se divisible" directly count karna hai inclusion–exclusion — lekin yeh problem complement idea bhi sikhati hai jo Ex 7 mein use hoti hai. Pehle seedha karte hain.
Steps.
- Singles — tak ke multiples count karo. , , . Yeh step kyun? = ke multiples ki count jo hain (har -va number). matlab "== ko whole number mein round down karo=="
- Pairs — dono aur se divisible matlab se divisible. ; ; . Yeh step kyun? "2 aur 3 dono se divisible" intersection hai, aur lcm woh sabse chhota number hai jise dono divide karte hain.
- Triple — .
- Alternating signs ke saath assemble karo:
Verify (complement): kisi bhi se divisible nahi — yaani coprime-ish survivors . Sanity check: kisi se bhi divisible nahi wale jaise kuch numbers honge; plausible hai. Direct union . ✓
Ex 5 — C6: probability version
Probability counts ki jagah kyun: universe size se har count divide karne se same formula probabilities mein badal jaata hai — additivity bilkul same hai.
Steps.
- (13 hearts). (12 face cards). Yeh step kyun? Equally-likely event ki probability favourable total.
- Overlap: face-card hearts hain J♥, Q♥, K♥, toh , . Yeh step kyun? = cards jo dono heart aur face hain.
- Probability ke liye inclusion–exclusion:
Verify: union seedha count karo — hearts (13) plus non-heart face cards () cards, . Expected se bada (humne face cards add kiye). ✓ Valid probability hai, . ✓
Ex 6 — C7: fully degenerate case (sab sets equal)
Steps.
- Har set mein elements hain, aur har intersection (pair ya triple) bhi wohi pura set hai, size . Yeh step kyun? Jab sets coincide karte hain, sab overlaps usi ek set pe collapse ho jaate hain.
- 3-set formula apply karo:
Verify: teen identical sets ka union bas wahi set hai, size . Formula deta hai . ✓ Yeh general "element in sets counted exactly once" identity in action hai: , toh elements mein se har ek ka net aata hai. ✓
Ex 7 — C8: limiting behaviour (derangements jab )
Inclusion–exclusion kyun: "kam se kam ek letter sahi" events "letter sahi" ka union hai; complement hai "koi nahi sahi".
Steps.
- = permutations jo position fix karti hain. , -fold intersection chosen spots fix karti hai: , ways se chuna gaya. Yeh step kyun? letters sahi fix karne se baaki ke arrangements bachte hain.
- "Kam se kam ek fixed" . "None fixed" ke liye se subtract karo: Yeh step kyun? , bahar nikalte hain.
- ke liye: . Probability .
- Limit: (exponential series at ). Toh . Yeh step kyun? ko pe evaluate karo; sign-alternating I–E terms exactly yahi series hain.
Verify: (parent note se match karta hai). , aur — pe already bahut close. ✓ "No match" ki chance khatam nahi hoti; ke paas settle hoti hai.
Ex 8 — C9: exam twist ("exactly one", "at least one" nahi)
Alag coefficients kyun: "exactly one" ke liye aisa formula chahiye jo multi-membership cancel out kare, union se alag multipliers deta hai.
Steps.
- Ex 3 ke Verify se disjoint-region decomposition use karo: sirf-T , sirf-C , sirf-J . Yeh step kyun? "Exactly ek drink" = teen single-only regions ka sum.
- Add karo: .
- Coefficient formula se cross-check karo: Yeh step kyun? Exactly sets mein wala element net hona chahiye: ; teeno mein: . Sirf single-membership coefficient ke saath bachti hai.
Verify: dono methods dete hain. Saath mein: exactly-two total , exactly-three , koi nahi ; . ✓
Ex 9 — C10: chaar sets, real-world word problem
Steps.
- Singles add karo (): . Yeh step kyun? , sign .
- Sab pairs subtract karo (): , deta hai . Yeh step kyun? , sign ; double-counting fix karta hai.
- Sab triples add karo (): , deta hai . Yeh step kyun? , sign ; triple-erased logon ko restore karta hai.
- Single quadruple subtract karo (): . Yeh step kyun? , sign ; all-four wala person triples se over-add hua tha.
Verify: answer team size, toh logon ko koi nahi aata — plausible hai. All-four person track karo: add hua (singles) (pairs) (triples) (quad) . Exactly ek baar count hua. ✓
Recall Kaun sa cell kaunsa tha?
C1 generic 2-set (Ex1) ::: overlap ek baar subtract karo C2 disjoint / C3 nested (Ex2) ::: overlap hai ya chhota set hai C4 teen sets (Ex3) ::: triple wapas add karo C5 complement (Ex4) ::: "koi nahi" total union C6 probability (Ex5) ::: same formula ke saath C7 sab equal (Ex6) ::: union koi bhi ek set C8 limit (Ex7) ::: C9 exactly-one (Ex8) ::: coefficients C10 chaar sets (Ex9) ::: signs
Connections
- Inclusion-exclusion principle — parent note: woh formula jo yeh examples exercise karte hain
- Set Theory & Venn Diagrams — Ex 3 & 8 mein use ki gayi disjoint-region decomposition
- Counting Principles & Combinatorics — Ex 7 & 9 mein intersections ki counts
- Probability Axioms — Ex 5 ka probability form additivity plus overlap correction hai
- Derangements & Permutations — Ex 7 classic derangement payoff hai
- Binomial Theorem — Ex 7 mein limit
- Bonferroni Inequalities — in alternating sums ko truncate karne se bounds milte hain