In discrete mathematics, a set is one of the most fundamental concepts. It is used to represent collections of objects and forms the basis for many topics such as relations, functions, and logic.
Sets help in organizing and grouping data in a clear and structured way.
A set is a well-defined collection of distinct objects, called elements.
Sets are usually denoted by capital letters:
A, B, C, ...
Elements are written inside curly braces { }.
Elements are listed explicitly:
A = {1, 2, 3, 4}
Elements are described using a property:
A = {x | x is a natural number less than 5}
{1, 2, 3}{a, e, i, o, u}{2, 4, 6, 8}✔ Because they are subjective
If an element belongs to a set:
x ∈ A
If it does not belong:
x ∉ A
A set with no elements:
∅ or {}
A set with a limited number of elements:
A = {1, 2, 3}
A set with unlimited elements:
N = {1, 2, 3, ...}
Two sets are equal if they contain the same elements.
If all elements of A are in B:
A ⊆ B
The number of elements in a set is called its cardinality.
n(A)
Example:
A = {1, 2, 3} → n(A) = 3
Order does not matter:
{1, 2, 3} = {3, 2, 1}
No repetition:
{1, 1, 2} = {1, 2}
{ }∈) or do not belong (∉)