Cardinality of a Set

Trigonometry

Trigonometry Logo

Cardinality of a Set

Definition

Consider a set A. If A contains exactly n elements, where n0, then we say that the set A is finite and its cardinality is equal to the number of elements n. The cardinality of a set A is denoted by |A|. For example,

A={1,2,3,4,5},|A|=5.

Recall that we count only distinct elements, so |{1,2,1,4,2}|=3.

The cardinality of the empty set is equal to zero:

||=0.

The concept of cardinality can be generalized to infinite sets.

Two infinite sets A and B have the same cardinality (that is, |A|=|B|) if there exists a bijection AB. This bijection-based definition is also applicable to finite sets. A bijection between finite sets A and B will exist if and only if |A|=|B|=n.

If no bijection exists from A to B, then the sets have unequal cardinalities, that is, |A||B|.

If sets A and B have the same cardinality, they are said to be equinumerous. In this case, we write AB. More formally,

AB iff |A|=|B|.

Equinumerosity is an equivalence relation on a family of sets. The equivalence class of a set A under this relation contains all sets with the same cardinality |A|.

Examples of Sets with Equal Cardinalities

The Sets N and O

The mapping f:NO between the set of natural numbers N and the set of odd natural numbers O={1,3,5,7,9,} is defined by the function f(n)=2n1, where nN. This function is bijective. Therefore both sets N and O have the same cardinality: |N|=|O|.

Two Finite Intervals

Let (a,b) and (c,d) be two open finite intervals on the real axis. We show that any intervals (a,b) and (c,d) have the equal cardinality.

The mapping from (a,b) and (c,d) is given by the function

f(x)=c+dcba(xa)=y,

where x(a,b) and \(y \in \left( {c,d} \right).

Check the mapping of the endpoints:

f(a)=c+dcba(aa)=c+0=c,
f(b)=c+dcba(ba)=c+dc=d.

Prove that the function f is injective. The contrapositive statement is f(x1)=f(x2) for x1x2. If so, then we have

f(x1)=f(x2),c+dcba(x1a)=c+dcba(x2a),dcba(x1a)=dcba(x2a),x1a=x2a,x1=x2.

This is a contradiction. Therefore the function f is injective.

Make sure that f is surjective. Take a number y from the codomain (c,d) and find the preimage x:

y=c+dcba(xa),dcba(xa)=yc,xa=badc(yc),x=a+badc(yc).

The preimage x lies in the domain (a,b) and

f(x)=f(a+badc(yc))=c+dcba(a+badc(yc)a)=c+dcbabadc(yc)=c+yc=y.

We see that the function f is surjective. Since f is both injective and surjective, it is bijective. Hence, the intervals (a,b) and (c,d) are equinumerous.

The Sets N and Z

This canonical example shows that the sets N and Z are equinumerous. To prove this, we need to find a bijective function from N to Z (or from Z to N).

Let's arrange all integers zZ in the following order:

0,1,1,2,2,3,3,4,4,

Now we numerate this sequence with natural numbers 1,2,3,4,5,. As a result, we get a mapping from Z to N that is described by the function

n=f(z)={2z+1,if z02|z|,if z<0.

The function f is injective because f(z1)f(z2) whenever z1z2. It is also surjective because, given any natural number nN, there is an integer zZ such that n=f(z). Hence, the function f is bijective, which means that both sets N and Z are equinumerous:

|N|=|Z|.

Cardinality of the Sets N and R

It is interesting to compare the cardinalities of two infinite sets: N and R. It turns out that |N||R|. This was proved by Georg Cantor in 1891 who showed that there are infinite sets which do not have a bijective mapping to the set of natural numbers N. This proof is known as Cantor's diagonal argument.

Consider an arbitrary function f:NR. Suppose the function has the following values f(n) for the first few entries n:

Figure 1.

We now construct a diagonal that covers the nth decimal place of f(n) for each nN. This diagonal helps us find a number b in the codomain R that does not match any value of f(n).

Take, the first number f(1)=0.58109205 and change the 1st decimal place value to something different, say 59. Similarly, take the second number f(2)=5.30159257 and change the 2nd decimal place: 06. Continue this process for all nN. The number b=0.96 will consist of the modified values in each cell of the diagonal. It is clear that f(n)b for any nN. This means that the function f is not surjective. Hence, there is no bijection from N to R. Therefore

|N||R|.