Skip to main content

Countability and Computability

We have been counting finite objects and now we will move on to infinite objects. Notice that we rely a lot on the notion of bijections as a way to show that two sets have the same cardinality, i.e., if we can show a bijection f:ABf: A \rightarrow B, then A=B|A| = |B| as a result. This concept in fact extends to infinite sets naturally.

Example 30

The set N={0,1,}{\mathbb N} = \{0,1,\ldots\} and 2N={0,2,4,}2 {\mathbb N} = \{0,2,4,\ldots \} have the same cardinality.

Proof:

Define the function f(n)=2nf(n) = 2n. Notice that this mapping is a bijection f:N2Nf: {\mathbb N} \rightarrow 2 {\mathbb N}.

Notice that it might be tempting to say that N{\mathbb N} is clearly bigger than 2N2{\mathbb N} (since in particular is a superset!), but the behavior of infinite is not as obvious as the finite one. A bijection is a definite and undeniable proof that they have the same cardinality. The next example is a bit less obvious.

Example 31

The set N{\mathbb N} and Z{\mathbb Z} have the same cardinality.

Proof:

Define

f(n)={n/2,if n is even  (n+1)/2,otherwisef(n) = \begin{cases} n/2, & \text{if $n$ is even }\ \\ -(n+1)/2, & \text{otherwise} \end{cases}

This is a mapping from N{\mathbb N} to Z{\mathbb Z}. To prove that it is one-to-one, suppose f(a)=f(b)f(a) = f(b) (we will need to argue that this would imply a=ba=b), there are three cases to analyze:

  • If aa and bb are even, then we have a/2=b/2a/2 = b/2 and therefore a=ba=b.
  • If both aa and bb are odd, it is similar to the above case.
  • Finally, if aa and bb have different parities, let us consider the case when aa is even and bb is odd (the other case is symmetric). Then we have a/2=(b+1)/2a/2 = -(b+1)/2 which implies that a=(b+1)a= -(b+1). This means that aa is a negative integer, which is impossible.

To argue that ff is onto, consider an integer mZm \in {\mathbb Z}. If mm is non-negative, then f(2m)=mf(2m) = m. If mm is negative, then we have f(2m1)=mf(-2m-1) = m.