Docsity

Operations on Sets: Union, Intersection, Complement, and Algebraic Properties, Study notes of Computer Science

Toggle sidebar
bg1
1
Operations on Sets – Page 1CSCI 1900 – Discrete Structures
CSCI 1900
Discrete Structures
Operations on Sets
Reading: Kolman, Section 1.2
Operations on Sets – Page 2CSCI 1900 – Discrete Structures
Operation on Sets
• An operation on a set is where two sets
are combined to produce a third
Operations on Sets – Page 3CSCI 1900 – Discrete Structures
Union
•A∪B= {x | x ∈Aor x ∈B}
• Example:
Let A= {a, b, c, e, f} and B= {b, d, r, s}
A∪B= {a, b, c, d, e, f, r, s}
• Venn diagram
Operations on Sets – Page 4CSCI 1900 – Discrete Structures
Intersection
•A∩B= {x | x ∈Aand x ∈B}
•Example:
Let A= {a, b, c, e, f},
B= {b, e, f, r, s}, and C= {a, t, u, v}.
A∩B= {b, e, f}
A∩C= {a}
B∩C= { }
• Venn diagram
Operations on Sets – Page 5CSCI 1900 – Discrete Structures
Disjoint Sets
Disjoint sets are sets where the intersection
results in the empty set
Not disjoint Disjoint
Operations on Sets – Page 6CSCI 1900 – Discrete Structures
Unions and Intersections Across
Multiple Sets
Both intersection and union can be
performed on multiple sets
–A∪B∪C= {x | x ∈Aor x ∈Bor x ∈C}
–A∩B∩C= {x | x ∈Aand x ∈Band x ∈C}
– Example:
A= {1, 2, 3, 4, 5, 7}, B= {1, 3, 8, 9}, and C=
{1, 3, 6, 8}.
A∪B∪C= {1, 2, 3, 4, 5, 6, 7, 8, 9}
A∩B∩C= {1, 3}
pf3

Partial preview of the text

Download Operations on Sets: Union, Intersection, Complement, and Algebraic Properties and more Study notes Computer Science in PDF only on Docsity!

CSCI 1900 – Discrete Structures Operations on Sets – Page 1

CSCI 1900

Discrete Structures

Operations on Sets Reading: Kolman, Section 1.

CSCI 1900 – Discrete Structures Operations on Sets – Page 2

Operation on Sets

  • An operation on a set is where two sets are combined to produce a third

CSCI 1900 – Discrete Structures Operations on Sets – Page 3

Union

  • A ∪ B = {x | x ∈ A or x ∈ B }
  • Example: Let A = {a, b, c, e, f} and B = {b, d, r, s} A ∪ B = {a, b, c, d, e, f, r, s}
  • Venn diagram

CSCI 1900 – Discrete Structures Operations on Sets – Page 4

Intersection

  • A ∩ B = {x | x ∈ A a n d x ∈ B }
  • Example: Let A = {a, b, c, e, f}, B = {b, e, f, r, s}, and C = {a, t, u, v}. A ∩ B = {b, e, f} A ∩ C = {a} B ∩ C = { }
  • Venn diagram

CSCI 1900 – Discrete Structures Operations on Sets – Page 5

Disjoint Sets

Disjoint sets are sets where the intersection results in the empty set

Not disjoint Disjoint

CSCI 1900 – Discrete Structures Operations on Sets – Page 6

Unions and Intersections Across

Multiple Sets

Both intersection and union can be performed on multiple sets

  • A ∪ B ∪ C = {x | x ∈ A or x ∈ B or x ∈ C }
  • A ∩ B ∩ C = {x | x ∈ A and x ∈ B and x ∈ C }
  • Example: A = {1, 2, 3, 4, 5, 7}, B = {1, 3, 8, 9}, and C = {1, 3, 6, 8}. A ∪ B ∪ C = {1, 2, 3, 4, 5, 6, 7, 8, 9} A ∩ B ∩ C = {1, 3}

CSCI 1900 – Discrete Structures Operations on Sets – Page 7

Complement

  • The complement of A (with respect to the universal set U ) – all elements of the universal set U that are not a member of A.
  • Denoted A
  • Example: If A = {x | x is an integer and x < 4} and U = Z , then A = {x | x is an integer and x > 4}
  • Venn diagram

CSCI 1900 – Discrete Structures Operations on Sets – Page 8

Complement “With Respect to…”

  • The complement of B with respect to A – all elements belonging to A , but not to B.
  • It’s as if U is in the complement is replaced with A.
  • Denoted A – B = {x | x ∈ A and x ∈ B }
  • Example: Assume A = {a, b, c} and B = {b, c, d, e} A – B = {a} B – A = {d, e}
  • Venn diagram B – A A – B

CSCI 1900 – Discrete Structures Operations on Sets – Page 9

Symmetric difference

  • Symmetric difference – If A and B are two sets, the symmetric difference is the set of elements belonging to A or B , but not both A and B.
  • Denoted A ⊕ B = {x | (x ∈ A and x ∈ B ) or (x ∈ B and x ∈ A )}
  • A ⊕ B = ( A – B ) ∪ ( B – A )
  • Venn diagram

CSCI 1900 – Discrete Structures Operations on Sets – Page 10

Algebraic Properties of Set Operations

  • Commutative properties A ∪ B = B ∪ A A ∩ B = B ∩ A
  • Associative properties A ∪ (B ∪ C) = (A ∪ B) ∪ C A ∩ (B ∩ C) = (A ∩ B) ∩ C
  • Distributive properties A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)

CSCI 1900 – Discrete Structures Operations on Sets – Page 11

More Algebraic Properties of Set

Operations

  • Idempotent properties A ∪ A = A A ∩ A = A
  • Properties of the complement (A) = A A ∪ A = U A ∩ A = ∅ ∅ = U U = ∅ A ∪ B = A ∩ B -- De Morgan’s law A ∩ B = A ∪ B -- De Morgan’s law CSCI 1900 – Discrete Structures Operations on Sets – Page 12

More Algebraic Properties of Set

Operations

  • Properties of a Universal Set A ∪ U = U A ∩ U = A
  • Properties of the Empty Set A ∪ ∅ = A or A ∪ { } = A A ∩ ∅ = ∅ or A ∩ { } = { }