1 00:00:00,500 --> 00:00:02,230 PROFESSOR: There are two generalizations 2 00:00:02,230 --> 00:00:05,980 of the bijection rule and the product rule that 3 00:00:05,980 --> 00:00:09,270 come up all the time and play an essential role 4 00:00:09,270 --> 00:00:11,110 in the repertoire of any counter. 5 00:00:11,110 --> 00:00:12,607 So let's look at those. 6 00:00:12,607 --> 00:00:14,190 The first of these is a generalization 7 00:00:14,190 --> 00:00:15,852 of the product rule. 8 00:00:15,852 --> 00:00:19,480 And let's see an instance where it comes up. 9 00:00:19,480 --> 00:00:21,920 Suppose I wanted to count the number of lineups 10 00:00:21,920 --> 00:00:25,290 of five students in the class. 11 00:00:25,290 --> 00:00:29,280 So if I let S be the number of students, and let's say, 12 00:00:29,280 --> 00:00:33,160 for the afternoon session S is 91, then 13 00:00:33,160 --> 00:00:35,880 the number of lineups of five students-- if I use 14 00:00:35,880 --> 00:00:37,560 the ordinary product rule, I would 15 00:00:37,560 --> 00:00:41,590 get-- I'm talking about S to the fifth, that is, 16 00:00:41,590 --> 00:00:44,370 sequences of length five of elements of S. 17 00:00:44,370 --> 00:00:46,210 And so the product rule would say, 18 00:00:46,210 --> 00:00:48,110 take 91 to the fifth as the number 19 00:00:48,110 --> 00:00:49,644 of lineups of five students. 20 00:00:49,644 --> 00:00:52,310 And that would be correct if the same student could appear twice 21 00:00:52,310 --> 00:00:54,130 in line, but that, of course, isn't 22 00:00:54,130 --> 00:00:55,960 possible with real students. 23 00:00:55,960 --> 00:00:58,090 So the lineups have no repeats. 24 00:00:58,090 --> 00:01:00,920 And what we're really counting is the number 25 00:01:00,920 --> 00:01:03,700 of those sequences of length five of students 26 00:01:03,700 --> 00:01:05,379 with no repeats. 27 00:01:05,379 --> 00:01:07,100 And the generalized product rule tells 28 00:01:07,100 --> 00:01:09,740 you quite straightforwardly how to count those. 29 00:01:09,740 --> 00:01:13,473 Namely, there are 91 ways to choose the first student 30 00:01:13,473 --> 00:01:14,830 among the 91. 31 00:01:14,830 --> 00:01:17,160 And whichever first student you've chosen, 32 00:01:17,160 --> 00:01:20,760 that leaves 90 other students you could choose to be second. 33 00:01:20,760 --> 00:01:22,600 And once you've chosen the first two, that 34 00:01:22,600 --> 00:01:25,470 leaves 89 students you could choose for the third, 35 00:01:25,470 --> 00:01:28,730 and 88 for the fourth, and 87 for the fifth. 36 00:01:28,730 --> 00:01:34,830 And the formula then is 91 times 90 times 89, 88, 87, 37 00:01:34,830 --> 00:01:38,250 for the number of sequences of distinct students 38 00:01:38,250 --> 00:01:40,550 of length five. 39 00:01:40,550 --> 00:01:44,250 Now, one nice way to express the 91 down 40 00:01:44,250 --> 00:01:48,550 to 87, in terms of factorials, is its 91 factorial, 41 00:01:48,550 --> 00:01:51,090 which is the product from 1 to 91, 42 00:01:51,090 --> 00:01:53,840 and divided by the product from 1 to 86, 43 00:01:53,840 --> 00:01:57,470 which cancels out the first 86 terms in 91 factorial, 44 00:01:57,470 --> 00:02:01,030 leaving me with exactly 87 through 91 product. 45 00:02:03,770 --> 00:02:09,550 So the second rule is a sort of obvious generalization 46 00:02:09,550 --> 00:02:14,420 of the bijectional, but I'm getting ahead of myself. 47 00:02:14,420 --> 00:02:17,330 Let's state the generalized product rule in general. 48 00:02:17,330 --> 00:02:21,210 So if we let Q be a set of length-k sequences 49 00:02:21,210 --> 00:02:23,190 with the following property, there 50 00:02:23,190 --> 00:02:27,800 are n1 possible first elements among these length-k sequences. 51 00:02:27,800 --> 00:02:32,200 And for every one of the first possible elements, 52 00:02:32,200 --> 00:02:34,740 if you look at the number of tuples 53 00:02:34,740 --> 00:02:37,930 with what the second possible coordinates for a given 54 00:02:37,930 --> 00:02:40,670 first coordinate, it's always n2. 55 00:02:40,670 --> 00:02:43,100 And likewise, if you look at the number 56 00:02:43,100 --> 00:02:48,300 of possible third coordinates given the first two, it's n3 57 00:02:48,300 --> 00:02:51,080 and it's uniform no matter what the first two are. 58 00:02:51,080 --> 00:02:53,989 Then if you have this kind of a set up, 59 00:02:53,989 --> 00:02:56,530 which is exactly what happens when you're picking one student 60 00:02:56,530 --> 00:02:58,780 after another and they can't compete, 61 00:02:58,780 --> 00:03:03,120 you discover that the length-k sequences with n1 , 62 00:03:03,120 --> 00:03:06,070 first possible choices, n2, second possible choices, 63 00:03:06,070 --> 00:03:11,000 down through nk, k-th possible choices is n1 through nk. 64 00:03:11,000 --> 00:03:13,910 So that's the statement of the generalized product 65 00:03:13,910 --> 00:03:16,860 rule in the magenta box. 66 00:03:16,860 --> 00:03:19,444 Now, we come to the generalized bijection rule, which 67 00:03:19,444 --> 00:03:20,610 is called the division rule. 68 00:03:20,610 --> 00:03:22,590 And a simple, memorable way to illustrate 69 00:03:22,590 --> 00:03:24,965 is if you wanted to count the number of students in class 70 00:03:24,965 --> 00:03:28,140 6.042, you could count the number of students fingers 71 00:03:28,140 --> 00:03:29,820 and divide by 10. 72 00:03:29,820 --> 00:03:34,070 Now, it's probably harder to count fingers than students, 73 00:03:34,070 --> 00:03:36,070 so this is not meant as a practical method. 74 00:03:36,070 --> 00:03:39,982 But it illustrates a basic and straightforward idea. 75 00:03:39,982 --> 00:03:41,440 Of course, it's implicitly assuming 76 00:03:41,440 --> 00:03:44,000 that we don't have any instances of amputations 77 00:03:44,000 --> 00:03:46,750 or polydactylism, and that, in fact, every student 78 00:03:46,750 --> 00:03:49,570 has exactly 10 fingers. 79 00:03:49,570 --> 00:03:51,870 OK, so in general, the division rule 80 00:03:51,870 --> 00:03:53,740 can be stated this way, if I have 81 00:03:53,740 --> 00:04:00,010 a total function from a set A to a set B, domain A, co-domain B, 82 00:04:00,010 --> 00:04:06,130 and this mapping is k-to-1, then the cardinality of A 83 00:04:06,130 --> 00:04:10,170 is simply k times the cardinality of B. So k-to-1 84 00:04:10,170 --> 00:04:16,970 means that exactly k A elements hit each B element. 85 00:04:16,970 --> 00:04:20,870 Another way to say it is that there are exactly k arrows 86 00:04:20,870 --> 00:04:24,980 into every element of B. So then the number of arrows 87 00:04:24,980 --> 00:04:29,380 is simply k times B. And if you have a total function on A, 88 00:04:29,380 --> 00:04:32,310 the number of arrows is equal to the size of A, 89 00:04:32,310 --> 00:04:35,845 and that's where we get the formula. 90 00:04:35,845 --> 00:04:36,345 OK. 91 00:04:42,021 --> 00:04:44,490 And that's the generalized bijection rule. 92 00:04:44,490 --> 00:04:46,775 Let's apply it in a crucial example 93 00:04:46,775 --> 00:04:50,530 that is absolutely basic and we'll be using repeatedly. 94 00:04:50,530 --> 00:04:54,320 Suppose that I want to know how many possible subsets of size 95 00:04:54,320 --> 00:04:57,730 four are there from the numbers 1 through 13? 96 00:04:57,730 --> 00:05:01,470 So I have 13 possible numbers that I can choose. 97 00:05:01,470 --> 00:05:03,160 I want to pick out any four of them 98 00:05:03,160 --> 00:05:06,630 and I want to know how many ways are there to do that. 99 00:05:06,630 --> 00:05:10,680 And we'll do that by finding a mapping from things 100 00:05:10,680 --> 00:05:14,350 we know how to count to these particular subsets. 101 00:05:14,350 --> 00:05:16,490 So what we know how to count is if I 102 00:05:16,490 --> 00:05:22,360 let A be the set of all permutations of 1 through 13, 103 00:05:22,360 --> 00:05:27,020 then I know that the size of A is 13 factorial because there's 104 00:05:27,020 --> 00:05:30,340 13 choices for the first element of the permutation, 12 105 00:05:30,340 --> 00:05:33,340 for the second, down to one for the 13th. 106 00:05:33,340 --> 00:05:36,500 And let's let B be this object that I want to count, 107 00:05:36,500 --> 00:05:41,070 namely, the set of size four subsets of 1 through 13. 108 00:05:41,070 --> 00:05:43,420 And I want to find a mapping from A 109 00:05:43,420 --> 00:05:46,960 that I know how to count to B that I don't yet 110 00:05:46,960 --> 00:05:48,870 know how to count, but in a way where 111 00:05:48,870 --> 00:05:51,400 I can figure out that it's k-to-1 for a k 112 00:05:51,400 --> 00:05:52,760 that I can also count. 113 00:05:52,760 --> 00:05:53,980 How do I do that? 114 00:05:53,980 --> 00:05:56,040 Well, let's take an arbitrary permutation of A, 115 00:05:56,040 --> 00:05:58,940 that is to say, a sequence of the elements 116 00:05:58,940 --> 00:06:02,730 of A in some order-- call them a1, a2, through a13. 117 00:06:02,730 --> 00:06:06,315 So these numbers a1 through a13 are those numbers 1 through 13 118 00:06:06,315 --> 00:06:08,810 in some unknown order. 119 00:06:08,810 --> 00:06:11,490 And I'm going to map a permutation of A, 120 00:06:11,490 --> 00:06:14,870 like this, to its first four elements. 121 00:06:14,870 --> 00:06:17,680 Just take the first four elements of the permutation 122 00:06:17,680 --> 00:06:20,090 and map them to the set consisting 123 00:06:20,090 --> 00:06:21,680 of those four elements. 124 00:06:21,680 --> 00:06:23,066 Now, since this is a permutation, 125 00:06:23,066 --> 00:06:24,440 these elements are all different, 126 00:06:24,440 --> 00:06:27,250 so I really do get a set of four different things here, 127 00:06:27,250 --> 00:06:28,730 a1, a2, and a3. 128 00:06:28,730 --> 00:06:31,060 And a4 is supposed to be different. 129 00:06:31,060 --> 00:06:35,580 This gives me a very well-defined total function 130 00:06:35,580 --> 00:06:40,180 from a permutation of 13 numbers to set of its first four 131 00:06:40,180 --> 00:06:41,870 elements. 132 00:06:41,870 --> 00:06:45,460 And now what we want to know is what kind of a mapping is this? 133 00:06:45,460 --> 00:06:48,170 And I'm going to argue that it's k-to-1 for a k that's 134 00:06:48,170 --> 00:06:50,490 not very hard to count. 135 00:06:50,490 --> 00:06:54,420 So when I look at what other things map 136 00:06:54,420 --> 00:07:00,166 to the set a1, a2, a3, a4, we mapped a permutation 137 00:07:00,166 --> 00:07:01,290 to its first four elements. 138 00:07:01,290 --> 00:07:05,210 And if we've got a1 through a4 as the set, what other things 139 00:07:05,210 --> 00:07:07,660 map to that set a1, a2, a3, a4? 140 00:07:07,660 --> 00:07:09,760 Well, the answer is any permutation 141 00:07:09,760 --> 00:07:12,564 with the same first four elements, but possibly 142 00:07:12,564 --> 00:07:14,230 in a different order, because we're just 143 00:07:14,230 --> 00:07:17,070 going to take the first four in sequence 144 00:07:17,070 --> 00:07:19,330 and map them to the set of those first four. 145 00:07:19,330 --> 00:07:22,400 The order in which the first four doesn't matter. 146 00:07:22,400 --> 00:07:23,770 OK? 147 00:07:23,770 --> 00:07:29,230 And likewise, the order of the remaining nine elements, 148 00:07:29,230 --> 00:07:31,550 5 through 13, also doesn't matter. 149 00:07:31,550 --> 00:07:35,680 Whatever they are, if I have a given set of four elements 150 00:07:35,680 --> 00:07:38,520 to start, no matter what the remaining 9 are, 151 00:07:38,520 --> 00:07:42,610 they're going to map to the same subset of four elements. 152 00:07:42,610 --> 00:07:46,350 So there are 4 factorial possible ways 153 00:07:46,350 --> 00:07:49,520 that the first four elements can be permuted. 154 00:07:49,520 --> 00:07:53,030 And there are 9 factorial ways that the last nine 155 00:07:53,030 --> 00:07:54,570 elements can be permuted. 156 00:07:54,570 --> 00:07:58,780 And every one of these goes to the same set of four elements, 157 00:07:58,780 --> 00:07:59,810 a1 through a4. 158 00:07:59,810 --> 00:08:01,940 And those are the only ones that go there. 159 00:08:01,940 --> 00:08:06,730 And so what we've figured out is that the mapping 160 00:08:06,730 --> 00:08:10,650 of these kind of sequences with the given four elements first 161 00:08:10,650 --> 00:08:12,310 in some order and the remaining nine 162 00:08:12,310 --> 00:08:16,590 elements in some other order is 4 factorial times 9 163 00:08:16,590 --> 00:08:18,980 factorial-to-1. 164 00:08:18,980 --> 00:08:22,740 There are 4 factorial times 9 factorial permutations 165 00:08:22,740 --> 00:08:28,180 that map to any given set of four elements. 166 00:08:28,180 --> 00:08:30,640 And that means that by applying the division rule, 167 00:08:30,640 --> 00:08:33,169 I've discovered that the size of A, which I know 168 00:08:33,169 --> 00:08:36,900 is 13 factorial, is equal to that k 169 00:08:36,900 --> 00:08:39,900 of the k-to-1 of 4 factorial times 9 factorial times 170 00:08:39,900 --> 00:08:41,315 the size of B. 171 00:08:41,315 --> 00:08:45,950 B is the subsets of size four that I'm trying to count. 172 00:08:45,950 --> 00:08:49,600 And so what I get is that the size of B 173 00:08:49,600 --> 00:08:53,950 is simply 13 factorial divided by that k, 4 174 00:08:53,950 --> 00:08:57,630 factorial 9 factorial, 13 factorial over 4 factorial 175 00:08:57,630 --> 00:08:58,720 9 factorial. 176 00:08:58,720 --> 00:09:00,920 And this number comes up so often 177 00:09:00,920 --> 00:09:03,380 that it has this special notation called 178 00:09:03,380 --> 00:09:10,340 binomial coefficient notation, which we read as 13 choose 4. 179 00:09:10,340 --> 00:09:15,230 In general, if I have an n element set 180 00:09:15,230 --> 00:09:18,730 and I'm going to choose a subset of m of them-- generalizing 181 00:09:18,730 --> 00:09:21,250 this argument because the 4 and the 9 182 00:09:21,250 --> 00:09:23,010 and the 13 were completely arbitrary 183 00:09:23,010 --> 00:09:24,730 and the argument works in general-- 184 00:09:24,730 --> 00:09:28,980 is that the number of ways to choose a set of m elements 185 00:09:28,980 --> 00:09:32,880 among n is n choose m. 186 00:09:32,880 --> 00:09:35,460 And the definition of n choose m is 187 00:09:35,460 --> 00:09:38,710 n factorial over the m factorial ways 188 00:09:38,710 --> 00:09:42,660 to permute the first m elements and the n minus m factorial 189 00:09:42,660 --> 00:09:48,412 ways to permute the remaining n minus m elements. 190 00:09:48,412 --> 00:09:52,260 And again, that notation, the binomial coefficient, 191 00:09:52,260 --> 00:09:56,730 is called n over m is n choose m. 192 00:09:56,730 --> 00:09:58,810 This is an absolutely fundamental formula 193 00:09:58,810 --> 00:10:01,940 that you need to remember because we will be using it 194 00:10:01,940 --> 00:10:04,410 constantly and repeatedly.