Presentation is loading. Please wait.

Presentation is loading. Please wait.

Applications of Inclusion-Exclusion: Selected Exercises

Similar presentations


Presentation on theme: "Applications of Inclusion-Exclusion: Selected Exercises"— Presentation transcript:

1 Applications of Inclusion-Exclusion: Selected Exercises

2 8 How many onto functions are there from a set with 7 elements to a set with 5 elements? Equivalently, how many ways are there to assign 7 distinct tasks to 5 distinct computers such that each computer gets ≥ 1 task?

3 8 Solution Let the domain D = { a, b, c, d, e, f, g }.
Let the co-domain C = {1, 2, 3, 4, 5 }. Let a function f: D  C have property P1 when element f(x) = 1, for some x  D. P2 when element f(x) = 2, for some x  D. P3 when element f(x) = 3, for some x  D. P4 when element f(x) = 4, for some x  D. P5 when element f(x) = 5, for some x  D. We count all functions that have P1, P2, …, and P5.

4 8 Solution continued Let
A1 be the set of functions that do not have P1. A2 be the set of functions that do not have P2. A3 be the set of functions that do not have P3. A4 be the set of functions that do not have P4. A5 be the set of functions that do not have P5. The set of desired functions is A1  A2  A3  A4  A5 = U – (A1  A2  A3  A4  A5).

5 8 Solution continued |U| = 57. |Ai| = 47, for 1  i  5.
|Ai  Aj | = 37, for 1  i < j  5. |Ai  Aj  Ak | = 27, for 1  i < j < k  5. |Ai  Aj  Ak  Al | = 17, for 1  i < j < k < l  5. The overall answer is 57 – C(5,1)47 + C(5,2)37 - C(5,3)27 + C(5,4)17.

6 10 In how many ways can 8 distinct balls be distributed into 3 distinct urns if each urn must contain ≥ 1 ball?

7 10 Solution Let property: Let set:
P1 be a distribution of the balls such that urn 1 has ≥ 1 ball. P2 be a distribution of the balls such that urn 2 has ≥ 1 ball. P3 be a distribution of the balls such that urn 3 has ≥ 1 ball. Let set: A1 be the set of distributions that do not have P1. A2 be the set of distributions that do not have P2. A3 be the set of distributions that do not have P3. Then, we want | A1  A2  A3 | = | A1  A2  A3 | = |U| - | A1  A2  A3 | = |U| - | A1| - | A2| - | A3| + | A1  A2 | + | A1  A3 | + | A2  A3 | - | A1  A2  A3 |.

8 10 Solution continue |U| = the # of distributions of the 8 distinct balls into the 3 distinct urns = 38. (Each ball can go into 3 possible urns.) | A1 | = | A2 | = | A3 | = 28. | A1  A2 | = | A1  A3 | = | A2  A3 | = 18. | A1  A2  A3 | = 08. The answer is x28 + 3x1.

9 *18 Use a combinatorial argument to show that Dn, the # of derangements of n objects, satisfies the recurrence Dn = (n – 1)(Dn-1 + Dn-2 ), for n ≥ 2. Hint: There are n – 1 choices for the 1st element k of a derangement. Consider separately the derangements that start with k that do and do not have 1 in the kth position.

10 *18 Solution Use the Product Rule to count the derangements in 2 stages: In stage 1, we choose the 1st number in the derangement: There are n – 1 ways to do that. In stage 2, we complete the derangement. Let the 1st number in the derangement be i  1. Use the Sum Rule to partition this set of derangements into: Those with the ith element = 1: There are Dn-2 ways to complete the derangement. Those with the ith element  1: Think of element 1 temporarily renamed i. The elements 2, 3, …, n are to be deranged (1 cannot go in position i) There are Dn-1 ways to derange them. Thus, Dn = (n – 1)(Dn-2 + Dn-1 ), where D0 = D1 = 0.


Download ppt "Applications of Inclusion-Exclusion: Selected Exercises"

Similar presentations


Ads by Google