 Welcome back to our lecture series, MAT3120 Transition to Advanced Mathematics for Student Sets at the Utah University. As usual, I'll be your professor today, Dr. Anjan Misildine. Lecture 10 represents the start of the second unit of our lecture series. Lectures 1 through 9 focused on this idea of set theory, for which we're introduced to the notions of sets, subsets, partitions, elementary power sets, and just elementary operations on sets, unions, intersections, Cartesian projects, and such. Of course, with this lecture series, this runs concurrently with our conversations about logic and communication. But for the mathematical content, lectures 1 through 9 cover this idea of elementary set theory. Now starting with lecture 10, we're going to be starting the conversation about a topic of mathematics known as commonatorics. With commonatorics, there's a lot of ways you could define it. Basically, commonatorics, for at least the purposes of our lecture series, its scope is much larger than what we're going to talk about. But for this lecture series, commonatorics is the mathematics of counting things. That might not seem like it's a hard thing. It's like, I learned to count before I even went to school. One, two, three. Well, it's a little bit more complicated than that. Commonatorics focuses on the idea of a finite set. You have some set A, and you then look at the cardinality of that set. When it's finite, we want a specific number. Is it 7? Is it 3,000? Is it 5,280? It turns out that there are a lot of tricky things that can happen when you're trying to compute the cardinality of a finite set. Commonatorics is focused on that. We will continue to have a conversation in these lecture series about logic and communication that are concurrent with our mathematical conversation. But for the topics at hand, the mathematical content is going to shift towards this idea of commonatorics. As we talk about commonatorics, we're going to be very interested in counting sets and lists and things like that. In this first video, we want to focus on perhaps the most fundamental principle of commonatorics, which is sometimes referred to as the multiplication principle. This is because in the future, we'll also talk about the addition, subtraction, and division principles of commonatorics. So before we see what the multiplication principle is, let's actually look at an example. So let's imagine that you are going to go eat dinner at the following local restaurant. And this local restaurant's really attractive to say college students because every meal on the menu is the exact same price, right? There's the student fixed price meal. And this is how it breaks down. You get an appetizer with this meal. It comes with a single entree and it comes with a single dessert. So this is a really attractive place for lots of college students to go eat with their friend, to go on a first date or whatever, because they know exactly what the price is gonna be. But now that price is no longer the issue, it comes down to what do you pick for your meal, right? We could ask with these three choices that have to be made. You have to choose an appetizer. You have to choose an entree. You have to choose a dessert. How many different meals could be ordered using the fixed price dinner at this restaurant? Well, this is a small enough problem that we could really consider all the possibilities. You have two choices for this appetizer. You have three choices for the entree, right? Cause appetizers, you had soup and salad, those were your two options. For entree, you could have lasagna, steak, curry or lobster. Four options there. And then for dessert, you get to choose between ice cream or cheesecake. Now, to help us prepare for future combinatorial problems, I want you to think of it the following way. We're gonna introduce a set, which we're gonna call A, A for appetizer. And this set contains two elements. There's soup and then there's salad. There is a second set, which we're gonna call it E, E for entree there. You're gonna have lasagna, steak, curry and lobster as your four options there. And then for dessert, we have two options, of course. There's the ice cream and then there's the cheesecake. I wish I could pick both, but alas, you only get one option of each of these things here. So we think of these as sets, right? So for each set, each set represents a decision that has to be made, a choice that has to be made. I'm gonna put it more as decisions here, because the word choice can be a little bit ambiguous in this situation. So we have a set for these three decisions that have to be made. Now, inside of each of these decision sets, there are options. The elements of these sets are gonna be the options you can have there. And therefore, if you look at something like the cardinality of set A, that's gonna be the number of options for appetizers. And likewise, if you look at the cardinality of E here, that's gonna give you the number of options for the second decision of entree. And if you look at the cardinality of D, that will be the number of options you have for the dessert. So these cardinalities are gonna affect the number of meals you can have here. Now, let's think about what is a meal? In this abstract sense, a meal is actually a list of three things. You pick your appetizer, let's say it's a soup. You pick your entree, let's say it's the lasagna, right, lasagna. And then let's say you pick your dessert and you pick the ice cream for that one, right? And so a meal is a list of three things. It's an object from the first set, decision set. There's an element chosen from the second decision set. And then there's an element chosen for the third decision set. So a meal combination, we can then view as an element of the Cartesian product, appetizers times entrees times desserts there. And so, because a meal is just a list of three elements, one appetizer, one entree and one dessert. And therefore the number of meal combinations, the number of meal combinations is then equal to the cardinality of this set, A cross E cross D. And we've talked about this before for two Cartesian sets. And so if you look at this like, oh, this set is really just A cross E cross D, like so. And so therefore the cardinality with two sets, you're gonna get A times the cardinality of E cross D, like so. But then once the cardinality of E cross D there, it's gonna be A times E times, got a little bit stuck there, times D. You take the product of all those three things there. So the number of meals is then gonna turn out to be two times four times, did I never write this on the board earlier too? You get two times four times two. So the number of meals is gonna be 16. And where did that two, four, two come from? That's the cardinality of this set, times the cardinality of this set, times the cardinality of this set. Now this seems like an overkill for what could be otherwise considered a very elementary problem. But the idea is we want to understand the principles and play here so that when we look at much more difficult examples, we can apply those principles in an abstract setting. So this fixed price local restaurant meal combination is an example of the multiplicative principle of counting that I alluded to earlier. So imagine we have a sequence of decision sets. So D one, D two, D three up to D N. So these sets represent decisions that have to be made and D I therefore is then the Ith decision that has to be made. Now let's suppose that each of these decisions is independent, which means that the choice of one decision doesn't actually affect the choice of another decision. So with our example of the restaurant, if you choose a soup that doesn't change your four options, lasagna, steak, curry or lobster. Now you the customer will be like, ah, soup goes better with a lobster. Curry is basically soup already, I don't wanna do that. Well, you might choose to not have curry because it's too similar to soup. But in all reality, the restaurant will let you do that combination. You could do soup and curry, making one choice doesn't stop the other. So these choices are independent, the decisions that is. And so then if you have N decisions that have to be made and those decisions are independent, then the number of possible choices you can make is gonna be the cardinality of the Cartesian product of all of those decisions together. Because like with the meals we talked about earlier, choosing a meal combination is selecting a list from that Cartesian product. So therefore we have to count the Cartesian product here. But how do you count the Cartesian product when each of these decision sets is finite? Well, it's going to be the product of each of these decision sets individually, the cardinalities that is. And so that's the multiplicative principle, but we're gonna use this all the time in common at Torx. Let me give you another example that's a lot quicker than the previous one. How many two symbol code words can be formed if the first symbol is an uppercase letter, so A through Z, Roman alphabet there, 26 letters. And the second symbol is gonna be a numerical digit, zero through nine. So there's 10 options for that one. So some examples like A1, A2, B3, X0, those are all examples of these two symbol code words. We could try to list each and every one of these code words, but that's not the best idea. Instead we wanna think of that each of these code words is a list of two elements. And we have basically two alphabets in play here. The first decision is we have to choose a letter. So we have some alphabet, which we'll call this A here. It contains the letters A, B, C, D, E, F, G, you know the song, right? So you have this alphabet for the first symbol. And then you have this alphabet for the second symbol. In this case, it's a different alphabet. The second symbol is then a numerical digit, zero, one, two, all the way up to nine. And like I mentioned earlier, the first alphabet, whoops, has a cardinality of 26. The second alphabet has a cardinality of 10. And the code words we're selecting is an element of the first alphabet cross the second alphabet. I keep on calling it alphabets because we're selecting a symbol, but an alphabet in this case is just our decision set. So the number of possibilities is the number of code words is then gonna be the cardinality of the Cartesian product, which we saw from the multiplicative principle. This is 26 times 10. So therefore there's gonna be 260 possible code words. That's all there has to be, 26 times 10 there. Let's look at another example. Consider the list of length four made with the symbols A, B, C, D, E, F, G, okay? Now this is something that's very important to pay attention to this. Now when we talk about these list of order four, remember, list are ordered. It's not a set at the list. The order matters. Now with the two previous examples we saw, the alphabets, the decision sets were different for each decision. So with appetizers, entrees, desserts, each one was different. So if you mix up the order, it didn't make any bit of a difference whatsoever. Same thing with our code words we had a moment ago. It was a Roman letter, then a number digit. So if you mix up the order, you could correct it without any problem. But the issue you have is like if your word is something like rat, okay? If you switch up the letters, you can also spell art, but like in the English language, rats and art are very different. Like if you ask me, let's go to the museum and look at some art, I might say, yeah, that sounds fun. But if you're like, let's go to the museum and look at some rats, I'd probably be like, no, I'm not gonna do that. Doesn't sound very fun. List the order matters. And so with this list of order four, excuse me, of length four, the order in which the letters appear will matter. If you permute things around, that gives you a different list. So we have to consider that when you repeat the alphabet. Another thing that's gonna be very important as you count list is this idea of repetition. This is an ordered list, the order matters, because that's built into the definition of the word list there. But this idea of repetition also matters. Can you use the same letter more than once? Well, again, when your different alphabets are, well, when the distinct alphabets are actually different from each other, then you have no chance of repetition because their intersections are empty. But in this situation, we're considering with repetition to find these lists. We have to take our alphabet. Let's take this right here to be our alphabet. Call it A again. And so a list of length four, for which you can repeat the same letter, this is looking for an element, such one of these four lists is gonna be an element of A, whoops, A cross A, cross A, cross A. Which remember, we defined this earlier, this is the set A to the fourth, right there. The exponent means how many Cartesian products did you take there? And so we wanna find the cardinality of this thing. The cardinality of A to the fourth by the multiplicative principle is gonna be the cardinality of A to the fourth power. All right, and how many letters are in our alphabet? One, two, three, four, five, six, seven. So we end up with seven to the fourth as the number of length four lists we can make with seven letters here. And of course, seven to the fourth, it turns out to be 2,401. Honestly, when it comes to combinatorial problems, the unsimplified answer is typically more enlightening than the simplified answer. So don't be too worried if you leave it as something like seven to the fourth there. Anyone can operate a calculator and figure out that number. So it's not a big deal if you leave it as something like seven to the fourth. And so the multiplicative principle comes into play here because as you're listing these things, you have basically four buckets that have to be filled. The first bucket has seven options. Because of repetition, this next bucket has seven options. You could choose the same letter as many times as you want. And so you have this seven times seven times seven and that's where the seven to the fourth comes from. Now I wanna change this problem ever so slightly because we still wanna consider list of length four but what if we don't allow for repetition anymore? So we can't reuse the same letter that we used previously. Now the reason why this example does need to be considered is because if repetition is not allowed, then it would appear that the decisions we make about which letters are in the list no longer are independent. Because if your first letter is A, then the second letter can't be A. So it kind of depends on the previous choice. Since we no longer have independent decisions, it would appear that the multiplication principle doesn't apply here but actually it does. And so what we're gonna do is the following. We're gonna introduce some new sets. So we're gonna introduce a set A1 which is just gonna be the alphabet we have from before, the same seven letters, A through G it was. Seven letters there. Now for the first symbol, you have seven options for what you can choose. Seven options there. Because you haven't used any of the seven letters yet. So that gives you your first letter. Now let's say for the sake of example, you choose an A. Well then what do you choose for the next letter? Well you choose everything except for A but I don't actually know what that letter is. So we're gonna say the first letter is, we'll call it X. I guess I'm gonna use more of the more than one. We'll call it X1. So the first letter whatever it is is X1. It could be an A, it could be a B, it could be C. Don't know. Now when it comes to the second letter, now when it comes to the second letter that you have to choose, you no longer have all the same options but what you can do is you take A1 and if you take away from it X1, so you remove X1 from the alphabet, you could then choose any letter in that set. We're gonna call this second alphabet A2. Now A2, because you took away a letter, its cardinality is actually now six and so it got smaller. You have one fewer options for the next one. Let's say that the second letter you choose is X2. Then we can repeat this pattern here that your third letter will be chosen from the set A2 take away X2. That's our third letter that we get to choose. Let's say that the third letter we choose is in fact X3. Well, how many options were there for X3? Well, it's the cardinality of A3 but now there's five elements there and we can then repeat this pattern for the fourth letter. We'll call that set A4. It's gonna have a cardinality of four and let's suppose that fourth letter we chose was X4 here. It's just a variable there but what was A4? A4 was of course A3 take away X3. Now be aware that X2, A2 was already missing X1 so when you take away X2 it's a different letter. You can't repeat the letter. So each time this thing gets smaller by one and we're never repeating the same letter there. So the type of words that we're looking for is you're looking for some type of list that's contained inside of A1 cross A2 cross A3 cross A4. Whoops, that is not an A. Try that again. And therefore what we have to do is we have to count the cardinality of A1 cross A2 cross A3 cross A4 for which by the multiplication principle because we've removed elements from the set once you remove the letter you've already used then the next decision is in fact independent of the previous ones. And so we end up getting this product seven times six times five times four and that turns out to be 840 words without repetition in there. And so with the appropriate modification we can in fact use the multiplication principle. And I drew these pictures of buckets before as we're trying to pick a word it's basically like we still have these four buckets that have to be filled and I'm choosing letters from the alphabet. Now this time we had seven available letters for the first one but depending upon what your first choice is then you have six options for the second and depending on that choice you get five options for the third and then the last one will be four options because you keep on using them. So even if you have some dependent choices if you have no repetition you actually get this falling product and instead of getting seven to the fourth now you actually are falling down what we refer to as a falling factorial but this is something we'll talk about more in a future lecture.