4.9.2 · D2 · HinglishProbability Theory & Statistics

Visual walkthroughInclusion-exclusion principle

2,112 words10 min read↑ Read in English

4.9.2 · D2 · Maths › Probability Theory & Statistics › Inclusion-exclusion principle

Shuru karne se pehle, teen simple words jo hum baar baar use karenge:

Hamara goal — woh cheez jo hum zero se derive karenge:

Zaor se padho: poore blob ki size = (sab singles add karo) − (sab pairs subtract karo) + (sab triples add karo) − …. Hum iska har ek piece earn karenge.


Step 1 — Ek circle: counting honest hai

KYA. Ek single set se shuru karo. Hum use shade karte hain aur andar ke dots count karte hain: woh count hai .

KYUN. Ek set ke saath koi overlap nahi hai, isliye kuch bhi do baar count nahi hota. Yeh hamara "honest counting" ka baseline hai — har dot bilkul contribute karta hai. Jo kuch bhi aage aata hai woh sab is honesty ko repair karne ke baare mein hai jab circles overlap karne lagti hain.

PICTURE. Blue circle dekho. Har dot ek cheez hai; bracket total ko label karta hai.

Figure — Inclusion-exclusion principle

Yahan notation apna kaam karta hai:


Step 2 — Do circles: double-count paida hota hai

KYA. Ek doosra set laao. Circles overlap karti hain. Blob ko teen pieces mein split karo jo kabhi ek dot share nahi karte (mathematicians aisi pieces ko disjoint kehte hain):

  • sirf , size (sirf blue)
  • sirf , size (sirf orange)
  • dono, size (green lens)

KYUN. Disjoint pieces ko safely add kiya ja sakta hai — koi dot do pieces mein nahi rehta, isliye unke sizes add karne se har dot ek baar count hota hai. Isse union size honestly milti hai:

PICTURE. Beech mein lens woh troublemaker hai — yeh dono circles mein belong karta hai.

Figure — Inclusion-exclusion principle

Ab dekho naive addition kya karti hai. Poori circle mein blue-only aur lens dono hain, isliye . Isi tarah . Inhe add karo: Term woh double-count hai jo clearly dikh raha hai: lens ek baar se aur ek baar se add hua.


Step 3 — Fix: overlap ek baar subtract karo

KYA. Hamare paas ki ek extra copy hai. subtract karke exactly ek copy hatao.

KYUN. Hum chahte hain ki har dot ek baar count ho. Lens abhi pe hai; subtract karne se yeh ho jaata hai, jabki blue-only aur orange-only untouched rehte hain (woh already par the).

PICTURE. Red minus-shading lens ki ek green layer cancel kar deti hai, use ek baar count kara deti hai.

Figure — Inclusion-exclusion principle

Step 4 — Degenerate check: jab circles touch nahi karti

KYA. Maan lo aur kuch share nahi karte — bilkul overlap nahi. Tab lens empty hai: .

KYUN. Ek achhe formula ko apne edge cases mein survive karna chahiye. Step 3 mein plug karo: Yeh exactly "disjoint parts add karo" hai — additivity rule jo tumhe already pata hai. Toh general formula disjoint rule ko contain karta hai; usse fight nahi karta.

PICTURE. Do alag circles, koi lens nahi, subtract karne ke liye kuch nahi.

Figure — Inclusion-exclusion principle

Step 5 — Teen circles: zyada subtract ho jaata hai

KYA. Ek teesra set add karo. Ab teen lenses bante hain (ek per pair) aur ek tiny center jahan teeno milte hain. Honestly-galat shuru karo sab singles add karke:

KYUN. Ek dot ko track karo jo center mein rehta hai (teeno sets mein). Woh teen baar add hua — har circle ne ek baar. Exactly do sets mein rehne wala dot do baar add hua. Ab hum do-set dots ko fix karne ke liye teen pairwise lenses subtract karte hain:

PICTURE. Har pairwise lens ko ek red subtraction milti hai. Center dot follow karo: woh teeno lenses mein rehta hai, isliye teen baar subtract hota hai.

Figure — Inclusion-exclusion principle

Center dot ke liye ab tak tally: Disaster: all-three dots count se bilkul gayab ho gaye hain.


Step 6 — Center wapas add karo

KYA. Gayab hua center ek baar triple intersection add karke restore karo:

KYUN. Center dot Step 5 ke baad par tha; hum chahte hain yeh ho. Ise ek baar add karne se ho jaata hai. Jabki two-set dots (pehle se par sahi hain) triple region mein nahi hain, isliye woh untouched rehte hain.

PICTURE. Green plus-shading center ko wapas fill kar deti hai — ab har region exactly par hai.

Figure — Inclusion-exclusion principle

Rhythm aa gayi: +singles, −pairs, +triples. Add-subtract-add. Signs alternate karte hain, aur picture ne abhi bataya kyun: subtraction ki har layer deepest dots ko over-correct karti hai, agli layer ko sign flip karne pe majboor karti hai.


Step 7 — Signs kyun alternate karni padti hain (counting bar chart)

KYA. Ek dot lo jo exactly sets mein rehta hai. Count karo ki har type ke kitne terms usse contain karte hain.

KYUN. sets mein rehne wala dot in mein appear karta hai:

  • single terms mein (apne sets mein se 1 choose karo),
  • pair terms mein (apne sets mein se 2 choose karo),
  • -fold intersections mein .

Symbol (ek binomial coefficient, dekho Counting Principles & Combinatorics) ka matlab hai " mein se cheezein pick karne ke tarike kitne hain." Alternating signs ke saath iska net contribution hai:

PICTURE. ke liye terms ka ek bar chart: positive aur negative bars almost cancel hote hain, exactly ka leftover rehta hai.

Figure — Inclusion-exclusion principle

Exactly kyun? Binomial Theorem ke saath kehta hai ki saare signed terms (including ) zero sum karte hain: term, , alag karo: Har dot, chahe kitne bhi sets mein rahe, exactly ek baar count hota hai. Yahi poora theorem hai, aur alternating signs forced hain — choose nahi kiye gaye.


Step 8 — Edge case: dot zero sets mein

KYA. Kisi circle ke bahar rehne wale dot ka kya ()?

KYUN. Yeh kisi single mein, kisi pair mein, kisi intersection mein appear nahi karta — iska net contribution hai. Achha: union sirf un dots ko count karna chahiye jo kam se kam ek circle ke andar hain, aur yeh dot kisi mein nahi. Formula ise silently ignore kar deta hai, exactly jaisa karna chahiye. (Koi figure nahi chahiye — empty tally hi picture hai.)


Ek-picture summary

Poora derivation shaded regions se bana ek sentence hai: har circle add karo, har pairwise lens peel off karo, triple center wapas paint karo, aur har gehri layer ka sign flip ho jaata hai — jab tak har region exactly height par na aa jaaye.

Figure — Inclusion-exclusion principle
Recall Feynman retelling — poora walkthrough simple words mein

Socho teen overlapping hula-hoops zameen par hain aur unke neeche beads bikri hain. Pehle tum har hoop ke neeche beads alag alag count karte ho aur add karte ho — lekin do hoops ke neeche wali beads do baar count ho gayi, aur teeno ke neeche wali teen baar. Toh tum ghoomte ho aur har pair-overlap ek baar subtract karte ho. Isse two-hoop beads perfectly fix ho jaati hain. Lekin bilkul beech wali beads — teeno ke neeche — teen baar add hone ke baad teen baar subtract ho gayi, toh woh zero ho gayi, gayab! Tum wapas jaate ho aur center beads ek baar phir add karte ho. Ab sabko exactly ek baar count kiya gaya. Agar chaar hoops hote, toh four-way overlaps subtract karne se phir over-fix ho jaata, toh tum deepest layer subtract karte, aur aise hi chalta: add, subtract, add, subtract, har round mein signs switch. Reason yeh hai ki yeh hamesha exactly ek per bead par land karta hai ek neat algebra fact hai — ek bead mein "kitne overlaps mein baith raha hai" ke plus aur minus counts almost cancel hote hain, ek clean leftover chodke.


Active recall

Trace-the-lens :: Lens sirf woh region hai jo dono circles ke andar hai, isliye aur dono ise ek baar count karte hain → total do baar. Center dot height after pairs :: Yeh par hai, yaani erase ho gaya — galat hai, hum chahte hain , isliye triple wapas add karte hain. Why leftover is 1 :: Kyunki aur term hai, jo alternating sum force karta hai.


Connections

  • Parent: Inclusion–Exclusion Principle — poora statement aur proofs
  • Set Theory & Venn Diagrams — circles, unions, aur lenses jo yahan draw ki gayi hain
  • Counting Principles & Combinatorics — Step 7 mein use hone wale ka matlab
  • Binomial Theorem — woh identity jo signs force karta hai
  • Probability Axioms — Step 4 ka disjoint case
  • Derangements & Permutations — jahan yeh walkthrough kaam aata hai
  • Bonferroni Inequalities — kya hota hai agar tum alternating sum early rok do