# Math Help - Countability/Cardinality Help!

1. ## Countability/Cardinality Help!

I don't understand how to do the following things,

(a) Let $f: X \rightarrow Y$ be a surjection. Show that if X is an infinite countable set then Y is either countable or finite. (set A is countable defined as |A| = |N|)

(b) By enumerating elements, or otherwise, show that the set of all ordered pairs of positive integers $Z^+ \times Z^+ = \{(a,b): a,b \in Z^+\}$ is countable.

(c) Deduce that the set of positive rationals $Q^+$ is countable.

(d) Show that the set of all subsets of $Z^+$ is uncountable [argue by contradiction]
------------------------------------------------------------------------
I don't understand how to do this stuff, any help is much appreciated.

2. Originally Posted by Jason Bourne
I don't understand how to do the following things,

(a) Let $f: X \rightarrow Y$ be a surjection. Show that if X is an infinite countable set then Y is either countable or finite. (set A is countable defined as |A| = |N|)

(b) By enumerating elements, or otherwise, show that the set of all ordered pairs of positive integers $Z^+ \times Z^+ = \{(a,b): a,b \in Z^+\}$ is countable.

(c) Deduce that the set of positive rationals $Q^+$ is countable.

(d) Show that the set of all subsets of $Z^+$ is uncountable [argue by contradiction]
------------------------------------------------------------------------
I don't understand how to do this stuff, any help is much appreciated.
Before we start, just note that whenever I mention $N$, or the naturals, I am referring to: 0,1,2,3,... (also known as the set of positive integers, or $Z^+$).

(a): We know that if exists a surjection $f: X \rightarrow Y$, then we deduce something about the cardinality of the two sets, specifically that $card(X) \geq card(Y)$. Since $X$ is countable, and the size of set $Y$ can be no bigger than that, $Y$ must be countably infinite (that is, there is also a bijection between $X$ and $Y$) or finite.

You can try to list the elements of $Y$ like $Y: (y_1, y_2, y_3, ...)$. If they correspond bijectively to the naturals, they are countable by definition of having the same cardinality.

Conversely, there exists an element in the naturals, say $k$, that is not hit by an element in $Y$, then $Y$ is finite with a cardinality of $k-1$. For example, say that $k=100$, meaning there is no 100th element in set $Y$, so that means that $Y$ must have 99 elements or have a cardinality of 99.

(b): Simply use the fact that a finite Cartesian product of countable sets is countable. So in this case, you have a Cartesian product of the naturals with the naturals (both of which are countable and it is a finite product because you are multiplying only two terms together). So it is countable.

If that is not sufficiently convincing, recall that the Cartesian of two sets represents the set of all pairs with elements from the two sets: $(a_1, a_2)$ where $a_1 \in A_1, a_2 \in A_2$. Thus, we can enumerate the elements of the Cartesian product of the positive integers as such:

$(0,0), (0,1), (0,2), (0,3), ...$
$(1,0), (1,1), (1,2), (1,3), ...$
$(2,0), (2,1), (2,2), (2,3), ...$
$(3,0), (3,1), (3,2), (3,3), ...$

Then count them by going diagonally and eliminating redundant elements. So we enumerate by: $(0,0), (0,1), (1,0), (0,2), (1,1), (2,0), (0,3), (1,2), (2,1), (3,0), ...$ and then removing redundant elements, we get something like $(0,0), (0,1), (0,2), (1,1), (0,3), (1,2), ...$. Obviously if we can do this type of counting, the set is countable, lol

(c) To show that the positive rationals are countable, it suffices to construct an injective function $f: Q \rightarrow N$. Let us define $f$ as:
$f(q) = 2^a 3^b$ where $q \in Q = a/b$
This function is injective, as whenever $f(q_1) = f(q_2)$ it must be the case that $q_1 = q_2$. So by virtue of an injective function, we argue that $card(Q) \leq card(N)$. But it is clear that the naturals are a subset of the positive rationals, so $card(N) \leq card(Q)$. Then from these two facts, we have $card(N) = card(Q)$, so the positive rationals must be countable.

(d) Google for "Cantor's Diagonalization Argument" or "Power set of the naturals" and you will find your answer. This is one of the most fundamental facts in set theory on countability and uncountability, so there will be a lot of available material on this =)

3. For (d), assume there exists $\phi$ a surjection from $\mathbb{N}$ to $\mathcal{P}(\mathbb{N})$ (the set of all subsets of $\mathbb{N}$).

What about $A=\{x\in \mathbb{N};\ x\notin \phi(x)\}\in \mathcal{P}(\mathbb{N})$ ?

First, if $A$ is empty, that means $\forall n\in \mathbb{N},\ \phi(n)=\{n\}$, and then $\phi^{-1}(\{1,2\})\notin \{1,2\}$ so $\phi^{-1}(\{1,2\})\in A$.
Conclusion: $A\neq \emptyset$.

Let $a$ be a positive integer such that $\phi(a)=A$.

$a\in A \Rightarrow a\notin \phi(a) \Rightarrow a\notin A$ (Contradiction)

$a\notin A \Rightarrow a\in \phi(a) \Rightarrow a\in A$ (Contradiction)

Conclusion: There is no such $\phi$. Therefore, no bijection between $\mathbb{N}$ and $\mathcal{P}(\mathbb{N})$: $\mathcal{P}(\mathbb{N})$ is uncountable.

That's a particular case of:

CANTOR'S THEOREM: Let $X$ be a set, and $\lambda$ its cardinality. Then $\lambda < 2^{\lambda}$

( $2^{\lambda}$ is the cardinality of $\mathcal{P}(X)$)

4. I forgot to mention that for part (c), you can simply proceed as you did in part (b). That is, for part (c), You can simply state that the positive rationals $q = a/b$ where $a,b \in Z^+$ are a subset of the Cartesian product of the naturals with themselves $Z^+ \times Z^+ = \{(a,b): a,b \in Z^+\}$. And since you proved in part (b) that such a product is countable, then the positive rationals should be too.

The positive rationals do differ from that product because the rationals must not contain zero in the denominator (as in, $b \neq 0$) and the greatest common divisor between the numerator (as in, $a,b$ must not have any common factor except for 1). So be sure to mention this in you proof. But this is without loss of generality; it does not change the result that the positive rationals are countable because it's still a Cartesian product of two countable sets.

So $QED$

5. Thank you both very much! Your replies were very detailed and helpful. I shall post here again if I have any more queries concerning countability.

6. I'm not sure with the following things:

(a) Given Schroder-Bernstein theorem:

$|A| \leq |B|$ AND $|B| \leq |A| \Rightarrow |A| = |B|$

(where $|A|$ means the cardinality of set A)

By defining two suitable injective mappings and applying this theorem, or otherwise, prove that open interval $(0,1)$ and the set $\mathcal{P}(\mathbb{N})$(the set of all subsets of $\mathbb{N}$) have the same cardinality.

(b) Deduce the open interval $(0,1)$ is uncountable.

(c) Prove that the set of polynomials of degree n with integer coefficients

$\{ a_0 +a_1x +a_2x^2 +...+ a_nx^n : a_i \in \mathbb{Z}\}$

is countable. Deduce that the set of all polynomials with integer coefficients is countable.

----------------------------------------------
I think for (a) that one of the injections should involve inverse tan but im not sure. I'm not sure about the rest. Can you help with these? Thanks everyone for help.

7. Originally Posted by Jason Bourne
I'm not sure with the following things:

(a) Given Schroder-Bernstein theorem:

$|A| \leq |B|$ AND $|B| \leq |A| \Rightarrow |A| = |B|$

(where $|A|$ means the cardinality of set A)

By defining two suitable injective mappings and applying this theorem, or otherwise, prove that open interval $(0,1)$ and the set $\mathcal{P}(\mathbb{N})$(the set of all subsets of $\mathbb{N}$) have the same cardinality.

(b) Deduce the open interval $(0,1)$ is uncountable.

(c) Prove that the set of polynomials of degree n with integer coefficients

$\{ a_0 +a_1x +a_2x^2 +...+ a_nx^n : a_i \in \mathbb{Z}\}$

is countable. Deduce that the set of all polynomials with integer coefficients is countable.

----------------------------------------------
I think for (a) that one of the injections should involve inverse tan but im not sure. I'm not sure about the rest. Can you help with these? Thanks everyone for help.
You know, they should have totally included the fact that Jason Bourne studies infinite cardinality set theory in The Bourne Ultimatum

(a) I can explain the premise behind constructing such a bijection - it is up to you to actually write it up, of course.

First, a little background on power sets. For any set $S$ with a cardinality of $card(S)$, its power set $2^S$ has the same cardinality as
$\{0,1\}^{card(S)}$
The 0's and 1's are indicator functions telling you whether or not an element of $S$ in a particular subset or not.

For example, consider the set $S=\{x,y,z\}$, which a cardinality of 3 and a power set $2^S$ which is
$\{$empty set $\}, \{x\}, \{y\}, \{z\}, \{x,y\}, \{y,z\}, \{x,z\}, \{x,y,z\}$

Then, $\{0,1\}^{card(S)}=\{0,1\}^3$
$= \{0,0,0\}, \{1,0,0\}, \{0,1,0\}, \{0,0,1\}, \{1,1,0\}, \{0,1,1\}, \{1,0,1\}, \{1,1,1\}$

Do you see how the set $\{$empty set $\}$ corresponds to $\{0,0,0\}$, $\{1,0,0\}$ to $\{x\}$, so forth?

Extending this principle to infinite sets is possible, so we conclude that $2^N$ has the same cardinality as $\{0,1\} \times \{0,1\} \times ...$ (multiplied together countable times). But what is this set? This set is all the possible countably sequences of 0's and 1's that exist out there.

Note that if you convert any given real number into binary, you get the same thing: sequences of 0's and 1's. So that's your bijection.

(b) So if you have done part (a), part (b) follows immediately. If you show a bijection of one set to an uncountable set, then the first set must also be uncountable, of course.

(c) Approach this proof inductively. Consider the set of all polynomials with degree 1 (as opposed to degree $n$). That is, consider the set $\{ a_0: a_0 \in \mathbb{Z}\}$, which is just simply the set of all integers, which is clearly countable.

Now do it again for all polynomials with degree 2. So the set $\{ a_0 +a_1x: a_0, a_1 \in \mathbb{Z}\}$, which is the Cartesian product of the integers with itself: recall that $Z \times Z = \{(a_0,a_1): a_0,a_1 \in Z\}$ is countable from your previous problems. So this too is countable.

Then keep doing this until your balls drop off. Or you can just simply say that the set of all polynomials with integer coefficients is the union of the first set that I have described, with the second one, and so forth. That would be $\{a_0: a_0 \in Z\} \cup \{(a_0,a_1): a_0,a_1 \in Z\} \cup ...$, which is a countable union of countable sets. And we know that is countable, of course - $QED$

8. You know, they should have totally included the fact that Jason Bourne studies infinite cardinality set theory in The Bourne Ultimatum
LOL!!!!!!!!!!!!!!!!! I agree!

(a) I can explain the premise behind constructing such a bijection - it is up to you to actually write it up, of course.

First, a little background on power sets. For any set $S$ with a cardinality of $card(S)$, its power set $2^S$ has the same cardinality as
$\{0,1\}^{card(S)}$
The 0's and 1's are indicator functions telling you whether or not an element of $S$ in a particular subset or not.

For example, consider the set $S=\{x,y,z\}$, which a cardinality of 3 and a power set $2^S$ which is
$\{$empty set $\}, \{x\}, \{y\}, \{z\}, \{x,y\}, \{y,z\}, \{x,z\}, \{x,y,z\}$

Then, $\{0,1\}^{card(S)}=\{0,1\}^3$
$= \{0,0,0\}, \{1,0,0\}, \{0,1,0\}, \{0,0,1\}, \{1,1,0\}, \{0,1,1\}, \{1,0,1\}, \{1,1,1\}$

Do you see how the set $\{$empty set $\}$ corresponds to $\{0,0,0\}$, $\{1,0,0\}$ to $\{x\}$, so forth?

Extending this principle to infinite sets is possible, so we conclude that $2^N$ has the same cardinality as $\{0,1\} \times \{0,1\} \times ...$ (multiplied together countable times). But what is this set? This set is all the possible countably sequences of 0's and 1's that exist out there.

Note that if you convert any given real number into binary, you get the same thing: sequences of 0's and 1's. So that's your bijection.
I wish you were my lecturer, that was quite helpful. Thanks to people like you who take their time to reply to me that I stand a better chance at understanding these things.

So, all I have to do is show that there is a mapping between (0,1) and $\mathcal{P}(\mathbb{N})$ and that this mapping is bijective?

9. Yes, you do this as follows:

1. Construct a function, say $b: (0,1) \rightarrow \{0,1\}$ which is a binary convert that maps any real number in the interval (0,1) into a countably long string of 0's and 1's.

For example, consider the real number 1/2, which is clearly within the open interval (0,1). Its binary expansion is: 0.100... because 1(1/2) + 0(1/4) + 0(1/8) + 0(1/16) + ... = 1/2. Another example: 3/4 or 0.75, when mapped into binary, becomes 0.11000... because 3/4 = 1(1/2) + 1(1/4) + 0(1/8) + 0(1/16) + ...

So now you have a string of 0's and 1's representing any real number within (0,1). You do this for every real number in (0,1), sending every base-10 real number into a base-2 (aka binary) system where they are each written as a countably long string of 0's and 1's.

2. Show that the set of all real numbers written in binary format is equivalent to: {0,1}x{0,1}x{0,1}x... (kind of obvious, right?)

3. Show that {0,1}x{0,1}x{0,1}x... has the same cardinality as $2^N$.

So that basically says that the reals are equivalent to {0,1}x{0,1}x{0,1}x..., which have the same cardinality as the power set of the naturals. So then you're done.