In set theory, the cardinality of a set is the total number of elements in the set (sometimes also called the size of the set). The cardinality of a set is commonly denoted using the absolute value symbol, where S represents the set: \( \mid S \mid \)
$$\text{For example, the set: \( A = \{1,2,3,4,5\} \) has a cardinality of 5. We can formally write this as \( \mid A \mid \: = 5\; \)}$$
$$\\{\Large \textbf{The Empty Set} }$$
The empty set is a set with no elements. It is denoted as: \( \varnothing = \{\} \). The cardinality of the empty set is 0. You can also present this as : \( \mid \varnothing \mid \: = 0 \) $$\\\\$$
Cardinality is important because it enables us to compare the sizes of multiple sets. It also helps us formally define the idea of finite and infinite sets. A set is finite if it has a finite cardinality, meaning it has a finite number of elements. Likewise, a set is infinite if it has an infinite number of elements, such as the set of integers:
\( \mathbb{Z} = \{\ldots, -3, -2, -1, 0, 1, 2, 3, \ldots\} \)