6

The set $S$ of all pairs of integers can be represented as $\{i \ | \ i \in \mathbb{Z} \} \times \{j\ | \ j \in \mathbb{Z}\}$. In other words, all coordinates on the cartesian plane where $x, y$ are integers.

I also know that a set is countable when $|S|\leq |\mathbb{N}^+|$. I attempted to map out a bijective function, $f : \mathbb{N}^+ \rightarrow S$.

$1 \rightarrow (1,1) \\ 2 \rightarrow (1,2)\\ 3 \rightarrow (1,3) \\ \quad \vdots $

I determined from this that the natural numbers can only keep up with $(1,*)$. But there is the ordered pairs where $x=2,3,4,\cdots$ not to mention the negative integers. In other words, $|S|\geq |\mathbb{N}^+|$ and therefore $S$ is not countably infinite.

Is this correct? (I don't think it is... Something to do with my understanding of infinite sets)

James
  • 1,320
  • As Brian mentions "Cantor's pairing function" will do the job directly. However, it may be easier to understand: First prove that the union of countably many countable sets is countable (See Cantor's first diagonal argument). Then we can write $\mathbb{N}\times\mathbb{N} = \bigcup(\mathbb{N}\times{n})$ and hence the product is countable – Deven Ware Aug 28 '12 at 04:24
  • Perhaps you mean natural numbers, rather than integers ($\mathbb N$ usually denotes natural numbers while $\mathbb Z$ denotes integers)? Either way, the set of pairs of natural numbers/integers is countably infinite; just because the function you found is not a bijection does not mean no bijection exists. – Alex Becker Aug 28 '12 at 04:26
  • yes, i meant integers. sorry about that – James Aug 28 '12 at 04:29

5 Answers5

20

Natural Numbers: There are many pairing functions that map $\mathbb{N}\times \mathbb{N}$ bijectively to $\mathbb{N}$. A simple example is the mapping $f$ such that $f(a,b)=2^{a-1}(2b-1)$. For every positive integer $y$ can be uniquely expressed as a power of $2$ times an odd integer.

Integers: If you want a mapping $g(x,y)$ that maps $\mathbb{Z}\times \mathbb{Z}$ bijectively to $\mathbb{N}$, it is simplest to split the work into two parts.

Let $\phi$ be any mapping that maps $\mathbb{Z}$ bijectively to $\mathbb{N}$. For a concrete example of such a mapping, let $\phi(t)=2t+2$ if $t \ge 0$, and let $\phi(t)=-(2t+1)$ if $t \lt 0$. The non-negative integers are sent to the even integers $\ge 2$, and the negative integers are sent to the positive odd integers.

Then the mapping $g(x,y)=f(\phi(x),\phi(y))$ works, where $f$ is any bijective map from $\mathbb{N}\times \mathbb{N}$ to $\mathbb{N}$. For example, we can use the mapping $f$ of the first paragraph, or the Cantor pairing function.

Remark: For most purposes, there is no particular virtue in having an explicit bijection, as long as we can prove that a bijection exists.

André Nicolas
  • 507,029
12

You simply haven’t yet found a function that works. One that does is the Cantor pairing function, which is described quite well in the Wikipedia article to which I linked.

Brian M. Scott
  • 616,228
0

Many different (correct) approaches were already explained in other answers. Another approach, often used in computer programs (for various reasons), is to enumerate ever bigger finite sets, with some kind of natural enumeration within them. For example, visualize the plane as a set of concentric squares, and enumerate the differences between squares (the square "corridors" of width one). The first will contain only one pair $(0, 0)$, the second - 8 pairs around it, etc. Your overall enumeration basically runs ever bigger circles around the origin, except the circles are squares. It is actually not that different from Cantor's pairing, but may be easier to visualize for all four quadrants.

0

Define $\sigma: \Bbb Z \times \Bbb Z \to \Bbb Z \times \Bbb Z$ by

$$ \sigma(m,n) = \left\{\begin{array}{lr} (1,-1), & \text{for } (m,n) = (0,0)\\ (m, n+1), & \text{for } m \gt 0 \, \land \, -m \le n \lt m\\ (m-1, n), & \text{for } n \gt 0 \, \land \, -n \lt m \le n\\ (m, n-1), & \text{for } m \lt 0 \, \land \, m \lt n \le -m\\ (m+1, n), & \text{for } n \lt 0 \, \land \, n \le m \lt -n-1\\ (m+2,n-1), & \text{for } n \lt 0 \, \land \, m = -n-1 \end{array}\right\} $$

Exercise: Show that $n \mapsto \sigma^n(0,0)$ is a bijective mapping between $\{0,1,2,3,...\}$ and $\Bbb Z \times\Bbb Z$.

CopyPasteIt
  • 11,366
-3

A more general result is a mapping between the set of integers to the set of finite tuples of integers of any size

If we order all positive ordered tuples of integers by their sum, we get the following:

$1\\ 2\\ 1, 1\\ 3\\ 2, 1\\ 1, 2\\ 1, 1, 1\\ 4\\ 3, 1\\ 2, 2\\ 2, 1, 1\\ 1, 3\\ 1, 2, 1\\ 1, 1, 2\\ 1, 1, 1, 1\\ etc.$

Clearly this set contains all possible finite ordered tuples of integers.

Next, we can define a mapping from the positive integers to these values as follows:

$0001 \rightarrow1 \\ 0010 \rightarrow 2\\ 0011 \rightarrow 1, 1\\ 0100 \rightarrow 3\\ 0101 \rightarrow 2, 1\\ 0110 \rightarrow 1, 2\\ 0111 \rightarrow 1, 1, 1\\ 1000 \rightarrow 4\\ 1001 \rightarrow 3, 1\\ 1010 \rightarrow 2, 2\\ 1011 \rightarrow 2, 1, 1\\ 1100 \rightarrow 1, 3\\ 1101 \rightarrow 1, 2, 1\\ 1110 \rightarrow 1, 1, 2\\ 1111 \rightarrow 1, 1, 1, 1\\ etc.$

And note that this mapping can be performed easily by adding one to every "1" for every zero after it, and then removing those zeros. This can be more formally described in terms of logarithms or dividing by/modulo 2, but that seems sufficient to get the point across. The interesting part is this has the result of proving that the cardinality of the set of integers is the same as the cardinality of the set of all finite ordered tuples of integers, the set of all finite ordered tuples of finite ordered tuples, etc.

Back to your question, we can just remove all tuples from that list above that aren’t of size two and then renumber it, giving us:

$ 0001 \rightarrow 1, 1\\ 0010 \rightarrow 2, 1\\ 0011 \rightarrow 1, 2\\ 0100 \rightarrow 3, 1\\ 0101 \rightarrow 2, 2\\ 0110 \rightarrow 1, 3\\ etc.$

which provides a one to one map of integers to pairs of integers, which is sufficient to prove the claim. You can do the same thing, but only keeping ordered tuples of size 3 to prove that the cardinality of the integers = the cardinality of all trios of integers, the same for 4, etc.

This answer does not include the negative numbers, but you can do that easily by padding the list with all the negative signs as well:

$1\\ -1\\ 2\\ -2\\ 1, 1\\ 1,-1\\ -1,1\\ -1,-1\\ 3\\ -3\\ 2, 1\\ 2,-1\\ -2,1\\ -2,-1\\ 1, 2\\ 1,-2\\ -1,2\\ -1,-2\\ 1, 1, 1\\ 1,1,-1\\ 1,-1,1\\ 1,-1,-1\\ -1,1,1\\ -1,1,-1\\ -1,-1,1\\ -1,-1,-1\\ 4\\ -4\\ etc.$

Phylliida
  • 233
  • 2
    (1) Please observe the distinction between sets (unordered and no repeats) and ordered tuples. (2) "... the cardinality of the set of integers is the same as the cardinality of the set of sets of integers, the set of sets of sets of integers, the set of sets of sets of sets of integers, etc." is missing a lot of instances of the word "finite". (3) I feel the writing here isn't very clear in general. I still don't know what you're trying to do with the Pascal's triangle, for example. – epimorphic Jun 04 '14 at 04:56
  • (As a disclaimer, this answer was given with the rather limited understanding of math I had at the time and all of your critiques make sense) – Phylliida Dec 04 '16 at 06:22