Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
SECTION 2.5 Cardinality of Sets
b) We can use the distributive law to rewrite 2::~=1(2k -1) (which we know from part (a) equals n2) in terms of the sum we want, S
=
L~=l k:n n n
Now we solve for S, obtaining S
=
(n2+
n)/2, which is usually expressed as n(n+
1)/2.39. This exercise is like Example 23. From Table 2 we know that 2::~~
1
k=
200 · 201/2=
20100, and 2::~~1
k=
99 · 100/2
=
4950. Therefore the desired sum is 20100 - 4950=
15150.41. If we write down the first few terms of this sum we notice a pattern. It starts (1 + 1+1) + (2 + 2 + 2 + 2 + 2) + (3 + 3 + 3 + 3 + 3 + 3 + 3) + · · ·. There are three l's, then five 2'ss, then seven 3'ss, and so on;
in general there are (i + 1)2 - i2
=
2i + 1 copies of i. So we need to sum i(2i + 1) for an appropriate range of values for i. We must find this range. It gets a little messy at the end if m is such that the sequence stops before a complete range of the last value is present. Let n =L vmJ -
1. Then there are n + 1 blocks, and (n + 1)2 - 1 is where the next-to-last block ends. The sum of those complete blocks is I:~=l i(2i + 1) = I:~=1
2i2 + i=
n(n + 1)(2n + 1)/3 + n(n + 1)/2. The remaining terms in our summation all have the value n + 1 and the number of them present is m - ((n + 1)2 - 1). Our final answer is therefore n(n + 1)(2n+
1)/3 + n(n+
1)/2 + (n + l)(m - (n + 1)2+
1).43. a) 0 (anything times 0 is 0) b) 5 . 6 . 7 . 8
=
1680c)
Each factor is either 1 or -1, so the product is either 1 or -1. To see which it is, we need to determine how many of the factors are -1. Clearly there are 50 such factors, namely when i=
1, 3, 5, ... , 99. Since ( -1 )50=
1, the product is 1.d) 2 . 2 ... 2
=
210=
102445. O! + 1! + 2! + 3! + 4!
=
1 + 1 + 1 · 2 + 1 · 2 · 3 + 1 · 2 · 3 · 4=
1 + 1 + 2 + 6 + 24=
34SECTION 2.5 Cardinality of Sets
Don't feel bad if you find this section confusing. When Cantor started talking about sizes of infinity in the nineteenth century, many mathematicians thought he made no sense. The basic rule to keep in mind is that if an infinite set can be given in a list, then it is countable. It is not always easy to find the right list. Various indirect means are also available for showing that an infinite set is countable, such as showing that the set is a subset of a countable set, or showing that it is the union of a countable collection of countable sets. Proving sets uncountable usually requires some sort of diagonal argument, although in fact Cantor's first proof of the uncountability of the real numbers used a different approach (a nice summary can be found in an article in the American Mathematical Monthly, 117:7 (2010), 633~637).
76 Chapter 2 Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
1. a) The negative integers are countably infinite. Each negative integer can be paired with its absolute value to give the desired one-to-one correspondence: 1 +--> -1, 2 +--> -2, 3 +--> -3, and so on.
b) The even integers are countably infinite. We can list the set of even integers in the order 0, 2, -2, 4, -4, 6, -6, .... and pair them with the positive integers listed in their natural order. Thus 1 +--> 0, 2 +--> 2, 3 +--> -2,
4 +--> 4, and so on. There is no need to give a formula for this correspondence-the discussion given is quite
sufficient; but it is not hard to see that we are pairing the positive integer n with the even integer f(n), where f(n)
=
n if n is even and f(n)=
1 - n if n is odd.c) This set is again countably infinite. We can list its elements in the order 99, 98, 97, .... A formula for a correspondence with the set of positive integers is given by
f (
n) = 100 - n. For example, the positive integer 117 is paired with -17.d) The proof that the set of real numbers between 0 and 1 is not countable (Example 5) can easily be modified to show that the set of real numbers between 0 and 1/2 is not countable. We need to let the digit d, be something like 2 if d,,
"I
2 and 3 otherwise. The number thus constructed will be a real number between 0 and 1/2 that is not in the list.e) This set is finite; it has cardinality 999,999.999.
f)
This set is countably infinite, exactly as in part (b); the only difference is that there we are looking at the multiples of 2 and here we are looking at the multiples of 7. The correspondence is given by pairing the positive integer n with 7n/2 if n is even and -7(n - 1)/2 if n is odd: 0, 7, -7, 14, -14, 21, -21, ....3. a) The bit strings not containing 0 are just the bit strings consisting of all l's, so this set is {.\ 1, 11, 111, 1111, ... } , where ,\ denotes the empty string (the string of length 0). Thus this set is countably infinite, where the correspondence matches the positive integer n with the string of n - 1 l's.
b) This is a subset of the set of rational numbers, so it is countable (see Exercise 16). To find a correspondence, we can just follow the path in Example 4, but omit fractions in the top three rows (as well as continuing to omit those fractions that are duplicates of rational numbers already encountered).
c) This set is uncountable, as can be shown by applying the diagonal argument of Example 5.
d) This set is uncountable, as can be shown by applying the diagonal argument of Example 5.
5. Suppose m new guests arrive at the fully occupied hotel. If we move the guest in Room 1 to Room m
+
1, the guest in Room 2 to Room m+
2, and so on, then rooms with numbers from 1 to m become vacant. The new guests can then occupy these rooms.7. We can use the guests in the even-numbered rooms to occupy the original rooms, and the guests in the odd-numbered rooms to occupy the rooms in the second building. Specifically, for each positive integer n, put the guest currently in Room 2n into Room n, and the guest currently in Room 2n - 1 into Room n of the new building.
9. There is more than one way to do this. Here is one method. First spread out the original guests so that the gaps between occupied rooms get larger and larger. Specifically, keep the first guest (i.e., the one currently in Room 1) in Room 1; leave Room 2 vacant; put the second guest (the one currently in Room 2) into Room 3;
leave Rooms 4 and 5 vacant; put the third guest into Room 6; leave Rooms 7, 8, and 9 vacant, and so on.
Have the guests from the first bus fill the first free room in each gap (Rooms 2, 4, 7, 11, and so on). After this is done, once again the gaps between occupied rooms get larger and larger. (The unoccupied rooms are now 5. 8, 9, 12. 13. 14, and so on.) So we can repeat the process with the second busload. We continue in this manner for the countable infinity of busloads. An alternative approach is given in the answer key.
11. In each case, we can make the intersection what we want it to be, and then put additional elements into A and into B (with no overlap) to make them uncountable.
Section 2.5 Cardinality of Sets 77
a) The simplest solution would be to make An B = 0. So, for example, take A to be the interval (1, 2) of real numbers, and take B to be the interval (3, 4).
b) Take the example from part (a) and adjoin the positive integers. Thus, let A = (1, 2) U
z+
and let B = (3, 4) Uz+.
c) Let A= (1,3) and B
=
(2,4).13. Suppose that A is countable. This means either that A is finite or that there exists a one-to-one correspondence
f
from A toz+.
In the former case, there is a one-to-one function g from A to a subset ofz+
(the range of g is the first n positive integers, whereIAI =
n ). In either case, we have met the requirements of Definition 2, soIAI ::::;
jz+j. Conversely, suppose thatIAI ::::;
jz+j. By definition, this means that there is a one-to-one function g from A toz+,
so A has the same cardinality as a subset ofz+
(namely, the range of g ). Now by Exercise 16 we conclude that A is countable.15. This is just the contrapositive of Exercise 16 and so follows directly from it. In more detail, suppose that B were countable, say with elements b1 , b2 , .... Then since As:;; B, we can list the elements of A using the order in which they appear in this listing of B . Therefore A is countable, contradicting the hypothesis. Thus B is not countable.
17. Yes. We need to look at this from the other direction, by noting that A= (An B) U (A - B). We are given that B is countable, so its subset An B is also countable (Exercise 16). If A - B were also countable, then, since the union of two countable sets is countable (Theorem 1), we would conclude that A is countable. But we are given that A is not countable. Therefore our assumption that A - B is countable is wrong, and we conclude that A - B is uncountable. (This is an example of a proof by contradiction.)
19. By what we are given, we know that there are bijections
f
from A to B and g from C to D. Then we can define a bijection from Ax C to Bx D by sending (a,c) to (f(a),g(c)). This is clearly one-to-one and onto, so we have shown that A x C and B x D have the same cardinality.21. The definition of
IAI ::::; IBI
is that there is a one-to-one functionf :
A _,B.
Similarly, we are given a one-to-one function g : B _, C. By Exercise 33 in Section 2.3, the composition gof :
A_, C is one-to-one.Therefore by definition
IAI ::::; ICI.
23. This proof implicitly uses an assumption called the Axiom of Choice. Define a sequence a1 , a2 , a3 , . . . of elements of A as follows. First, a 1 is any element of A. Once we have selected a 1, a 2 , a3 , . . . , ak, let ak+l be any element of A - { a 1, a2, ... , ak}. Such an element must exist because A is infinite. The resulting set { a 1, a2, a3 , ... } is the desired countably infinite subset of A.
25. The set of finite strings of characters over a finite alphabet is countably infinite, because we can list these strings in alphabetical order by length. For example, if the alphabet is {a, b, c}, then our list is ,\, a, b, c, aa , ab, ac, ba, bb, be, ca, cb, cc, aaa, aab, . . . . (See also Exercise 29.) Therefore the infinite set S can be identified with an infinite subset of this countable set, which by Exercise 16 is also countably infinite.
27. Since empty sets do not contribute any elements to unions, we can assume that none of the sets in our given countable collection of countable sets is the empty set. If there are no sets in the collection, then the union is empty and therefore countable. Otherwise let the countable sets be A1 , A2 , . . . . (If there are only a finite number k of them, then we can still assume that they form an infinite sequence by taking Ak+l
=
Ak+2 = · · · = A1 . ) Since each set A, is countable and nonempty, we can list its elements in a sequence as a,1 , ai2, ... ; again, if the set is finite we can list its elements and then list a,1 repeatedly to assure an78 Chapter 2 Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
infinite sequence. Now we just need a systematic way to put all the elements a21 into a sequence. We do this by listing first all the elements a21 in which i
+
j = 2 (there is only one such pair, (1, 1) ), then all the elements in which i+
j = 3 (there are only two such pairs, (1, 2) and (2, 1) ), and so on; except that we do not list any element that we have already listed. So, assuming that these elements are distinct, our list starts a11 , a12 , a 21 , a 13, a22 , a 31 , a14, . . . . (If any of these terms duplicates a previous term, then it is simply omitted.) The result of this process will be either an infinite sequence or a finite sequence containing all the elements of the union of the sets A2 • Thus that union is countable.29. There are only a finite number of bit strings of each finite length, so we can list all the bit strings by listing first those of length 0, then those of length 1, etc. The listing might be
>.,
0, 1, 00, 01, 10, 11, 000, 001, .... (Recall that >. denotes the empty string.) Actually this is a special case of Exercise 27: the set of all bit strings is the union of a countable number of countable (actually finite) sets, namely the sets of bit strings of length n for n = 0, 1, 2, ....31. A little experimentation with this function shows the pattern:
f(l, 1)
=
1 f(2, 1)=
3 f(3, 1)=
6 f(4, 1)=
10 f(l, 2)=
2 f(2, 2) = 5 f(3, 2)=
9 f(4, 2)=
14 j(l, 3)=
4 f(2, 3)=
8 f(3, 3)=
13 f(4, 3)=
19 f(l,4)
=7
f(2,4) =
12 f(3,4) =
18 f(4,4) =
25f
(l, 5)=
11f
(2, 5)=
17f
(3, 5)=
24 f(l, 6) = 16f
(2, 6)=
23f
(l, 7)=
22f(5, 1) = 15 f(5, 2) = 20 f(5, 3)
=
26f(6, 1) = 21 f(6, 2)
=
27We see by looking at the diagonals of this table that the function takes on successive values as m+n increases.
When m
+
n=
2, f(m, n)=
1. When m+
n=
3, f(m, n) takes on the values 2 and 3. When m+
n=
4,f (
m, n) takes on the values 4, 5, and 6. And so on. It is clear from the formula that the range of values the function takes on for a fixed value of m+
n, say m+
n = x, is (x-2~(x-l)+
1 through (x-2~(x-l)+
(x - 1), since m can assume the values 1, 2, 3, ... , (x - 1) under these conditions, and the first term in the formula is a fixed positive integer when m+
n is fixed. To show that this function is one-to-one and onto, we merely need to show that the range of values for x+
1 picks up precisely where the range of values for x left off, i.e., that f(x - 1, 1)+
1=
j(l, x). We compute:f(x - 1, 1)
+
1=
(x - 2)2(x - 1)+
(x - 1)+
1=
x2 - ;+
2=
(x~
l)x+
1=
f(l, x)33. It suffices to find one-to-one functions
f :
(0, 1) --+[O,
1] and g :[O,
1] --+ (0, 1). We can obviously use the function f(x) = x in the first case. For the second, we can just compress[O,
1] into, say, [~,~];the increasing linear function g(x) = (x+
1)/3 will do that. It then follows from the Schroder-Bernstein theorem thatl(O, 1)1
=l[O,
l]I.35. We can follow the hint or argue as follows, which really amounts to the same thing. (See the answer key for a proof using bit strings.) Suppose there were such a one-to-one correspondence
f
fromz+
to the power set ofz+
(the set of all subsets ofz+ ).
Thus, for each x Ez+,
f(x) is a subset ofz+.
We will derive a contradiction by showing thatf
is not onto; we do this by finding an element not in its range. To this end, let A = { x I x tJ_ f(x)}. We claim that A is not in the range of f. If it were, then A=
f(x0 ) for some x0 Ez+ .
Let us look at whether x0 E A or not. On the one hand, if x0 E A, then by the definition of A, it must be true that x0 tJ_f (
x0 ), which means that x0 tJ_ A; that is a contradiction. On the other hand, if if x0 tJ_ A, then by the definition of A, it must be true that x0 E f(x0 ), which means that x0 EA, again a contradiction. Therefore no such one-to-one correspondence exists.Section 2.6 Matrices 79
37. We argued in the solution to Exercise 29 that the set of all strings of symbols from the alphabet {O, 1} is countable, since there are only a finite number of bit strings of each length. There was nothing special about the alphabet
{O, 1}
in that argument. For any finite alphabet (for example, the alphabet consisting of all upper and lower case letters, numerals, and punctuation and other mathematical marks typically used in a programming language), there are only a finite number of strings of length 1 (namely the number of symbols in the alphabet), only a finite number of strings of length 2 (namely, the square of this number), and so on. Therefore, using the result of Exercise 27, we conclude that there are only countably many strings from any given finite alphabet. Now the set of all computer programs in a particular language is just a subset of the set of all strings over that alphabet (some strings are meaningless jumbles of symbols that are not valid programs), so by Exercise 16, this set, too, is countable.39. In Exercise 37 we saw that there are only a countable number of computer programs, so there are only a countable number of computable functions. In Exercise 38 we saw that there are an uncountable number of functions. Hence not all functions are computable. Indeed, in some sense, since uncountable sets are so much bigger than countable sets, almost all functions are not computable! This is not really so surprising; in real life we deal with only a small handful of useful functions, and these are computable. Note that this is a nonconstructive proof-we have not exhibited even one noncomputable function, merely argued that they have to exist. Actually finding one is much harder, but it can be done. For example, the following function is not computable. Let T be the function from the set of positive integers to
{O, 1}
defined by letting T(n) be 0 if the number 0 is in the range of the function computed by the nth computer program (where we list them in alphabetical order by length) and letting T(n) = 1 otherwise.SECTION 2.6 Matrices
In addition to routine exercises with matrix calculations, there are several exercises here asking for proofs of various properties of matrix operations. In most cases the proofs follow immediately from the definitions of the matrix operations and properties of operations on the set from which the entries in the matrices are drawn. Also, the important notion of the (multiplicative) inverse of a matrix is examined in Exercises 18~21.
Keep in mind that some matrix operations are performed "entrywise," whereas others operate on whole rows or columns at a time. Exercise 29 foreshadows material in Section 9.4.
1. a) Since A has 3 rows and 4 columns, its size is 3 x 4.
b) The thfrd column of A is the 3 x 1 matdx [
i] ·
c) The second row of A is the 1 x 4 matrix [2 0 4 6] .
d) This is the element in the third row, second column, namely 1.
e) The transpose of A is the 4 x 3 matrix [ :
~ ! ] ·
3 6 7
3. a) We use the definition of matrix multiplication to obtain the four entries in the product AB. The (1, l)th entry is the sum anb11 + ai2b21 = 2 · 0 + 1·1 = 1. Similarly, the (1, 2)th entry is the sum anb12 + a12b22 = 2·4+1·3 = 11; (2, l)th entry is the sum a 21 b11 +a22 b21 =3·0 + 2 · 1 = 2; and (2,2)th entry is the sum a 21 bi2 + a 22 b22 = 3 · 4 + 2 · 3 = 18. Therefore the answer is [;
i~] .
b) The calculation is similar. Again, to get the (i,j)th entry of the product, we need to add up all the products a,kbk1 . You can visualize "lifting" the ith row from the first factor (A) and placing it on top of the
80 Chapter 2 Basic Structures: Sets, Functions, Sequences, Sums, and Matrices has two columns. If we write out what the matrix multiplication means, then we obtain the following system of linear equations:
2a11 + 3a21 = 3 2a12 + 3a22 = 0 la11 + 4a21 = 1 la12 + 4a22 = 2
Solving these equations by elimination of variables (or other means-it's really two systems of two equations each in two unknowns), we obtain a11 = 9/5, a12 = -6/5, a21 = -1/5, a22 = 4/5. As a check we compute
Section 2.6 Matrices
81
the term a,q inside the inner summation, to obtain
E E
aiqbqrcr1 . (We are also implicitly using associativity q=l r=lof multiplication of real numbers here, to avoid putting parentheses in the product aiqbqrCrj . )
k p
A similar analysis with the right-hand side shows that the (i, j)th entry there is equal to
I: (I:
a,qbqr )cr1r=l q=l
82 Chapter 2 Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
25. Using the idea in Exercise 24, we see that the given system can be expressed as AX = B, where A is the coefficient matrix, X is an n x 1 matrix with Xi the entry in its ith row, and B is the n x 1 matrix of right-hand sides. Specifically we have
:::e
~~~
:nd[ t r infrs~ t]-.
1~:::f::
can findx
simply by computing A -1 B.-1 -1 3
But Exercise 18 tells us
We should plug in x1 = 1, x2 = -1, and x3 = -2 to see that these do indeed form the solution.
27. These routine exercises simply require application of the appropriate definitions. Parts (a) and (b) are entry-wise operations, whereas the operation 8 in part (c) is similar to matrix multiplication (the (i,j)th entry of A 8 B depends on the ith row of A and the lh column of B ).
a)
AV B~
[~ ~ i l
29. Note that Al2l means A 8 A, and Al3l means A 8 A 8 A. We just apply the definition.
c) A v A l2l V A l3l =
[ 1~ o~ o~l
31. These are immediate from the commutativity of the corresponding logical operations on variables.
a) AV B = [a,1 V bi1 ] = [bi1 V a,1 ]
=
B VA b) B /\A= [b,1 /\ a,1 ] = [ai1 /\ b,1 ] =A/\ B33. These are immediate from the distributivity of the corresponding logical operations on variables.
a) AV (B /\ C)
=
[ai1 V (b,1 /\ ci1 )]=
[(a,1 V bi1 ) /\ (a,1 V ci1 )] =(AV B) /\(AV C) b) A/\ (B V C)=
[ai1 /\ (bi1 V ci1 )]=
[(ai1 /\ bi1 ) V (ai1 /\ ci1 )] =(A/\ B) V (A/\ C)35. The proof is identical to the proof in Exercise 13, except that real number multiplication is replaced by /\,
p k
and real number addition is replaced by V. Briefly, in symbols, A 8 (B 8 C)
= [ V
aiq /\ (V
bqr /\ Crj)]=
q=l r=l
p k k p k p
[V V
aiqAbqrAcr1 ] =[V V
aiq/\bqr/\cr1 ]= [V (V
a,q/\bqr) /\cr1]=
(A8B)8C.q=l r=l r=l q=l r=l q=l
Review Questions 83