Principal of inclusion/exclusion and union of overlapping sets
The Principle of Inclusion-Exclusion (PIE) is a counting technique used to find the size of the union of multiple overlapping sets. It corrects for overcounting by systematically adding and subtracting the sizes of intersections.
🧠Principle of Inclusion-Exclusion (PIE)
Let be sets. The number of elements in their union is:
✅ PIE Formula:
For 2 sets:
For 3 sets:
For sets:
📘 Why Use PIE?
When elements belong to multiple sets, naive addition counts them multiple times. PIE ensures each element is counted exactly once in the union.
🔢 Examples
🔸 Example 1: Two Sets
Let:
Question: How many are in ?
Solution:
🔸 Example 2: Three Sets
Let:
-
, ,
-
, ,
-
Question: How many are in ?
Solution:
🧮 Example 3: Real-Life Application
In a survey:
-
40 people like coffee (C)
-
30 like tea (T)
-
20 like juice (J)
-
15 like both coffee and tea
-
10 like both coffee and juice
-
5 like both tea and juice
-
3 like all three
Find: How many like at least one of the three drinks?
Solution:
Now, let's see for 3 sets why does this work.
A is made up of 4 parts:
(1) A' = Elements which are exclusive to A and not shared with B,C.
(2) AB' = Elements which are common ONLY in A,B and NOT C
(3) AC' = Elements which are common ONLY in A,C and NOT B
(4) ABC' = Elements which are common in all three of A,B,C which is A ∩ B ∩ C.
Now
(1) A' = Elements which are exclusive to A and not shared with B,C.
(2) AB' = Elements which are common ONLY in A,B and NOT C
A ∩B = AB' + ABC'
A ∩ C = AC' + ABC'
B and C are composed similarly.
Now if simply add all elements of A,B,C in a naive way:
A + B + C =
A' + AB' + AC' + ABC' +
B' + AB' + BC' + ABC' +
C' + BC' + AC' + ABC'
So, these are portions coming twice AB', AC', BC'.
To fix that we subtract
Now if simply add all elements of A,B,C in a naive way:
A + B + C =
A' + AB' + AC' + ABC' +
A ∩B = AB' + ABC'
A ∩ C = AC' + ABC'
B∩C = BC' + ABC'
Now the sum becomes:
Now the sum becomes:
A' + AB' + AC' + BC' + B' + C'.
Notice that ABC' is vanished.
So we need to add it back.
And that's how we get PIE and union of overlapping sets.
Notice that ABC' is vanished.
So we need to add it back.
And that's how we get PIE and union of overlapping sets.
Comments
Post a Comment