§ — — Discrete Structures 1
A set is an unordered collection of distinct elements. Sets group objects that share (or are selected by) some property. Sets are the foundational structure of discrete mathematics.
List all elements, separated by commas, enclosed in curly braces.
Examples:
Describe all elements using a rule or condition.
Examples:
The cardinality of a set is its size — the number of distinct elements. Written as |A|.
Examples:
All elements belonging to either set A or set B (or both).
A ∪ B = {x | x ∈ A or x ∈ B}
Example: A = {1, 2, 5, 8}, B = {1, 3, 4, 6, 7} A ∪ B = {1, 2, 3, 4, 5, 6, 7, 8}
Only the elements that appear in both A and B.
A ∩ B = {x | x ∈ A and x ∈ B}
Example: A = {1, 2, 3, 4}, B = {2, 4, 6, 8} A ∩ B = {2, 4}
All elements in the universal set U that are not in A.
Example: A = {1, 2, 3, 4}, U = {1, 2, 3, 4, 5, 6, 7, 8} A' = {5, 6, 7, 8}
Elements in A that are not in B.
A − B = {x | x ∈ A and x ∉ B}
Example: A = {1, 2, 3, 4, 5}, B = {3, 4} A − B = {1, 2, 5}
The set of all ordered pairs (a, b) where a ∈ A and b ∈ B.
|A × B| = |A| × |B|
Example: A = {1, 2}, B = {a, b} A × B = {(1,a), (1,b), (2,a), (2,b)}
These mirror De Morgan's laws for propositional logic.
When counting the union of two sets where some elements overlap:
|A ∪ B| = |A| + |B| − |A ∩ B|
For three sets:
|A ∪ B ∪ C| = |A| + |B| + |C| − |A ∩ B| − |A ∩ C| − |B ∩ C| + |A ∩ B ∩ C|
ProReviewer — locked
Drills, code labs, and full solutions.
Done with this module? Track it — your progress shows on the subject list.
Up next
Lesson 5: Relations and Their Properties→←Previous: Lesson 3: Predicate Logic and Quantifiers