ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalGE-167Principle Inclusion Ex…
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    GE-167

    Discrete Structures

    Progress0 / 67 done
    Topics67
    1Propositional and Predicate Logic
    2Logical Operators3Translations Between Symbolic Expressions and Formal English Expression4Logical Equivalences
    5Quantifiers6Nested Quantification7Equivalences in Predicate Logic8Translations Between Symbolic Forms and Formal English
    9Proof Methods and Strategies10Direct Proof11Proof by Contraposition12Proof by Induction13Proof by Implication14Existence Proof15Uniqueness Proofs16Trivial Proofs17Vacuous Proofs
    18Notations and Set Operations19Venn Diagrams20Countable and Uncountable Sets
    21Equivalence Relations and Partitions22Partial Orderings23Recurrence Relations51Reflexive, Symmetric, Transitive, and Antisymmetric52Equivalence Relations and Equivalence Classes53Partial Orders
    24Injective, Surjective, Bijective25Special Types of Functions26Function Composition27Inverse Functions28Recursive Functions29Compositions
    30Sequences and Series
    31Inclusion and Exclusion Principle32Pigeonhole Principle33Permutations and Combinations46Product Rule and Sum Rule47Principle of Inclusion-Exclusion48Binomial Coefficients49Pascal's Identity and Pascal’s Triangle50Binomial Theorem
    34Division Theorem35Modular Arithmetic36LCM and GCD37Euclidean and Extended Euclidean Method38Finding Solutions to Congruence
    39Fundamental Theorem of Arithmetic40Characterizations of Primes41Mersenne Primes
    42Weak Induction43Strong Induction
    44Formulation of Recurrences45Closed Formulas
    54Terminologies55Elements of Graph Theory56Planar Graphs57Graph Coloring58Euler Graph59Hamiltonian Path60Rooted Trees61Graph Traversals62Handshaking Lemma and Corollary63Special Families of Graphs64Graph Isomorphism65Planarity in Graphs66Eulerian and Hamiltonian Graphs67Trees in Graph Theory
    10 min read
    Topic 47 of 67
    Topic Study Note Illustration
    47

    Principle of Inclusion-Exclusion

    The Principle of Inclusion-Exclusion (PIE) is a fundamental combinatorial method used to count the number of elements in the union of multiple sets when those sets may...

    Principle of Inclusion-Exclusion

    The Principle of Inclusion-Exclusion (PIE) is a fundamental combinatorial method used to count the number of elements in the union of multiple sets when those sets may overlap. It provides a way to account for the overlap between sets and ensure that elements are counted the correct number of times.

    The principle is especially useful in situations where you want to find the total number of elements in the union of several sets, but some elements are counted more than once due to overlaps between the sets.

    Basic Idea

    The general idea behind the inclusion-exclusion principle is:

    1. Start by including all elements from the sets you are interested in (counting every element in each set).
    2. Subtract the overlap between pairs of sets to avoid counting those elements multiple times.
    3. Add back the overlap between triples of sets (since elements from three sets were subtracted too much in step 2).
    4. Continue this process, alternating adding and subtracting, for all possible overlaps among the sets.

    General Formula

    For two sets AAA and BBB, the principle of inclusion-exclusion can be stated as:

    ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣|A \cup B| = |A| + |B| - |A \cap B|∣A∪B∣=∣A∣+∣B∣−∣A∩B∣

    Where:

    • ∣A∪B∣|A \cup B|∣A∪B∣ is the number of elements in the union of sets AAA and BBB.
    • ∣A∣|A|∣A∣ is the number of elements in set AAA.
    • ∣B∣|B|∣B∣ is the number of elements in set BBB.
    • ∣A∩B∣|A \cap B|∣A∩B∣ is the number of elements in the intersection of sets AAA and BBB (i.e., elements common to both sets).

    This formula ensures that elements in A∩BA \cap BA∩B are not counted twice.

    For three sets AAA, BBB, and CCC, the formula is extended as:

    ∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣B∩C∣−∣A∩C∣+∣A∩B∩C∣|A \cup B \cup C| = |A| + |B| + |C| - |A \cap B| - |B \cap C| - |A \cap C| + |A \cap B \cap C|∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣B∩C∣−∣A∩C∣+∣A∩B∩C∣

    Where:

    • The first three terms count the elements in each of the sets.
    • The next three terms subtract the overlaps of pairs of sets (because these elements were counted twice).
    • The last term adds back the intersection of all three sets (because these elements were subtracted too many times).

    For nnn sets, the general formula for the principle of inclusion-exclusion is:

    ∣A1∪A2∪⋯∪An∣=∑i=1n∣Ai∣−∑1≤i<j≤n∣Ai∩Aj∣+∑1≤i<j<k≤n∣Ai∩Aj∩Ak∣−⋯+(−1)n+1∣A1∩A2∩⋯∩An∣|A_1 \cup A_2 \cup \dots \cup A_n| = \sum_{i=1}^{n} |A_i| - \sum_{1 \leq i < j \leq n} |A_i \cap A_j| + \sum_{1 \leq i < j < k \leq n} |A_i \cap A_j \cap A_k| - \dots + (-1)^{n+1} |A_1 \cap A_2 \cap \dots \cap A_n|∣A1​∪A2​∪⋯∪An​∣=i=1∑n​∣Ai​∣−1≤i<j≤n∑​∣Ai​∩Aj​∣+1≤i<j<k≤n∑​∣Ai​∩Aj​∩Ak​∣−⋯+(−1)n+1∣A1​∩A2​∩⋯∩An​∣

    Where the summations alternate between adding and subtracting the sizes of intersections of increasing numbers of sets.

    Steps for Applying Inclusion-Exclusion

    1. Identify the sets you are working with and what you want to count.
    2. Start with the size of each individual set, summing them up.
    3. Subtract the size of pairwise intersections to account for elements that have been counted twice.
    4. Add the size of triple intersections, as these elements were subtracted too much in the previous step.
    5. Continue the process for intersections of higher numbers of sets, alternating between subtracting and adding the sizes of the intersections.
    6. Finally, you will have the correct count for the union of the sets.

    Example 1: Counting the Number of Students in a Class

    Suppose in a class of 30 students:

    • 15 students play basketball.
    • 12 students play soccer.
    • 10 students play both basketball and soccer.

    How many students play either basketball or soccer?

    Let:

    • AAA be the set of students who play basketball.
    • BBB be the set of students who play soccer.

    We are interested in the number of students in A∪BA \cup BA∪B, which represents students who play basketball or soccer. Using the inclusion-exclusion principle:

    ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣|A \cup B| = |A| + |B| - |A \cap B|∣A∪B∣=∣A∣+∣B∣−∣A∩B∣

    Substituting the given values:

    ∣A∪B∣=15+12−10=17|A \cup B| = 15 + 12 - 10 = 17∣A∪B∣=15+12−10=17

    So, 17 students play either basketball or soccer.

    Example 2: Generalizing to Three Sets

    Consider a situation where:

    • There are 50 people at a party.
    • 30 people drink coffee.
    • 20 people drink tea.
    • 10 people drink both coffee and tea.
    • 5 people drink coffee, tea, and juice.

    We want to know how many people drink either coffee, tea, or juice.

    Let:

    • AAA be the set of people who drink coffee.
    • BBB be the set of people who drink tea.
    • CCC be the set of people who drink juice.

    We want to find ∣A∪B∪C∣|A \cup B \cup C|∣A∪B∪C∣, the total number of people who drink coffee, tea, or juice.

    Using the inclusion-exclusion principle for three sets:

    ∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣B∩C∣−∣A∩C∣+∣A∩B∩C∣|A \cup B \cup C| = |A| + |B| + |C| - |A \cap B| - |B \cap C| - |A \cap C| + |A \cap B \cap C|∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣B∩C∣−∣A∩C∣+∣A∩B∩C∣

    Substituting the given values:

    • ∣A∣=30|A| = 30∣A∣=30, ∣B∣=20|B| = 20∣B∣=20, ∣C∣=50|C| = 50∣C∣=50
    • ∣A∩B∣=10|A \cap B| = 10∣A∩B∣=10 (people who drink both coffee and tea)
    • ∣B∩C∣=0|B \cap C| = 0∣B∩C∣=0 (no one drinks both tea and juice)
    • ∣A∩C∣=0|A \cap C| = 0∣A∩C∣=0 (no one drinks both coffee and juice)
    • ∣A∩B∩C∣=5|A \cap B \cap C| = 5∣A∩B∩C∣=5 (people who drink coffee, tea, and juice)

    Now we compute:

    ∣A∪B∪C∣=30+20+50−10−0−0+5=95|A \cup B \cup C| = 30 + 20 + 50 - 10 - 0 - 0 + 5 = 95∣A∪B∪C∣=30+20+50−10−0−0+5=95

    Thus, 95 people drink either coffee, tea, or juice.

    Applications of Inclusion-Exclusion

    The principle of inclusion-exclusion is widely used in many areas, including:

    1. Counting Problems: Calculating the number of elements in the union of several sets.
    2. Probability Theory: Computing the probability of the union of events, particularly when events are not mutually exclusive.
    3. Set Theory: Understanding the relationships between multiple sets and their intersections.
    4. Graph Theory: Counting paths, cycles, or other structures in graphs with multiple conditions.
    5. Algorithm Analysis: Determining the complexity of algorithms that involve multiple subproblems or components.

    Conclusion

    The Principle of Inclusion-Exclusion is a powerful combinatorial tool used to correctly count the elements in the union of multiple sets by considering the overlaps between them. It ensures that elements are not counted multiple times and provides an efficient way to compute set sizes in complex problems involving intersections of sets.

    ← Previous topic 46
    Counting: Product Rule and Sum Rule
    Next topic 48 →
    Binomial Coefficients

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    10mremaining
    1.7kwords
    Intermediatelevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Discrete Structures