1 00:00:00,854 --> 00:00:01,710 PROFESSOR: OK. 2 00:00:01,710 --> 00:00:04,760 So we come to the idea of countable sets, which 3 00:00:04,760 --> 00:00:07,130 are the most familiar kind of infinite sets. 4 00:00:07,130 --> 00:00:12,130 And a countable set is one where you can list the elements-- a0, 5 00:00:12,130 --> 00:00:13,910 a1, a2 and so on. 6 00:00:13,910 --> 00:00:17,430 So there's a list of all of the elements of A 7 00:00:17,430 --> 00:00:20,920 in which every element in A appears at some point. 8 00:00:20,920 --> 00:00:23,835 You can count up to any given element of A, 9 00:00:23,835 --> 00:00:26,900 and every element of A you will eventually get to, 10 00:00:26,900 --> 00:00:28,590 you'll be able to count up to it. 11 00:00:28,590 --> 00:00:31,470 So it's just a matter of listing it. 12 00:00:31,470 --> 00:00:33,980 And the technical definition of "A is countable" 13 00:00:33,980 --> 00:00:36,650 is if there's a bijection between A 14 00:00:36,650 --> 00:00:37,910 and the non-negative integers. 15 00:00:37,910 --> 00:00:40,100 Because this listing, in effect, really 16 00:00:40,100 --> 00:00:44,490 is a mapping from the non-negative integers to A. 0 17 00:00:44,490 --> 00:00:48,600 is a0, 1 maps to a1, 2 maps to a2, 18 00:00:48,600 --> 00:00:51,830 and implicitly there's a bijection being indicated here. 19 00:00:51,830 --> 00:00:55,060 That's assuming that all of the [? a's ?] are distinct for it 20 00:00:55,060 --> 00:00:56,310 to be a bijection. 21 00:00:56,310 --> 00:00:58,420 So we also have, as a special case, 22 00:00:58,420 --> 00:01:01,000 the finite sets are also considered to be countable. 23 00:01:01,000 --> 00:01:04,365 So really, if n is a bijection to A, 24 00:01:04,365 --> 00:01:06,550 then A is called countably infinite. 25 00:01:06,550 --> 00:01:08,730 The other possibility is that A is finite. 26 00:01:08,730 --> 00:01:12,959 And the two together, I just say A is countable. 27 00:01:12,959 --> 00:01:14,500 So what we've just figured out, then, 28 00:01:14,500 --> 00:01:18,010 from the previous examples, is that the positive integers 29 00:01:18,010 --> 00:01:19,040 are countable. 30 00:01:19,040 --> 00:01:20,650 And all the integers are countable, 31 00:01:20,650 --> 00:01:23,527 because in both cases we exhibited bijections 32 00:01:23,527 --> 00:01:24,735 to the non-negative integers. 33 00:01:27,850 --> 00:01:30,140 Another important and not very hard 34 00:01:30,140 --> 00:01:32,580 example is the set of finite binary words. 35 00:01:32,580 --> 00:01:35,520 So we use this notation, "0, 1 star," meaning 36 00:01:35,520 --> 00:01:38,190 all the finite-- star means all the finite sequences 37 00:01:38,190 --> 00:01:39,940 of these elements, 0 and 1. 38 00:01:39,940 --> 00:01:42,910 So this is just the finite binary words. 39 00:01:42,910 --> 00:01:43,870 How are they countable? 40 00:01:43,870 --> 00:01:46,890 Well, I need a way to be able to list them in some orderly way. 41 00:01:46,890 --> 00:01:48,750 Well, let's just do it by length. 42 00:01:48,750 --> 00:01:51,770 Let's begin by listing the empty word, or string, 43 00:01:51,770 --> 00:01:52,840 of length zero. 44 00:01:52,840 --> 00:01:55,930 And then I'm going to list all the one-bit strings, 45 00:01:55,930 --> 00:01:58,162 the strings of length one. 46 00:01:58,162 --> 00:01:59,310 And there are two of those. 47 00:01:59,310 --> 00:02:03,252 So let the second element, the next element of the list 48 00:02:03,252 --> 00:02:05,710 after the empty string, be 0, and then let the next element 49 00:02:05,710 --> 00:02:07,150 after that be 1. 50 00:02:07,150 --> 00:02:09,130 Then let's list all the length two strings. 51 00:02:09,130 --> 00:02:12,090 Well, there's four length two binary strings. 52 00:02:12,090 --> 00:02:15,290 And let's just list them in some sensible order-- 53 00:02:15,290 --> 00:02:17,420 say, by their binary representation. 54 00:02:17,420 --> 00:02:20,410 And then keep going. 55 00:02:20,410 --> 00:02:23,560 List all the length three binary strings-- 56 00:02:23,560 --> 00:02:24,560 there's eight of those. 57 00:02:24,560 --> 00:02:28,850 And finally, keep going up until you get to the length n 58 00:02:28,850 --> 00:02:31,190 binary strings, of which there are 2 to the n. 59 00:02:31,190 --> 00:02:35,120 And this is a description of a way to list, one after another, 60 00:02:35,120 --> 00:02:39,080 all of the finite binary words, or finite binary strings. 61 00:02:39,080 --> 00:02:42,710 And that listing is implicitly a description 62 00:02:42,710 --> 00:02:46,320 of a bijection from the non-negative integers 63 00:02:46,320 --> 00:02:49,830 n to the nth element in my listing. 64 00:02:49,830 --> 00:02:53,620 And that's a bijection, so the binary words are countable. 65 00:02:57,515 --> 00:02:59,370 Another example of a countable set 66 00:02:59,370 --> 00:03:03,150 is the pairs of non-negative integers. 67 00:03:03,150 --> 00:03:05,420 So how can-- now I've got the non-negative integers. 68 00:03:05,420 --> 00:03:08,477 I've got to find a bijection of pairs of non-negative integers. 69 00:03:08,477 --> 00:03:09,560 How am I going to do that? 70 00:03:09,560 --> 00:03:12,440 Well, it's the same idea as we used with binary strings. 71 00:03:12,440 --> 00:03:13,940 There's a bunch of ways to prove it, 72 00:03:13,940 --> 00:03:17,650 but let's just propagate the binary string idea. 73 00:03:17,650 --> 00:03:22,850 Let's start listing the pairs of non-negative integers. 74 00:03:22,850 --> 00:03:28,380 And after 0, 0, I'm going to list two pairs-- 0, 1 and 1, 0. 75 00:03:28,380 --> 00:03:32,306 And after them, I'm going to list three pairs-- 0, 2, 2, 0, 76 00:03:32,306 --> 00:03:33,870 and 1, 1. 77 00:03:33,870 --> 00:03:37,050 And after them, 0, 3, 3, 0, 1, 2, 2, 1. 78 00:03:37,050 --> 00:03:38,690 And if you can see what I'm doing, 79 00:03:38,690 --> 00:03:43,790 I'm basically listing the pairs in the order of the sum 80 00:03:43,790 --> 00:03:44,940 of their coordinates. 81 00:03:44,940 --> 00:03:49,060 So the nth block of pairs that I'm going to list 82 00:03:49,060 --> 00:03:54,680 will be the pairs the sum of whose two coordinates is n. 83 00:03:54,680 --> 00:03:56,210 There'll be n plus one of those. 84 00:03:56,210 --> 00:03:57,460 And I keep going in this way. 85 00:03:57,460 --> 00:04:00,120 This is a nice orderly description of-- 86 00:04:00,120 --> 00:04:01,780 or a description of a nice orderly way 87 00:04:01,780 --> 00:04:04,580 to list all of the pairs of non-negative integers. 88 00:04:04,580 --> 00:04:07,720 Within a block, invent some alphabetical rule 89 00:04:07,720 --> 00:04:10,210 for listing the pairs. 90 00:04:10,210 --> 00:04:14,060 So I'm going to-- I've hinted at a rule 91 00:04:14,060 --> 00:04:17,375 here for listing the finite set of pairs whose sum is n, 92 00:04:17,375 --> 00:04:19,940 and you can invent-- any one will do. 93 00:04:19,940 --> 00:04:23,390 So that tells us that we have a bijection 94 00:04:23,390 --> 00:04:26,500 between the non-negative integers 95 00:04:26,500 --> 00:04:29,180 and the pairs of non-negative integers. 96 00:04:29,180 --> 00:04:32,420 So that's another important bijection. 97 00:04:32,420 --> 00:04:34,420 Now, when you're trying to prove countability, 98 00:04:34,420 --> 00:04:36,640 it's very useful to have the following lemma, which 99 00:04:36,640 --> 00:04:38,181 gives an alternative characterization 100 00:04:38,181 --> 00:04:41,750 of countability-- namely, a set A is countable if 101 00:04:41,750 --> 00:04:45,520 and only if you can list A allowing repeats. 102 00:04:45,520 --> 00:04:47,050 Remember, our original definition 103 00:04:47,050 --> 00:04:50,930 is that you can list A without repeats if it's infinite, 104 00:04:50,930 --> 00:04:52,290 or else it's finite. 105 00:04:52,290 --> 00:04:55,340 So that was-- the bijection between the non-negative 106 00:04:55,340 --> 00:04:57,060 integers and A, in effect, is saying 107 00:04:57,060 --> 00:04:59,510 that that's a listing of all of an infinite set A 108 00:04:59,510 --> 00:05:04,440 with no repeats, because it's a bijection we're mapping. 109 00:05:04,440 --> 00:05:05,880 If an element appeared twice, we'd 110 00:05:05,880 --> 00:05:07,627 have two different non-negative integers 111 00:05:07,627 --> 00:05:09,960 mapping to it, which would break the bijection property, 112 00:05:09,960 --> 00:05:11,930 the injection property. 113 00:05:11,930 --> 00:05:14,370 And so suppose we allow repeats. 114 00:05:14,370 --> 00:05:18,020 And the claim is that that's fine, because you can fix that. 115 00:05:18,020 --> 00:05:20,810 So the lemma says that, if there's 116 00:05:20,810 --> 00:05:24,770 a surjective function from the non-negative integers to A, 117 00:05:24,770 --> 00:05:26,480 then A is countable. 118 00:05:26,480 --> 00:05:29,180 Well, let's just check quickly in one direction. 119 00:05:29,180 --> 00:05:33,470 If A is finite, then there's clearly a surjective function 120 00:05:33,470 --> 00:05:36,270 from the non-negative integers to A. 121 00:05:36,270 --> 00:05:38,390 There's lots of extra non-negative integers 122 00:05:38,390 --> 00:05:39,720 you don't need. 123 00:05:39,720 --> 00:05:42,450 If it's a finite set, like 10 elements in A, 124 00:05:42,450 --> 00:05:44,500 map 0 through 9 to those 10 elements, 125 00:05:44,500 --> 00:05:47,530 and map every other non-negative integer, say, 126 00:05:47,530 --> 00:05:52,650 to 10th element, or last element, of A. 127 00:05:52,650 --> 00:05:55,270 So there's certainly a surjection if A is finite. 128 00:05:55,270 --> 00:05:58,250 Now, suppose that A is infinite, and I have a surjection 129 00:05:58,250 --> 00:06:00,600 from the non-negative integers to A. 130 00:06:00,600 --> 00:06:03,272 So I'm listing A with repeats. 131 00:06:03,272 --> 00:06:05,530 And I'm supposed to have a bijection if it 132 00:06:05,530 --> 00:06:06,789 matches the other definition. 133 00:06:06,789 --> 00:06:07,580 How do you do that? 134 00:06:07,580 --> 00:06:09,550 Well, if you're a computer scientist, 135 00:06:09,550 --> 00:06:12,310 you know how to change a sequence with repeats 136 00:06:12,310 --> 00:06:13,980 into a sequence without repeats. 137 00:06:13,980 --> 00:06:15,780 You just filter it for duplicates, 138 00:06:15,780 --> 00:06:17,370 going from left to right. 139 00:06:17,370 --> 00:06:20,030 Take this infinite sequence of elements of A 140 00:06:20,030 --> 00:06:23,100 in which there are repeats, and keep only the first occurrence 141 00:06:23,100 --> 00:06:23,920 of each element. 142 00:06:23,920 --> 00:06:26,880 That will define a bijection with the non-negative integers 143 00:06:26,880 --> 00:06:29,320 if a is infinite. 144 00:06:29,320 --> 00:06:32,750 And that's how we prove this lemma, which I'm just going 145 00:06:32,750 --> 00:06:34,460 to settle for talking through. 146 00:06:34,460 --> 00:06:36,420 So now we have another convenient way 147 00:06:36,420 --> 00:06:39,590 to show that a set is countable, just by describing, 148 00:06:39,590 --> 00:06:41,690 not a bijection, but a surjection 149 00:06:41,690 --> 00:06:44,260 between the non-negative integers in A. Surjections 150 00:06:44,260 --> 00:06:47,140 are often easier to describe than bijections, which 151 00:06:47,140 --> 00:06:48,960 is why this is a useful lemma. 152 00:06:48,960 --> 00:06:53,230 A corollary of this is that, if I'm 153 00:06:53,230 --> 00:06:55,280 trying to show that a set A is countable, 154 00:06:55,280 --> 00:06:58,190 all that I really need to do is find some other set 155 00:06:58,190 --> 00:06:59,860 that I know to be countable and describe 156 00:06:59,860 --> 00:07:03,150 a surjection from that other set C to A. 157 00:07:03,150 --> 00:07:07,602 Because I know that if C is countable, 158 00:07:07,602 --> 00:07:09,810 then there'll be a bijection between the non-negative 159 00:07:09,810 --> 00:07:13,520 integers and C. And since when you combine 160 00:07:13,520 --> 00:07:16,700 a bijection with a surjection, you wind up with a surjection, 161 00:07:16,700 --> 00:07:19,520 that will implicitly define a surjection 162 00:07:19,520 --> 00:07:23,890 from the non-negative integers to A, which by the lemma 163 00:07:23,890 --> 00:07:25,450 tells me that A is countable. 164 00:07:25,450 --> 00:07:27,080 So the general way to prove something 165 00:07:27,080 --> 00:07:28,960 is countable is just describe a surjection, 166 00:07:28,960 --> 00:07:30,770 from something you know to be countable, 167 00:07:30,770 --> 00:07:33,350 that hits your target. 168 00:07:33,350 --> 00:07:36,160 And let's look at an example of that. 169 00:07:36,160 --> 00:07:38,030 I claim that the rationals are countable, 170 00:07:38,030 --> 00:07:39,488 the rational numbers are countable. 171 00:07:39,488 --> 00:07:43,620 Well, this is kind of a little bit more striking at first, 172 00:07:43,620 --> 00:07:45,840 because you can see how you can count 173 00:07:45,840 --> 00:07:49,590 the non-negative integers, the positive integers, all 174 00:07:49,590 --> 00:07:51,660 the integers, because there's a nice sensible way 175 00:07:51,660 --> 00:07:52,940 to have one come after other. 176 00:07:52,940 --> 00:07:55,020 But with the rationals, it's messy. 177 00:07:55,020 --> 00:07:58,110 In between any two rationals, there's another rational. 178 00:07:58,110 --> 00:07:59,540 There isn't any first rational. 179 00:07:59,540 --> 00:08:02,350 There isn't any obvious way to list them all. 180 00:08:02,350 --> 00:08:06,170 But really, if you stop thinking about the rationals of how they 181 00:08:06,170 --> 00:08:10,900 are laid out on the real line, but just think of them as pairs 182 00:08:10,900 --> 00:08:14,200 of integers, then it becomes clear how to list them, 183 00:08:14,200 --> 00:08:17,880 because we already know that the pairs of non-negative integers 184 00:08:17,880 --> 00:08:18,680 are countable. 185 00:08:18,680 --> 00:08:21,680 So I'm just going to map a pair of non-negative integers m, n 186 00:08:21,680 --> 00:08:24,860 to the rational number m divided by n. 187 00:08:24,860 --> 00:08:27,610 Well, n might be zero, so if n is zero, 188 00:08:27,610 --> 00:08:31,220 just map all of those pairs to your favorite rational number. 189 00:08:31,220 --> 00:08:33,049 Call it a half. 190 00:08:33,049 --> 00:08:38,200 And that gives us a nice surjective mapping, 191 00:08:38,200 --> 00:08:39,630 because every rational number can 192 00:08:39,630 --> 00:08:41,546 be expressed as m over n-- at least 193 00:08:41,546 --> 00:08:43,130 every non-negative rational number. 194 00:08:43,130 --> 00:08:45,970 So in effect, what we have is a surjection 195 00:08:45,970 --> 00:08:47,990 from the pairs of non-negative integers, which 196 00:08:47,990 --> 00:08:52,340 we know is countable, onto the non-negative real numbers-- 197 00:08:52,340 --> 00:08:55,830 sorry, the non-negative rational numbers, quotients of integers. 198 00:08:55,830 --> 00:08:57,850 Which means that the rationals, sure enough, 199 00:08:57,850 --> 00:09:01,170 are countable, even though they seem to be 200 00:09:01,170 --> 00:09:04,180 spread out all over the line. 201 00:09:04,180 --> 00:09:08,410 So, again, we saw that if N cross N is countable, 202 00:09:08,410 --> 00:09:10,200 and there's a surj, described above, 203 00:09:10,200 --> 00:09:13,810 to the non non-negative rationals, 204 00:09:13,810 --> 00:09:15,580 so they're countable. 205 00:09:15,580 --> 00:09:18,580 Well, just looking ahead a little bit, 206 00:09:18,580 --> 00:09:20,360 it's going to turn out that, in contrast 207 00:09:20,360 --> 00:09:24,500 to the rational numbers, the real numbers are not countable. 208 00:09:24,500 --> 00:09:27,230 And in fact, neither are the infinite binary 209 00:09:27,230 --> 00:09:30,760 sequences that we saw-- there was 210 00:09:30,760 --> 00:09:33,900 a bijection between the infinite binary sequences 211 00:09:33,900 --> 00:09:36,716 and the power set of the non-negative integers. 212 00:09:36,716 --> 00:09:38,090 And both of these are going to be 213 00:09:38,090 --> 00:09:40,670 basic examples of uncountable sets, 214 00:09:40,670 --> 00:09:43,030 so sets that are not countable, which we will be 215 00:09:43,030 --> 00:09:46,260 examining in the next lecture.