Friday, 28 April 2017

The Inclusion-Exclusion principle

The Inclusion-exclusion principle computes the cardinal number of the union of multiple non-disjoint sets. For two sets A and B, the principle states −
|AB|=|A|+|B||AB|
For three sets A, B and C, the principle states −
|ABC|=|A|+|B|+|C||AB||AC||BC|+|ABC|
The generalized formula -
|ni=1Ai|=1i<j<kn|AiAj|+1i<j<kn|AiAjAk|+(1)π1|A1A2|
Problem 1
How many integers from 1 to 50 are multiples of 2 or 3 but not both?
Solution
From 1 to 100, there are 50/2=25
numbers which are multiples of 2.
There are 50/3=16
numbers which are multiples of 3.
There are 50/6=8
numbers which are multiples of both 2 and 3.
So, |A|=25
, |B|=16 and |AB|=8.
|AB|=|A|+|B||AB|=25+168=33
Problem 2
In a group of 50 students 24 like cold drinks and 36 like hot drinks and each student likes at least one of the two drinks. How many like both coffee and tea?
Solution
Let X be the set of students who like cold drinks and Y be the set of people who like hot drinks.
So, |XY|=50
, |X|=24, |Y|=36 |XY|=|X|+|Y||XY|=24+3650=6050=10
Hence, there are 10 students who like both tea and coffee.

No comments:

Post a Comment