1 00:00:00,590 --> 00:00:05,150 In this segment we introduce a simple but powerful tool, the 2 00:00:05,150 --> 00:00:08,450 basic counting principle, which we will be using over 3 00:00:08,450 --> 00:00:11,820 and over to deal with counting problems. 4 00:00:11,820 --> 00:00:15,070 Let me describe the idea through a simple example. 5 00:00:15,070 --> 00:00:18,380 You wake up in the morning and you find that you have in your 6 00:00:18,380 --> 00:00:23,120 closet 4 shirts, 3 ties, and 2 jackets. 7 00:00:23,120 --> 00:00:27,000 In how many different ways can you get dressed today? 8 00:00:27,000 --> 00:00:30,580 To answer this question, let us think of the process of 9 00:00:30,580 --> 00:00:36,220 getting dressed as consisting of three steps, three stages. 10 00:00:36,220 --> 00:00:40,910 You first choose a shirt, let's say this one, and you 11 00:00:40,910 --> 00:00:44,600 have 4 choices of shirts. 12 00:00:44,600 --> 00:00:50,600 But each shirt can be used together with 1 of the 3 13 00:00:50,600 --> 00:00:55,710 available ties to make 3 different shirt-tie 14 00:00:55,710 --> 00:00:58,520 combinations. 15 00:00:58,520 --> 00:01:03,540 But since we had 4 choices for the shirt, this means that we 16 00:01:03,540 --> 00:01:09,970 have 4 times 3, equals 12, shirt-tie combinations. 17 00:01:09,970 --> 00:01:12,160 Finally, you choose a jacket. 18 00:01:12,160 --> 00:01:15,240 Each shirt-tie combination can go together with either 19 00:01:15,240 --> 00:01:19,400 jacket, and so the fact that you have 2 jackets available 20 00:01:19,400 --> 00:01:25,320 doubles the number of options that you have, leading to 24 21 00:01:25,320 --> 00:01:27,340 different options overall. 22 00:01:27,340 --> 00:01:31,190 So 24 is the answer to this simple problem. 23 00:01:31,190 --> 00:01:33,530 And how did the number 24 come about? 24 00:01:33,530 --> 00:01:37,420 Well, 24 is the same as the number of options you had in 25 00:01:37,420 --> 00:01:40,009 the first stage times the number of options you had in 26 00:01:40,009 --> 00:01:43,530 the second stage times the number of options you had in 27 00:01:43,530 --> 00:01:45,539 the third stage. 28 00:01:45,539 --> 00:01:48,610 Let us generalize. 29 00:01:48,610 --> 00:01:51,840 Suppose we want to construct some kind of object, and we're 30 00:01:51,840 --> 00:01:55,110 going to construct it through a sequential process, through 31 00:01:55,110 --> 00:01:58,890 a sequence of r different stages. 32 00:01:58,890 --> 00:02:02,140 In the example that we just considered, the number of 33 00:02:02,140 --> 00:02:05,600 stages was equal to 3. 34 00:02:05,600 --> 00:02:09,600 At each one of the stages, you have a number of options that 35 00:02:09,600 --> 00:02:10,699 are available. 36 00:02:10,699 --> 00:02:14,500 So in our example, at the first stage we had 4 options, 37 00:02:14,500 --> 00:02:19,270 at the second stage we had 3 options, and at the last stage 38 00:02:19,270 --> 00:02:21,990 we had 2 options. 39 00:02:21,990 --> 00:02:27,930 What is important is that when you reach stage i, no matter 40 00:02:27,930 --> 00:02:31,430 what you chose, no matter what you did at the previous 41 00:02:31,430 --> 00:02:35,329 stages, the number of options that you will have available 42 00:02:35,329 --> 00:02:42,180 at stage i is going to be that fixed number, n-sub-i. 43 00:02:42,180 --> 00:02:44,200 So what is the answer? 44 00:02:44,200 --> 00:02:47,500 How many different objects can you construct this way? 45 00:02:47,500 --> 00:02:50,950 Well, just generalizing from what we did in our specific 46 00:02:50,950 --> 00:02:56,500 example, the answer is the product of the number of 47 00:02:56,500 --> 00:03:02,950 choices or options that you had at each stage. 48 00:03:02,950 --> 00:03:05,240 This is the counting principle. 49 00:03:05,240 --> 00:03:08,740 It's a very simple idea, but it is powerful. 50 00:03:08,740 --> 00:03:11,140 It will allow us to solve fairly 51 00:03:11,140 --> 00:03:13,790 complicated counting problems. 52 00:03:13,790 --> 00:03:17,990 However, before we go into more complicated problems, let 53 00:03:17,990 --> 00:03:21,760 us first deal with a few relatively easy examples. 54 00:03:26,300 --> 00:03:31,660 In our first example, let us consider license plates that 55 00:03:31,660 --> 00:03:35,240 consist of 2 letters followed by 3 digits. 56 00:03:35,240 --> 00:03:37,320 The question is, how many different 57 00:03:37,320 --> 00:03:39,620 license plates are there? 58 00:03:39,620 --> 00:03:43,250 We think of the process of constructing a license plate 59 00:03:43,250 --> 00:03:45,130 as a sequential process. 60 00:03:45,130 --> 00:03:51,700 At the first stage we choose a letter, and we have 26 choices 61 00:03:51,700 --> 00:03:53,460 for the first letter. 62 00:03:53,460 --> 00:03:57,690 Then we need to choose the second letter, and we have 26 63 00:03:57,690 --> 00:03:59,700 choices for that one. 64 00:03:59,700 --> 00:04:01,210 Then we choose the first digit. 65 00:04:01,210 --> 00:04:03,160 We have 10 choices for it. 66 00:04:03,160 --> 00:04:06,870 We choose the second digit, for which we have 10 choices. 67 00:04:06,870 --> 00:04:09,460 And finally, we choose the last digit, for which we also 68 00:04:09,460 --> 00:04:10,790 have 10 choices. 69 00:04:10,790 --> 00:04:13,880 So if you multiply these numbers, you can find the 70 00:04:13,880 --> 00:04:16,560 number of different license plates that you can make with 71 00:04:16,560 --> 00:04:18,930 2 letters followed by 3 digits. 72 00:04:18,930 --> 00:04:23,540 Now let us change the problem a little bit and require that 73 00:04:23,540 --> 00:04:28,775 no letter and no digit can be used more than once. 74 00:04:31,300 --> 00:04:35,960 So, let us think of a process by which we could construct 75 00:04:35,960 --> 00:04:38,580 license plates of this kind. 76 00:04:38,580 --> 00:04:44,480 In the first stage, we choose the first letter that goes to 77 00:04:44,480 --> 00:04:48,450 the license plate, and we have 26 choices. 78 00:04:48,450 --> 00:04:51,620 Now, let us go into a second stage where we choose the 79 00:04:51,620 --> 00:04:54,070 second letter. 80 00:04:54,070 --> 00:04:57,930 Because we used 1 letter in the first stage, this means 81 00:04:57,930 --> 00:05:02,690 that there's only 25 available letters that can be used. 82 00:05:02,690 --> 00:05:06,900 We only have 25 choices at the second stage. 83 00:05:06,900 --> 00:05:08,790 Now, let us start dealing with the digits. 84 00:05:08,790 --> 00:05:12,530 We choose the first digit, and we have 10 choices for it. 85 00:05:12,530 --> 00:05:17,400 However, when we go and choose the next digit we will only 86 00:05:17,400 --> 00:05:20,780 have 9 choices, because 1 of the digits has 87 00:05:20,780 --> 00:05:22,620 already been used. 88 00:05:22,620 --> 00:05:26,450 At this point, 2 digits have been used, which means that at 89 00:05:26,450 --> 00:05:30,630 the last stage we have only 8 digits to choose from. 90 00:05:30,630 --> 00:05:34,590 So by multiplying these numbers, we can find out the 91 00:05:34,590 --> 00:05:37,590 answer to this question, the number of license plates if 92 00:05:37,590 --> 00:05:40,860 repetition is prohibited. 93 00:05:40,860 --> 00:05:43,830 Let us now consider a different example. 94 00:05:46,450 --> 00:05:49,450 Suppose that we start with a set that 95 00:05:49,450 --> 00:05:51,710 consists of n elements. 96 00:05:54,540 --> 00:05:57,130 What we want to do is to take these n 97 00:05:57,130 --> 00:06:00,230 elements and order them. 98 00:06:00,230 --> 00:06:03,650 A terminology that's often used here is that we want to 99 00:06:03,650 --> 00:06:07,290 form a permutation of these n elements. 100 00:06:07,290 --> 00:06:11,850 One way of visualizing permutations is to say that 101 00:06:11,850 --> 00:06:14,720 we're going to take these elements of the set, which are 102 00:06:14,720 --> 00:06:18,010 unordered, and we're going to place them 103 00:06:18,010 --> 00:06:20,590 in a sequence slots. 104 00:06:20,590 --> 00:06:23,030 So we create n slots. 105 00:06:26,390 --> 00:06:31,750 And we want to put each one of these elements into one of 106 00:06:31,750 --> 00:06:33,500 these slots. 107 00:06:33,500 --> 00:06:36,350 How do we go about it? 108 00:06:36,350 --> 00:06:39,760 We think of putting the elements into slots, 109 00:06:39,760 --> 00:06:41,890 one slot at a time. 110 00:06:41,890 --> 00:06:44,350 We first consider the first slot. 111 00:06:44,350 --> 00:06:48,740 We pick one of the elements and put it there. 112 00:06:48,740 --> 00:06:50,820 How many choices do we have at this stage? 113 00:06:50,820 --> 00:06:54,260 We have n choices, because we can pick any of the available 114 00:06:54,260 --> 00:06:56,930 elements and place it in that slot. 115 00:06:56,930 --> 00:07:00,420 Next, we pick another element and put it 116 00:07:00,420 --> 00:07:02,380 inside the second slot. 117 00:07:02,380 --> 00:07:04,765 How many choices do we have at this step? 118 00:07:04,765 --> 00:07:10,180 Well, we have already used one of the available elements, 119 00:07:10,180 --> 00:07:13,280 which means that there's n minus 1 elements to choose 120 00:07:13,280 --> 00:07:17,160 from at the next stage. 121 00:07:17,160 --> 00:07:20,190 At this point, we have used 2 of the elements. 122 00:07:20,190 --> 00:07:24,120 There is n minus 2 that are left. 123 00:07:24,120 --> 00:07:30,100 We pick one of them and put it in the third slot, and we have 124 00:07:30,100 --> 00:07:33,080 n minus 2 choices at this point. 125 00:07:33,080 --> 00:07:34,580 We continue this way. 126 00:07:34,580 --> 00:07:36,230 We keep going on. 127 00:07:36,230 --> 00:07:39,640 At some point we have placed n minus 1 of the 128 00:07:39,640 --> 00:07:41,090 elements into slots. 129 00:07:41,090 --> 00:07:44,730 There's only one element left, and that element, necessarily, 130 00:07:44,730 --> 00:07:47,610 will get into the last slot. 131 00:07:47,610 --> 00:07:50,730 There are no choices to be made at this point. 132 00:07:50,730 --> 00:07:57,500 So the overall number of ways that we can carry out this 133 00:07:57,500 --> 00:08:01,160 process, put the elements into the n slots, by the counting 134 00:08:01,160 --> 00:08:04,510 principle is going to be the product of the number of 135 00:08:04,510 --> 00:08:09,870 choices that we had at each one of the stages. 136 00:08:09,870 --> 00:08:13,710 So it's the product of the numbers n, n minus 1, n minus 137 00:08:13,710 --> 00:08:17,660 2, all the way down to 1. 138 00:08:17,660 --> 00:08:24,430 And this product we denote as a shorthand this way, which we 139 00:08:24,430 --> 00:08:26,300 read as n factorial. 140 00:08:26,300 --> 00:08:31,100 n factorial is the product of all integers from 1 all the 141 00:08:31,100 --> 00:08:32,799 way up to n. 142 00:08:32,799 --> 00:08:37,640 And in particular, the number of permutations of n elements 143 00:08:37,640 --> 00:08:40,900 is equal to n factorial. 144 00:08:40,900 --> 00:08:44,039 Let us now consider another example. 145 00:08:44,039 --> 00:08:48,460 We start again with a general set, which 146 00:08:48,460 --> 00:08:51,500 consists of n elements. 147 00:08:51,500 --> 00:08:55,120 And we're interested in constructing a 148 00:08:55,120 --> 00:08:56,880 subset of that set. 149 00:08:59,472 --> 00:09:02,350 In how many different ways can we do that? 150 00:09:02,350 --> 00:09:06,540 How many different subsets are there? 151 00:09:06,540 --> 00:09:09,700 Let us think of a sequential process through which we can 152 00:09:09,700 --> 00:09:11,040 choose the subset. 153 00:09:11,040 --> 00:09:14,580 The sequential process proceeds by considering each 154 00:09:14,580 --> 00:09:18,640 one of the elements of our set, one at a time. 155 00:09:18,640 --> 00:09:20,750 We first consider the first element, and 156 00:09:20,750 --> 00:09:22,650 here we have 2 choices. 157 00:09:22,650 --> 00:09:27,090 Do we put it inside the set or not? 158 00:09:27,090 --> 00:09:29,260 So 2 choices for the first element. 159 00:09:29,260 --> 00:09:31,600 Then we consider the second element. 160 00:09:31,600 --> 00:09:32,990 Again, we have 2 choices. 161 00:09:32,990 --> 00:09:36,910 Do we put it in the subset or not? 162 00:09:36,910 --> 00:09:42,770 We continue this way until we consider all the elements. 163 00:09:42,770 --> 00:09:45,020 There's n of them. 164 00:09:45,020 --> 00:09:48,020 And the overall number of choices that we have is the 165 00:09:48,020 --> 00:09:53,520 product of 2 times 2 times 2, n times, which is 2 166 00:09:53,520 --> 00:09:56,620 to the power n. 167 00:09:56,620 --> 00:09:59,760 At this point, we can also do a sanity check to make sure 168 00:09:59,760 --> 00:10:02,320 that our answer is correct. 169 00:10:02,320 --> 00:10:07,770 Let us consider the simple and special case where n is equal 170 00:10:07,770 --> 00:10:12,270 to 1, which means we're starting with this set with 1 171 00:10:12,270 --> 00:10:14,650 element, and we want to find the number of 172 00:10:14,650 --> 00:10:16,320 subsets that it has. 173 00:10:16,320 --> 00:10:20,820 According to the answer that we derived, this should have 2 174 00:10:20,820 --> 00:10:24,740 to the first, that is 2 subsets. 175 00:10:24,740 --> 00:10:26,830 Which ones are they? 176 00:10:26,830 --> 00:10:33,160 One subset of this set is the set itself and the other 177 00:10:33,160 --> 00:10:36,090 subset is the empty set. 178 00:10:36,090 --> 00:10:39,720 So we do have, indeed, 2 subsets out of that set, which 179 00:10:39,720 --> 00:10:42,600 agrees with the answer that we found. 180 00:10:42,600 --> 00:10:47,460 Notice that when we count subsets of a given set, we 181 00:10:47,460 --> 00:10:52,720 count both the set itself, the whole set, and we also count 182 00:10:52,720 --> 00:10:53,630 the empty set. 183 00:10:53,630 --> 00:10:56,420 All of these are subsets of our set. 184 00:10:58,960 --> 00:11:03,430 At this point, we can now pause and you can try to 185 00:11:03,430 --> 00:11:07,290 answer some simple questions of the same kind as the ones 186 00:11:07,290 --> 00:11:08,600 that we just practiced.