Cardinality1 Sol

2
Math 347 Worksheet: Cardinality—Solutions A.J. Hildebrand Practice Problems: Countable and Uncountable Sets Solutions The following problems are intended to develop a “feel” for countable and uncountable sets. In each case, determine if the set is countable or uncountable and justify your answer. Here are some ways to establish countability or uncountability: Establish a bijection to a known countable or uncountable set, such as N, Q, or R, or a set from an earlier problem. Many of the sets below have natural bijection between themselves; try to uncover these bjections! Establish a bijection to a subset of a known countable set (to prove countability) or a superset of a known uncountable set (to prove uncountability). Build up the set from sets with known cardinality, using unions and cartesian products, and use the above results on countability of unions and cartesian products. 1. The set of all points in the plane with rational coordinates. Solution: COUNTABLE. Proof: The given set is Q × Q. Since Q is countable and the cartesian product of finitely many countable sets is countable, Q × Q is countable. 2. The set of all finite sequences of integers. Solution: COUNTABLE. Proof: The given set can be epressed as a union S k=1 A k , where A k denotes the set of integer sequences of length k. Since a countable union of countable sets is countable, the claim will follow if we can show that, for each k, the set A k is countable. Now A k can be written as A k = {(n1,...,n k ): ni Z} = Z ×···× Z, i.e., a k-fold cartesian product of the countable set Z with itself, and therefore is countable. 3. The set of all “words” (defined as finite strings of letters in the alphabet). Solution: COUNTABLE: Proof: The set of all words can be expressed as a union S k=1 W k , where W k denotes the set of words of length k. Since each W k is finite (more precisely, assuming 26 letters in the alphabet, there are 26 k words of length k), the claim follows from the fact that a countable union of finite or countable sets is countable. 4. The set of all computer programs in a given programming language (defined as a finite sequence of “legal” words and symbols in that language, such as “if”, “for”, “{”, “==”, etc.). Solution: COUNTABLE. Proof: Use the same argument as for words, with the “alphabet” being the (finite) set of all “legal” words or symbols. 5. The set of all finite subsets of N. Solution: COUNTABLE. Proof: Identifying a k-element subset of N with the sequence of its elements in increasing order gives a one-to-one correspondence between the set of all finite subsets of N and a subset of the set of all finite sequences of positive integers (namely those of the form (*)(a1,...,a k ) with a1 < ··· <a k ). Since the set of all finite integer sequences is countable (as shown above), it follows that the set of such sequences of the form (*), and hence the given set, is also countable. 6. The set of all infinite sequences of integers. Solution: UNCOUNTABLE. The set of all infinite integer sequences is a superset of the set of all infinite binary (i.e., 01) sequences, which we have seen is uncountable (see above). 7. The set of all “outcomes” (i.e., head/tail sequences) in an infinite sequence of coin tosses. Solution: UNCOUNTABLE: Proof: The set of all infinite head/tail sequences is in an obvious one-to-one correspondence with the set of all infinite binary sequences, which we know is uncountable. 8. The set of all subsets of N. Solution: UNCOUNTABLE. Proof: Given a subset A N, define a binary sequence (a1,a2,... ) by ai =1 if i A and ai =0 if i 6A. This yields a bijection between the set of all subsets of N and the set of all infinite binary sequences. Since the latter set is uncountable (by the above Lemma), so is the given set. 1

description

Cardinality

Transcript of Cardinality1 Sol

Page 1: Cardinality1 Sol

Math 347 Worksheet: Cardinality—Solutions A.J. Hildebrand

Practice Problems: Countable and Uncountable Sets Solutions

The following problems are intended to develop a “feel” for countable and uncountable sets. In each case, determine if theset is countable or uncountable and justify your answer. Here are some ways to establish countability or uncountability:

• Establish a bijection to a known countable or uncountable set, such as N, Q, or R, or a set from an earlier problem.Many of the sets below have natural bijection between themselves; try to uncover these bjections!

• Establish a bijection to a subset of a known countable set (to prove countability) or a superset of a knownuncountable set (to prove uncountability).

• Build up the set from sets with known cardinality, using unions and cartesian products, and use the above resultson countability of unions and cartesian products.

1. The set of all points in the plane with rational coordinates.

Solution: COUNTABLE. Proof: The given set is Q × Q. Since Q is countable and the cartesian product offinitely many countable sets is countable, Q×Q is countable.

2. The set of all finite sequences of integers.

Solution: COUNTABLE. Proof: The given set can be epressed as a union⋃∞

k=1 Ak, where Ak denotes the setof integer sequences of length k. Since a countable union of countable sets is countable, the claim will follow ifwe can show that, for each k, the set Ak is countable. Now Ak can be written as Ak = {(n1, . . . , nk) : ni ∈ Z} =Z× · · · × Z, i.e., a k-fold cartesian product of the countable set Z with itself, and therefore is countable.

3. The set of all “words” (defined as finite strings of letters in the alphabet).

Solution: COUNTABLE: Proof: The set of all words can be expressed as a union⋃∞

k=1 Wk, where Wk denotesthe set of words of length k. Since each Wk is finite (more precisely, assuming 26 letters in the alphabet, thereare 26k words of length k), the claim follows from the fact that a countable union of finite or countable sets iscountable.

4. The set of all computer programs in a given programming language (defined as a finite sequence of “legal” wordsand symbols in that language, such as “if”, “for”, “{”, “==”, etc.).

Solution: COUNTABLE. Proof: Use the same argument as for words, with the “alphabet” being the (finite)set of all “legal” words or symbols.

5. The set of all finite subsets of N.

Solution: COUNTABLE. Proof: Identifying a k-element subset of N with the sequence of its elements inincreasing order gives a one-to-one correspondence between the set of all finite subsets of N and a subset of theset of all finite sequences of positive integers (namely those of the form (∗) (a1, . . . , ak) with a1 < · · · < ak).Since the set of all finite integer sequences is countable (as shown above), it follows that the set of such sequencesof the form (∗), and hence the given set, is also countable.

6. The set of all infinite sequences of integers.

Solution: UNCOUNTABLE. The set of all infinite integer sequences is a superset of the set of all infinitebinary (i.e., 01) sequences, which we have seen is uncountable (see above).

7. The set of all “outcomes” (i.e., head/tail sequences) in an infinite sequence of coin tosses.

Solution: UNCOUNTABLE: Proof: The set of all infinite head/tail sequences is in an obvious one-to-onecorrespondence with the set of all infinite binary sequences, which we know is uncountable.

8. The set of all subsets of N.

Solution: UNCOUNTABLE. Proof: Given a subset A ⊆ N, define a binary sequence (a1, a2, . . . ) by ai = 1 ifi ∈ A and ai = 0 if i 6∈ A. This yields a bijection between the set of all subsets of N and the set of all infinitebinary sequences. Since the latter set is uncountable (by the above Lemma), so is the given set.

1

Page 2: Cardinality1 Sol

Math 347 Worksheet: Cardinality—Solutions A.J. Hildebrand

9. The set of all functions f : N→ {0, 1}.

Solution: UNCOUNTABLE. Proof: Mapping a function f : N→ {0, 1} to the sequence (a1, a2, . . . ) defined byai = f(i) for each i yields a bijection between functions of the given type and infinite binary sequences. Sincethe latter set is uncountable, so is the given set of all functions f : N→ {0, 1}.

10. The set of all functions f : {0, 1} → N.

Solution: COUNTABLE. Proof. The functions f : {0, 1} → N are in one-to-one correspondence with N × N(map f to the tuple (a1, a2) with a1 = f(1), a2 = f(2)). Since the latter set is countable, as a Cartesian productof countable sets, the given set is countable as well.

11. The set of all real numbers that are roots of polynomials with integer coefficients (i.e., solutions to an equation ofthe form akx

k + · · ·+ a1x+ a0 = 0 with ai ∈ Z). (Such numbers are called algebraic. For example, the goldenratio, (

√5 + 1)/2, is algebraic since it is a root of the polynomial x2 − x− 1; by contrast, a famous result states

that π is not algebraic.)

Solution: COUNTABLE. Proof: Note that a polynomial of the given form is determined uniquely by thesequence of its coefficients (a0, a1, . . . , ak), which is a finite integer sequence. Since the set of finite integersequences is countable (as shown above), the set of polynomials of the given form is also countable. Moreover,since a polynomial has only finitely many roots, only finitely many algebraic numbers are roots of a givenpolynomial. Hence the set of all algebraic numbers can be expressed as a countable union (corresponding to thecountably many polynomials with integer coefficients) of finite sets (corresponding to the roots of a given suchpolynomial).

2