cardinality
C2Pronunciation
UK
- /kɑːdɪˈnælɪti/countableuncountablenoun
US
- /kɑrdɪˈnælɪti/countableuncountablenoun
Description
- size of a set
- number of elements
- how many items
Imagine you're counting the apples in a basket – that count represents the cardinality of the apple set! It’s a precise way to say “how many” when talking about groups or sets. In mathematics, it means the number of elements in a set. And it isn’t limited to everyday counting: mathematicians also use it to compare infinite sets in surprisingly subtle ways. In computer science and databases, you’ll also hear it when people talk about how many distinct values a field can take, or whether a relationship is one-to-one, one-to-many, and so on. If you’re sorting LEGO bricks by color, the cardinality of the red-brick pile is simply how many red bricks you have.
Once upon a time, mathematicians needed a precise way to talk about the "size" of collections – not just counting things like sheep or apples, but also dealing with abstract sets and even infinite collections! That's where cardinality comes in.
At its most basic, cardinality is the number of elements in a set. If you have a bag containing three marbles, the cardinality of that bag is 3. Simple enough, right? But things get interesting when we move beyond finite sets. What about the set of all even numbers? It's infinite! Yet, mathematicians can still assign a cardinality to it – and compare it to the cardinality of other infinite sets.
In set theory, cardinality isn't just about counting; it's about establishing a one-to-one correspondence (a bijection) between elements in two sets. If you can pair up every element in Set A with exactly one element in Set B (and vice versa), then those sets have the same cardinality – even if they contain different types of things!
The cardinality of the set of natural numbers (1, 2, 3…) is called "aleph-null" (written as ℵ₀). Surprisingly, the set of all integers (…-2, -1, 0, 1, 2…) also has the same cardinality – even though it feels bigger! This shows that infinity isn't just one size; there are different "levels" of infinity.
Outside pure math, the word shows up in computer science and databases too. There it often means “how many distinct values are possible here?” (for example, how many unique customer IDs exist), or it describes how entities relate (one-to-one vs. one-to-many).
You'll encounter cardinality in mathematics, computer science, and logic. It's a fundamental concept for understanding how we measure and compare the sizes of collections, whether they're finite or infinite. So next time you're counting something, remember you're calculating its cardinality – and stepping into a world of mathematical wonder!
Examples
- 1
Set theory
Two sets can have the same cardinality even if they contain different elements.
- 2
Database filtering
In database design, this column has high cardinality, so it is useful for filtering results.
Domain
high cardinality
many different values
- 3
Data relationships
The diagram shows a one-to-many cardinality between customers and orders.
Domain
one-to-many cardinality
one item on one side can be linked to many on the other side
Forms and spellings
1 form open this card.
Main spelling
- cardinalitynoun