 Welcome back to our lecture series, Math 3120, Transition to Advanced Mathematics for students at Southern Utah University. As usual, I'll be your professor today, Dr. Andrew Missildine. So continuing in our sequence about common torques, where we're spending time counting sets and lists, I want to introduce a new type of list into our conversation and try to count those, like we've been considering with previous ones. Now, we introduced the general idea of a list, but we've discovered that things like order and repetition seem to make a big difference on the type of list that we have. And so we've talked about different types of lists based upon these two notions of order and repetition. So remember that a string was an example of a ordered list with repetition. We've also introduced the notion of a permutation. A permutation was an ordered list without repetition. We've introduced the notion of a set, and that's actually where we spent our entire first unit in this lecture series, mathematically speaking, about, on set, so it's then in the language of list, a set is an unordered list without repetition, so maybe I should put it down here in our hierarchy. And so then there's sort of this natural gap here. Are there unordered lists with repetition? Absolutely, and that's exactly what we refer to as a multi-set. And then the name sort of suggests what's going on here. A set, of course, is this unordered list. The multi-suggest that an element can show up multiple times. And in fact, the number of times a specific element appears in a multi-set is referred to as the multiplicity of that set. And it does sort of beg the explanation, why would we care about a multi-set? There are situations where a set might be the inappropriate tool to use. Like imagine we're listing all of the roots of a polynomial or all of the eigenvalues of a matrix. Yeah, we can talk about the set of eigenvalues or the set of roots, but sometimes the set hides some information. The multiplicity of these roots matter. The multiplicity of the eigenvalues can make a difference on how you study the matrix. Like for example, the fundamental theorem of algebra tells us that when we take the number of roots of a polynomial with multiplicity, that's always equal to the degree of the polynomial. And so if you neglect the multiplicity, then perhaps you're missing part of the story there. And so it's important to sometimes consider such multi-list. So the way that we express and talk about multi-lists for the multi-sets, excuse me, is very much similar to how we talk about sets and list. We've reserved the notation curly braces to describe a set and we've been using parentheses to describe a list. So we need something to describe a multi-set. And so for our lecture series, we're gonna use square brackets to start and end multi-sets. So we might say something like the following x is the multi-set x1, x2, x3 up to xn. The order in which they're listed does not matter, but it is possible that the same element could appear more than once. x1 and x2 could actually be equal to each other. And that's an important part of being a multi-list, a multi-set, excuse me. We could also describe a multi-set using the usual set builder notation. We could say something like, oh, x is equal, x, the multi-set, is equal to all elements x, such that x satisfies the property here. It's unordered, so the order in which you list them doesn't make a bit of a difference as well. But it's also possible that these x's could represent different representations of the same element. And therefore, as such, they could satisfy the property more than once and thus could be included into the multi-list more than once, okay? Now I should mention that while the notation for sets using these curly braces is fairly universal, the notation for multi-set is not. We will use square brackets in this lecture series, but I've seen people use angle brackets to describe multi-sets, but I've also seen people use angle brackets to describe vectors or list. And so the notation for list and multi-sets not fairly standardized like sets are. But again, for the consistency in this lecture series, we'll use brackets in that situation to describe the multi-sets that we're considering right now. So let's look at a few examples here. Much like a set, the order in which you list the elements does not matter. But unlike a set, the number of times you list the element does make a difference. Consider the multi-sets, one, three, two, two, and the multi-set, one, three, two. These are actually considered distinct multi-sets because when you look at the element two, the multiplicity of two in the first one is two, but the multiplicity of two in the second one is one. In both cases, the multiplicities of one and three are one. But because two shows up with a different multiplicity with a different frequency in the first multi-set compared to the second one, we actually do consider those separate multi-sets. This also leads to the idea of cardinality. What is the cardinality of a multi-set? With a multi-set, we actually count all of the elements with their multiplicities. So when you consider this first multi-set right here, its cardinality would be four elements. The element two is counted twice because its multiplicity is there. You can actually think of the cardinality of a multi-set as the sum of all of the multiplicities of the individual elements there. Conversely, the other multi-set, one, three, two, it has a cardinality of three because each element, there's three elements and each element shows up with a multiplicity of one. So one plus one plus one is three. As opposed to this one, you have one plus one plus two is equal to four. So they have different cardinalities which further suggests that they're not equal as multi-sets. But even if they have the same cardinality with the same elements, if the multiplicities are different, that makes them different multi-sets. But like sets, multi-sets are not ordered. The order or arrangement of the elements does not make a difference. So if you consider these three multi-sets, one, three, two, two, one, two, two, three, and one, two, three, two, these are all the same multi-set. They agree with this one up here because they have three distinct elements, one, two, and three. One shows up once, two shows up twice, three shows up once, and that then describes the multi-set. You could think of this multi-set as the multi-set of roots of a polynomial. You take the polynomial x minus one, x minus two squared, x minus three. Its multi-set of roots would be this one because two shows up twice. That is a distinguishable aspect of this multi-set. Now, from the perspective of common torques, we're introducing these multi-sets with a very important goal in mind here. We want to count how many multi-sets can we get here. And let's imagine we have the set x equals a, b, c, d, e. So it's just a set that contains five elements. We've already considered the problem of how many subsets can we form, say, of size three? And so as we introduce the binomial coefficients beforehand, we saw that the number of subsets of a set of size five, for which the subsets will be a size three, that's gonna be this binomial coefficient five, choose three, for which you can compute that and see that that's equal to 10, okay? So counting subsets comes down to counting these binomial coefficients. And therefore, with this set of five elements, I've now listed exactly the 10 subsets of size three. You have a, b, c, a, b, d, a, b, e, a, c, d, a, c, e, a, d, e, b, c, d, b, c, e, b, d, e, and c, d. Hopefully I said all those correctly. You have exactly the 10 subsets we see there. Now, what if we change the problem and ask not how many subsets do we have, but how many multi-sets could we have? Because after all, every set is itself a multi-set. Every set is just a multi-set where the multiplicities are all equal to one. And so as we construct multi-subsets from a multi-set or from a set, doesn't really matter, we could then ask how many are there? We can restrict the cardinality again to three, but because it's a multi-subset, we potentially could draw the same element more than once. So when it comes to counting the multi-subsets, it kind of doesn't actually matter what the multiplicities of the original elements are if we're allowed to draw with repetition. Of course, we could ask a different question about whether we draw from the multi-set up to the multiplicity. We could talk about that, but that then comes down to essentially this problem again because like we did with the multinomial coefficients, we could just pretend that indistinguishable elements are actually distinguishable. We could then count the number of subsets as if they're distinguishable and then we could forget the distinction using again multinomial coefficients like we did before. That's not the problem we're considering here. We're trying to consider how many multi-subsets can we draw with repetition from any set for which the number of times you repeat the element is unlimited. That is a different combinatorial problem. And it turns out, if you wanna ask how many multi-subsets of a set of size five can I make when the cardinality of the sub-multi-subsets is three, turns out there's gonna be 35 of those. So there's a lot more than the 10 we started off with. And that's because we get new things like AAA, AAB, AAC, AAD, AEE. Those are all similar multi-subsets that weren't above here because the element A was repeated. We also get things like ABB, ACC, BBC because the repetitions are now allowed. Now, of course, when there's no repetition whatsoever, this will coincide with one of the ones we saw before. The multi-subset ABC is there, ABD, ABE. All should sound fairly familiar, right? But you get 25 extra ones because repetitions now is possible. Now, I did also wanna mention at this moment that when one describes a multi-set, sometimes because of the repetition, sometimes you can abbreviate it using some type of superscript. So you might write something like A cubed and this won't be like A squared B where the superscript of the element is its multiplicity. How many times it shows up in the multi-set? It's not understood here to be an exponent. Like we're not taking A squared. Honestly, A squared might not even make sense. Who knows if there's any arithmetic defined here. This can make it a little bit easier to list things, especially when the multiplicities are kind of high. But with these smaller ones, we'll probably just list all of the elements because it's just, they're short. But again, when these multiplicities are rather large, you often use a superscript to abbreviate it so that you only write each element once, but then its multiplicity tells you how many will appear there. So 10 subsets of order three, but 35 multi-subsets of cardinality three here. That's a big difference. Are we able to count? Could we come up with a formula like we did with the binomial coefficients to count the number of multi-subsets we can draft from a fixed set? Because again, we're just gonna consider the set that we draw from, just a set, and we'll make it in elements. Because we're allowed to draw the same element multiple times without restriction, there's no reason to not think of this as just a set itself. Again, we're not gonna draw from a multi-set and to be restricted by the multiplicity. That's a problem we've actually already considered before. Or at least we could consider it using tools we've introduced. We have this novel problem where the set we're drawing from has n distinct objects, but we can draw from it with repetition. And so we're gonna let this symbol right here, so we're gonna call it the multi-choose. So like with a binomial coefficient, we say n choose k. So we're gonna read this element as n multi-choose k. And therefore, instead of counting subsets, it's gonna count multi-subsets for which the length of the multi-subset will be k. It's drawn from a set of size n. And we wanna know how many multi-subsets, how many unordered lists with repetition can we create from x under these constraints so that we get this multi-choose element. We make it look like a binomial coefficient because it's sort of the same problem. We're gonna put two parenthesis here to suggest that repetition could happen there. But again, like we said earlier with multi-sets, it turns out this symbol is not universally used. And why is that? It turns out that in about two seconds, we're gonna prove that this n multi-choose k can actually be computed using binomial coefficients. So we actually don't need necessarily a new symbol, the binomial coefficients, or you're counting them. But that takes a little bit of an argument here. So here's our main result for this video here. Let n and k be, well, we could make them be non-negative integers. It turns out, I'm sorry, non-negative integers is just natural numbers. Yeah, that's exactly what we want here. We want zeros included inside of this as well. It doesn't have to be a positive number. It turns out that this n multi-choose k is the same thing as n plus k minus one choose k. So like the n and the k kind of make sense, but you're gonna get some bigger numbers in there as well. Why is that? Well, we'll see that in just a second, but let's consider five multi-choose, by this formula, this should equal five plus three minus one choose three, for which simplifying the top there, you get five plus three, which is eight minus one, which is seven. So we have seven choose three. Five multi-choose three, I claim, is the same thing as seven choose three. And for which case, if we go with the formula on this, you're gonna get seven times six times five over three factorial. The three factorial cancels with the six and you end up with seven times five, which is 35, which we saw before. So, okay, in that instance, the formula seems to work. That's not itself a proof. It could be a coincidence, but it does give us some support that likely what we're counting is correct. Now, in order to prove this, what we're gonna do is we're gonna actually come up with two different ways of counting this same object and argue that if we counted the same thing twice in two different ways, the two formulas have to actually agree with each other. And so what we're gonna do is we're going to consider binary list, which consists of n minus one bars and k many stars. So an example of that would be something like the following. Star, star, star, bar, star, bar, star, star, bar, bar, star. That's so easy to read out loud, of course. And so this will be an example where you have one, two, three, four, four bars. So four, of course, is three, sorry, five minus one, okay? And then the number of stars we have is k. So you have one, two, three, four, five, six, seven. So you have seven stars and four bars, okay? Now the k does not have to be smaller than the n. When it comes to multi-choose, because you can actually draft the same element more than once, k could be arbitrarily large, much, much bigger than n. It's not bounded above like it was with the binomial coefficients. So we wanna count these types of star, bar sequences where the number of stars and bars is restricted to a specific amount, but they show up in any arrangement. The order does matter. So if you were to swap a star and a bar, that gives us a different string. So this is a string with a fixed number of bars and a fixed number of stars, okay? So I claim that counting the number of stars is the same thing as counting multi-subsets. I also claim that it's the same as counting subsets. That is the binomial coefficient will come into play as well. So let's take a look at those two problems individually. So these strings can actually be identified with a multi-subset of the set x, where x, like before, has cardinality n and the multi-subsets we are choosing are each gonna have length k. All right, and so how does one of these star, bar, sequences coincide with anything, all right? So the first thing we're gonna do is we're gonna order the elements of x. It doesn't matter how you do that, but you're gonna order something, you're gonna order the elements of x. So we're gonna, you look at the example we had before, so you have like an a, b, c, d, e. So now they're ordered, okay? And let's say we want to construct a multi-set. So you might take something like a, a, and then we'll do a, d, something like this, okay? A, a, d, how does that read? So the first thing you're gonna do is then the number of stars to the left of the first bar is gonna be the multiplicity of the first element. In this case, it would be an a. Then the number of stars to the left of the second bar, but between the third bar is gonna be the multiplicity of the second element. You're gonna keep on going. Basically what you wanna think of is these bars are some types of like partitions that separate things. We're making some buckets. So here's the first bucket right here. Here's my second bucket, my third bucket, the fourth bucket's empty, and then the fifth bucket. That's why we have n minus one many bars because we only need four bars to separate into five buckets. So when you look at this one right here, we have two elements in a. So we're gonna get star, star. Then we get a bar. There's no b's, so we leave that empty. There's no c's, so we leave that empty. There is a d, so we get a bar. And then we, sorry, put a star. Then we put another bar and there's no e's over here. So this, this multi subset of three elements taken from a set of five elements can then be written as a star bar sequence like so, okay? And let me give you a few more examples here. If we are drafting from the set one, two, three, four, five, maybe we're interested in the multi subset one, one, one, two, three, three, five. In which case we write that as a star bar sequence in the following way. So we have three stars in the first bucket. So it says we have three ones. We have one star in the second bucket, so that's one, two. We have two threes in the third bucket, so that gives us two threes. We have nothing in the fourth bucket and we have one in the fifth bucket. Hence the multiplicities agree with that. Let's now consider some subsets only, some sets only can take three elements, one, two, three. We could look at the multi subset one, one, two. So we have two elements in the first bucket, one element in the second bucket, nothing in the third bucket. If we take the multi subset one, two, three, then we get one star in each of the three buckets. We could also do two, two, two, for which we get three stars in the middle bucket and nothing in the others. And so in this manner, we can see that we can write every, we can encode every multi subset as a star bar sequence. And then conversely, if I have a star bar sequence, I can then decode what was the multi subset. You know, up to the ordering here. Like, I mean, I might not be able to tell the difference between one, two, three, four, five and A, B, C, D, E, right? But you can still tell it's okay, I want three of the first element, one of the second, two of the third, none of the fourth, one of the fifth. You can do that with this encoding process. So these binary strings are in one-to-one correspondence with multi subsets, and therefore, the symbol M multi-choose K counts the number of binary star bar sequences, strings that we can form. So that gives us the first count. Counting these binary strings does in fact get us the end multi-choose K. But conversely, when you look at such a bar star sequence right here, could we not also think of this as, since it's a binary sequence, could we not also think of this as a combination of some kind? We could think of it as, we have a bunch of stars, which we know the number. We have a bunch of bars, which we have the number. But what has to be decided is where do the bars go? You could also ask, where do the stars go? It's the same problem. But as we're feeling like, when we're feeling our positions, you know, we have so many bars that we have to choose. And it's like, okay, I wanna put a bar in the second position, I wanna put a bar in the fifth position, and I'm gonna put a bar in the sixth position, and then therefore everything else is filled in with a star. So it's like, oh, I picked the second spot, the fifth spot, and the sixth spot. So when you create one of these bar star strings, you have to choose where do the N minus one bars go? Or you could also ask, you could make the same decision, where do the K-mini, where do the K-mini stars go? You make that choice. And that's exactly what a binomial coefficient counts. You then are choosing the positions of the stars. You're choosing the positions of the bars. Again, choosing where the bars go forces the stars, and thus choosing the stars are the bars doesn't make any bit of a difference whatsoever. And so if you're choosing where the stars have to go, then you choose that the K-stars are gonna go into, well, how many spots do you have? Well, you have K-mini stars, but you also have N minus one minibars. So this would then be N plus K minus one, choose K. Which again, if you're more like, I wanna choose where the bars go, that's the same thing as N plus K minus one, choose N minus one, because N minus one plus K gives us N plus K minus one. So these star bar sequences, I can count using binomial coefficients. That's this number right here. But also this multi-choose coefficient counts the number of star bar sequences. Since they're counting the exact same thing, the number of such binary sequences, they have to actually be equal to each other. And so therefore we can use this formula to solve problems about multi-subsets. Let's consider such an example in this video. Imagine that an office assistant is distributing supplies. In how many ways could this assistant distribute 18 identical folders among four office employees? And for the sake of example, we'll call them Audrey, Bart, Cecilia, and Darren. Okay, so we have 18, 18 folders that have to be distributed. Well, because there are 18 folders and four employees, and these folders are indistinguishable from each other, this turns out to be a multi-choose problem for which we have N, which is the number of people that we're gonna distribute amongst. There's four people there. But then these 18 folders are the things we're gonna distribute. So 18 is K in this situation. And therefore, since someone can get the same, they can get more than one folder here. Repetition is allowed here. You can think like, okay, as you construct a multi-list, your multi-set is something like, you give like A, A, A, A, and then we'll do some B, B, B, B, right? Every multi-subset you can draft from the set, A, B, C, it is convenient that all of their names start with a different letter, right? You can think of that distribution of the folders is choosing a multi-subset of this set. And that every time A shows up, that represents a folder that Audrey's gonna get. So if Audrey shows up in the multi-set 12 times, that means she's gonna get 12 folders. And if Bart shows up, say, two times, that means he gets two folders. And so a distribution of the folders is a multi-subset. And as there are four elements in the set, and we have to draw from the set 18 times, we're looking to count four multi-choose 18. But like we saw in the previous slide, this is equal to four plus 18 minus one, choose 18, like so, for which we can simplify that. Four plus 18 minus one is 21, we choose 18. And then I should mention that 21, choose 18 is also the same thing as 21, choose three. Where the significance of three is three is four minus one. We had four people, minus one, you get the three right there. However you go about doing it, we can calculate this thing. You end up with 21 times 20 times 19 over three times two. And that will then simplify to be 1,330 possible ways you could distribute the 18 folders among the four people here. But I should mention that some of those distributions will be like you give all 18 folders to Darren, Audrey, Bart, and Cecilia don't get any. But you could also give like nine of them to Bart and nine of them to Cecilia, Audrey, and Darren don't get any as well. So you might wanna change it as like, okay, suppose we have the restriction that everyone gets at least one folder. Maybe we wanna make some equity claim. Everyone needs at least one folder, right? And so that's a pretty easy thing to deal with. We start off with 18 folders, but if Audrey gets one and Bart gets one and Cecilia gets one and Darren gets one, basically it's like, okay, before we do any distributions, we're gonna give everyone a folder. So we're gonna subtract one. So we're actually at 14. And so that changes our K value. So four of the folders have an automatic distribution. They have to go to the four employees. But the remaining 14, we have options. And therefore, the way we can distribute the 18 folders so that everyone gets at least one is that we can freely move around the other 14 that have no assignment. So this will be four multi-choose 14 this time, which of course is the same thing as four plus 14, minus one choose 14, like so. You're gonna of course get four plus 14, minus one, which is 17, 17 choose 14. Again, this is the same thing as 17 choose three. Even though this number changes, this one didn't because we still have four people to distribute among. And so then you're gonna get 17 times 16 times 15 divided by three times two. And then simplifying that, you're gonna end up with 680, which is, it's about half of what we did before. And so half of those previous distributions we could argue were kind of mean because some people didn't even get a single folder, right? But at the same time, this distribution only guarantees that everyone gets one folder. What if we're like, oh, Audrey needs two, at least two. Bart needs at least three. Cecilia needs one. And Dara needs at least five. We could just attract all of those from the 18s, like, okay, those are allocated already. How many do we have left over? We can then multi-choose the rest of them to then count these distributions. So we can work within any restrictions that we want here. Like, let's suppose we weaken the condition. Suppose only Audrey and Cecilia are guaranteed a folder. Well, in that situation, Bart and Darren are maybe not get one. Well, that just changes our K value again. We take 18 minus two, which gives us 16. And so then the number of distributions of folders would then be four multi-choose 16, which is the same thing as four plus 16 minus one, choose 16, like so, for which this is gonna look like 19 choose 16, or if you prefer 19 choose three. So we get 19 times 18 times 17 over three times two, which that simplifies to be 969 possible folders. So much larger than this one, but smaller than the 1300 figure we had before. And that's because only two of the folders were allocated before the distribution happens after that. And so this multi-choose coefficient is very useful when you're trying to count these multi-sets. But remember, you can always count multi-sets using actually binomial coefficients, which is somewhat interesting because these things count subsets, but it's a very valuable tool on many combinatorial problems.