|
The cardinality of a set A is the number of elements in A, which is written as |A|. Note that this vertical-bar notation looks the same as absolute value notation, but the meaning of cardinality is different from absolute value. In particular, absolute value operates on numbers (e.g., |-3| = 3) while cardinality operates on sets (e.g., |{-3}| = 1). Examples of cardinality: - |{3,4}| = 2
- |{5,6,5,6,5,6,5,1,1,1}| = |{1,5,6}| = 3
- |{ }| = 0. The empty set has no elements.
- |{{1,2},{3,4}}| = 2. In this case the two elements of {{1,2},{3,4}} are themselves sets: {1,2} and {3,4}.
We can also consider the cardinality of infinite sets, a topic made cool by Georg Cantor. His work is beyond the scope of this introduction.
|