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-167Counting Inclusion Exc…
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
    12 min read
    Topic 31 of 67
    Topic Study Note Illustration
    31

    Counting: Inclusion and Exclusion Principle

    The Inclusion-Exclusion Principle is a fundamental concept in combinatorics and counting, helping to calculate the size of the union of multiple sets when the sets have overlapping...

    Counting: Inclusion and Exclusion Principle

    The Inclusion-Exclusion Principle is a fundamental concept in combinatorics and counting, helping to calculate the size of the union of multiple sets when the sets have overlapping elements. This principle is especially useful in problems involving overlapping sets, where simply adding up the sizes of individual sets would overcount the elements that are shared by multiple sets.

    The Inclusion-Exclusion Principle allows us to account for the overlap in a systematic way by subtracting the overcounted elements from the total.


    1. Basic Principle of Inclusion and Exclusion

    Given two sets AAA and BBB, the number of elements in their union (denoted as ∣A∪B∣|A \cup B|∣A∪B∣) is calculated by adding the sizes of the individual sets and then subtracting the size of their intersection (since the elements in the intersection were counted twice). This is the basic idea of the Inclusion-Exclusion Principle:

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

    Where:

    • ∣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 common to both sets AAA and BBB.

    Example:

    Suppose we have:

    • A={1,2,3,4}A = \{1, 2, 3, 4\}A={1,2,3,4}, so ∣A∣=4|A| = 4∣A∣=4,
    • B={3,4,5,6}B = \{3, 4, 5, 6\}B={3,4,5,6}, so ∣B∣=4|B| = 4∣B∣=4,
    • The intersection A∩B={3,4}A \cap B = \{3, 4\}A∩B={3,4}, so ∣A∩B∣=2|A \cap B| = 2∣A∩B∣=2.

    Then the number of elements in A∪BA \cup BA∪B is:

    ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣=4+4−2=6.|A \cup B| = |A| + |B| - |A \cap B| = 4 + 4 - 2 = 6.∣A∪B∣=∣A∣+∣B∣−∣A∩B∣=4+4−2=6.

    Thus, the union A∪B={1,2,3,4,5,6}A \cup B = \{1, 2, 3, 4, 5, 6\}A∪B={1,2,3,4,5,6} has 6 elements.


    2. Generalized Inclusion-Exclusion Principle

    The principle can be extended to more than two sets. The generalized Inclusion-Exclusion formula for three sets AAA, BBB, and CCC is as follows:

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

    This formula accounts for:

    1. Adding the sizes of the individual sets AAA, BBB, and CCC.
    2. Subtracting the sizes of the pairwise intersections A∩BA \cap BA∩B, A∩CA \cap CA∩C, and B∩CB \cap CB∩C to avoid double-counting the elements that are in more than one set.
    3. Adding back the size of the intersection of all three sets, A∩B∩CA \cap B \cap CA∩B∩C, because it was subtracted three times (once for each pairwise intersection) and must be added back.

    Example:

    Suppose we have:

    • A={1,2,3,4}A = \{1, 2, 3, 4\}A={1,2,3,4},
    • B={3,4,5,6}B = \{3, 4, 5, 6\}B={3,4,5,6},
    • C={4,5,6,7}C = \{4, 5, 6, 7\}C={4,5,6,7}.

    The intersections are:

    • ∣A∩B∣=2|A \cap B| = 2∣A∩B∣=2 (common elements: 3,43, 43,4),
    • ∣A∩C∣=1|A \cap C| = 1∣A∩C∣=1 (common element: 444),
    • ∣B∩C∣=2|B \cap C| = 2∣B∩C∣=2 (common elements: 4,54, 54,5),
    • ∣A∩B∩C∣=1|A \cap B \cap C| = 1∣A∩B∩C∣=1 (common element: 444).

    The number of elements in the union A∪B∪CA \cup B \cup CA∪B∪C is:

    ∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣A∩C∣−∣B∩C∣+∣A∩B∩C∣|A \cup B \cup C| = |A| + |B| + |C| - |A \cap B| - |A \cap C| - |B \cap C| + |A \cap B \cap C|∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣A∩C∣−∣B∩C∣+∣A∩B∩C∣ ∣A∪B∪C∣=4+4+4−2−1−2+1=4.|A \cup B \cup C| = 4 + 4 + 4 - 2 - 1 - 2 + 1 = 4.∣A∪B∪C∣=4+4+4−2−1−2+1=4.

    Thus, the union A∪B∪CA \cup B \cup CA∪B∪C has 4 elements, which are {1,2,3,4,5,6,7}\{1, 2, 3, 4, 5, 6, 7\}{1,2,3,4,5,6,7}.


    3. The General Formula for nnn Sets

    For nnn sets A1,A2,…,AnA_1, A_2, \dots, A_nA1​,A2​,…,An​, the Inclusion-Exclusion Principle is expressed as:

    ∣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​∣

    This formula alternates between adding and subtracting the sizes of intersections of the sets to account for overcounting.

    Example:

    Suppose we have three sets A,B,CA, B, CA,B,C, and we want to count the number of elements in A∪B∪CA \cup B \cup CA∪B∪C. Using the Inclusion-Exclusion formula:

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

    This can be extended further for more sets, ensuring no element is counted multiple times.


    4. Applications of the Inclusion-Exclusion Principle

    1. Counting Problems: The Inclusion-Exclusion Principle is often used in counting problems to determine the size of the union of several sets, particularly in combinatorics, probability, and computer science.

    2. Probability: It is used to calculate the probability of the union of events in probability theory. If events AAA and BBB are not mutually exclusive, the probability of A∪BA \cup BA∪B is given by:

      P(A∪B)=P(A)+P(B)−P(A∩B).P(A \cup B) = P(A) + P(B) - P(A \cap B).P(A∪B)=P(A)+P(B)−P(A∩B).
    3. Set Theory: It provides a method for solving problems involving intersections and unions of sets, particularly when the sets overlap.

    4. Graph Theory: In graph theory, the Inclusion-Exclusion Principle is used to count the number of subgraphs or paths that satisfy certain conditions, especially when overlapping criteria are involved.

    5. Permutations and Combinations: In problems involving arrangements or selections, it helps to compute the number of ways certain conditions can be satisfied, especially when some conditions overlap.


    5. Conclusion

    The Inclusion-Exclusion Principle is a powerful tool in combinatorics and counting, allowing for the accurate calculation of the size of unions of multiple sets by systematically accounting for overlaps. It works by initially adding the sizes of the individual sets and then subtracting the overcounted elements from the intersections, ensuring no element is counted more than once. This principle has broad applications in various areas of mathematics, including probability, set theory, graph theory, and more.

    ← Previous topic 30
    Number Theory: Sequences and Series
    Next topic 32 →
    Pigeonhole Principle

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    12mremaining
    2.1kwords
    Intermediatelevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Discrete Structures