Discrete Mathematics

🧩Discrete Mathematics Unit 2 – Set Theory

Set theory is a fundamental branch of mathematics that deals with collections of objects called sets. It provides a framework for analyzing and manipulating these collections, serving as a foundation for many areas of math and playing a crucial role in computer science. Key concepts in set theory include elements, subsets, and set operations like union and intersection. The field also encompasses various types of sets, set notation, and visual representations like Venn diagrams. Set identities and laws form the basis for logical reasoning in mathematics and computer science applications.

What's Set Theory?

  • Branch of mathematical logic dealing with the study of collections of objects called sets
  • Fundamental concept in mathematics provides a framework for analyzing and manipulating collections of objects
  • Developed by German mathematician Georg Cantor in the late 19th century
  • Cantor's work on set theory revolutionized mathematics by providing a rigorous foundation for the concept of infinity
  • Set theory serves as a foundation for many areas of mathematics, including topology, analysis, and algebra
  • Plays a crucial role in computer science, particularly in the design and analysis of algorithms and data structures
  • Set theory axioms, such as the axiom of choice, have significant implications for the foundations of mathematics

Key Concepts and Definitions

  • Set: A collection of distinct objects or elements
    • Elements can be anything: numbers, symbols, other sets, etc.
    • Order of elements does not matter
    • Duplicates are not allowed
  • Element or Member: An object that belongs to a set
    • Denoted by the symbol \in, e.g., aAa \in A means "a is an element of set A"
  • Subset: A set A is a subset of set B if every element of A is also an element of B
    • Denoted by the symbol \subseteq, e.g., ABA \subseteq B means "A is a subset of B"
    • Every set is a subset of itself
  • Proper Subset: A set A is a proper subset of set B if A is a subset of B, but A is not equal to B
    • Denoted by the symbol \subset, e.g., ABA \subset B means "A is a proper subset of B"
  • Superset: A set B is a superset of set A if every element of A is also an element of B
    • Denoted by the symbol \supseteq, e.g., BAB \supseteq A means "B is a superset of A"
  • Cardinality: The number of elements in a set
    • Denoted by vertical bars, e.g., A|A| represents the cardinality of set A

Types of Sets

  • Empty Set or Null Set: A set with no elements
    • Denoted by the symbol \emptyset or {}\{\}
  • Singleton Set: A set containing exactly one element
  • Finite Set: A set with a finite number of elements
    • Example: A={1,2,3}A = \{1, 2, 3\}
  • Infinite Set: A set with an infinite number of elements
    • Example: The set of all natural numbers, N={1,2,3,...}\mathbb{N} = \{1, 2, 3, ...\}
  • Universal Set: A set that contains all elements under consideration in a given context
    • Denoted by the symbol UU or Ω\Omega
  • Disjoint Sets: Two sets are disjoint if they have no elements in common
    • Example: A={1,2,3}A = \{1, 2, 3\} and B={4,5,6}B = \{4, 5, 6\} are disjoint sets
  • Equal Sets: Two sets are equal if they have exactly the same elements
    • Order of elements does not matter

Set Operations

  • Union: The union of two sets A and B, denoted by ABA \cup B, is the set of all elements that belong to either A or B, or both
    • Example: If A={1,2,3}A = \{1, 2, 3\} and B={3,4,5}B = \{3, 4, 5\}, then AB={1,2,3,4,5}A \cup B = \{1, 2, 3, 4, 5\}
  • Intersection: The intersection of two sets A and B, denoted by ABA \cap B, is the set of all elements that belong to both A and B
    • Example: If A={1,2,3}A = \{1, 2, 3\} and B={3,4,5}B = \{3, 4, 5\}, then AB={3}A \cap B = \{3\}
  • Difference: The difference of two sets A and B, denoted by ABA - B or ABA \setminus B, is the set of all elements that belong to A but not to B
    • Example: If A={1,2,3}A = \{1, 2, 3\} and B={3,4,5}B = \{3, 4, 5\}, then AB={1,2}A - B = \{1, 2\}
  • Symmetric Difference: The symmetric difference of two sets A and B, denoted by ABA \triangle B or ABA \oplus B, is the set of all elements that belong to either A or B, but not both
    • Example: If A={1,2,3}A = \{1, 2, 3\} and B={3,4,5}B = \{3, 4, 5\}, then AB={1,2,4,5}A \triangle B = \{1, 2, 4, 5\}
  • Complement: The complement of a set A, denoted by AcA^c or AA', is the set of all elements in the universal set that do not belong to A
    • Example: If U={1,2,3,4,5}U = \{1, 2, 3, 4, 5\} and A={1,2,3}A = \{1, 2, 3\}, then Ac={4,5}A^c = \{4, 5\}
  • Cartesian Product: The Cartesian product of two sets A and B, denoted by A×BA \times B, is the set of all ordered pairs (a,b)(a, b) where aAa \in A and bBb \in B
    • Example: If A={1,2}A = \{1, 2\} and B={a,b}B = \{a, b\}, then A×B={(1,a),(1,b),(2,a),(2,b)}A \times B = \{(1, a), (1, b), (2, a), (2, b)\}

Set Notation and Symbols

  • Curly Braces {}\{\}: Used to denote a set by listing its elements
    • Example: A={1,2,3}A = \{1, 2, 3\}
  • Element Of \in: Used to denote that an element belongs to a set
    • Example: 1A1 \in A means "1 is an element of set A"
  • Not an Element Of \notin: Used to denote that an element does not belong to a set
    • Example: 4A4 \notin A means "4 is not an element of set A"
  • Subset \subseteq: Used to denote that one set is a subset of another
    • Example: ABA \subseteq B means "A is a subset of B"
  • Proper Subset \subset: Used to denote that one set is a proper subset of another
    • Example: ABA \subset B means "A is a proper subset of B"
  • Union \cup: Used to denote the union of two sets
    • Example: ABA \cup B represents the union of sets A and B
  • Intersection \cap: Used to denote the intersection of two sets
    • Example: ABA \cap B represents the intersection of sets A and B
  • Set-Builder Notation: Used to describe a set by stating the properties that its elements must satisfy
    • Example: A={xx is a prime number less than 10}={2,3,5,7}A = \{x \mid x \text{ is a prime number less than 10}\} = \{2, 3, 5, 7\}

Venn Diagrams

  • Visual representation of sets and their relationships using overlapping circles or other closed curves
  • Each set is represented by a circle or closed curve
  • Overlapping regions represent elements that belong to multiple sets
  • Non-overlapping regions represent elements that belong to only one set
  • Shading is used to represent the result of set operations or to emphasize specific regions
  • Venn diagrams are particularly useful for illustrating set operations such as union, intersection, and difference
  • Example: A Venn diagram with two circles, A and B, where the overlapping region represents ABA \cap B and the non-overlapping regions represent ABA - B and BAB - A

Set Identities and Laws

  • Commutative Laws:
    • Union: AB=BAA \cup B = B \cup A
    • Intersection: AB=BAA \cap B = B \cap A
  • Associative Laws:
    • Union: (AB)C=A(BC)(A \cup B) \cup C = A \cup (B \cup C)
    • Intersection: (AB)C=A(BC)(A \cap B) \cap C = A \cap (B \cap C)
  • Distributive Laws:
    • A(BC)=(AB)(AC)A \cup (B \cap C) = (A \cup B) \cap (A \cup C)
    • A(BC)=(AB)(AC)A \cap (B \cup C) = (A \cap B) \cup (A \cap C)
  • Identity Laws:
    • Union: A=AA \cup \emptyset = A
    • Intersection: AU=AA \cap U = A
  • Complement Laws:
    • (Ac)c=A(A^c)^c = A
    • AAc=UA \cup A^c = U
    • AAc=A \cap A^c = \emptyset
  • De Morgan's Laws:
    • (AB)c=AcBc(A \cup B)^c = A^c \cap B^c
    • (AB)c=AcBc(A \cap B)^c = A^c \cup B^c

Applications in Math and CS

  • Set theory is the foundation for many branches of mathematics, including:
    • Topology: Study of properties preserved under continuous deformations
    • Analysis: Study of functions, limits, derivatives, and integrals
    • Algebra: Study of algebraic structures such as groups, rings, and fields
  • In computer science, set theory is used in:
    • Relational databases: Based on set theory and use set operations for querying data
    • Algorithms: Many algorithms are designed and analyzed using set theory concepts
    • Data structures: Sets, hash tables, and trees are common data structures based on set theory
  • Set theory is used to formalize concepts in probability theory and statistics
    • Events are modeled as sets, and probabilities are assigned to these sets
  • Formal languages and automata theory heavily rely on set theory
    • Languages are defined as sets of strings, and operations on languages correspond to set operations
  • Cryptography and coding theory use set theory to analyze and design secure systems
    • Example: Hamming codes, used for error correction, are based on set theory principles


© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.

© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.