 Welcome to Episode 37 of Math 1050, College Algebra. I'm Dennis Allison. Today, we're going to be talking about counting principles. Let's go to our list of objectives. Basically, there are three types of problems that we'll be considering today. And they're all basically related to the very first item, and that is the fundamental counting principle. Here's an example of a question that we could answer with the fundamental counting principle. And that is, in how many ways can you answer a true-false test if you know the number of questions? For example, if there were 10 questions on the test, how many ways could you answer it? Then we'll look at permutations, which is related to the fundamental counting principle, and a question that pertains to that might be, in how many ways can the San Francisco giants arrange their batting order by position? So we'll talk about that in a moment. And then finally, we'll look at combinations. And the question there is, how many five-card poker hands are possible using an ordinary deck of cards? OK, well, let's go to the next graphic, and we'll look at sort of an introduction to the fundamental counting principle. Here's sort of an outline of my studio dressing room wardrobe. I have a number of stylish frocks. I have a lumberjack plaid shirt. I have my paisley print. I have my blue on white polka dot shirt. And then, of course, I have this shirt that I'm wearing today that they've provided me. Then I also have a choice of celebrity trousers. I could have wear my checkered dungarees, or my Greco-Roman loincloth. You remember the day I wore that back? I forget the episode. Or I could wear my black cap and gown. Or I could wear the clan Allison kilt. Yeah, I really like that one. Of course, I could wear the trousers that I'm wearing today. So the question is, with this assortment of dressing wear, how many, shall we say, ensembles could I put together choosing a frock and a pair of trousers? We'll call the black cap and gown a pair of trousers, although that would be a little much, wouldn't it? But for the sake of argument, we'll include that. OK, well, if we go back and look at that graphic one more time, I need to point out something. How many frocks do I have a choice of there? Looks like there are four, yeah. The lumberjack plaid, the paisley print, the polka dot, or, of course, the solid blue shirt. And how many pairs of trousers, sort of an extended idea of trousers, are there? Five. Looks like there are five, yeah, OK. So I'm wondering, how many ways can I put those together in one form or another? Well, now let's come to the greenboard and we'll look at that. So we have four, let's see, let me get a different marker. We have four choices for frocks, and we had five choices for trousers. Now, does anybody want to guess in how many ways you could combine one frock and one pair of trousers? 20 ways. OK, Jeff, now it looks like we've probably multiplied rather than added, for example. And as a matter of fact, that's what the fundamental accounting principle is all about. If you can do the first thing in four ways, that if I can choose a frock in four ways, and if I can choose a pair of trousers in five ways, then I can do one and then the other in that order 20 ways, four ways times five ways. Now, for example, when I go to my wardrobe closet and I choose a frock, well, there's one, two, three. There are actually four choices that I have there. And then with each one of those frocks, I have five pair of trousers. So I'll put five branches coming off of this one. And then there's not enough room to show up. But imagine that I put in five here, five here, and five here. So that'd be five and five and five and five 20. So the quick way to come up with an ensemble where you choose this frock and maybe this pair of trousers, the number of ways you come up with a pairing would be four times five. And that in a nutshell is the fundamental counting principle. So let's go to the next graphic and we'll see this spelled out in words. Okay, so the fundamental counting principle says that if two events occur in sequence and the first can occur in M ways and the second in N ways, then the two events can occur in succession in M times N ways. Okay, now with that principle behind us, let's look at an example of this. Let's go to the next graphic. In how many ways can you answer a 10 question true false exam if each question is answered? Okay, well, let's see. Let's see, 10, a 10 question test. So imagine that I put down 10 spaces here that represent our 10 answers. Now in each space, I can put either true or false. Let's see, let me move that down a little bit for you. I can either put true or false for each answer and I see that's not showing up. So let me try one with another marker here, true or false. Okay, so if these are my options for each of these answers, then I have two ways I can answer the first question. But I have two ways I can answer the second question and two ways I can answer the third question, et cetera, until I get to the very end. Now, if I multiply these together according to the fundamental counting principle, instead of just m times n, it'll be two times two times two, et cetera, this is gonna give me a product of two to the 10th power. And two to the 10th power is a little over 1,000. It's 1,024. So if you were guessing on a true false exam, there are actually 1,024 ways you can answer it. There's only one way you could guess all the answers correct. So we'll talk about probability in the next episode, but the probability of guessing and getting all the questions correct would be one in 1,024. We'll talk about probability some more in the next episode. Okay, I'll tell you what. Now, what if we change the question, the same question, and say what if you don't answer every question, what if you leave some blank? Of course, somebody might say, well, that'd be kind of foolish because at least you could guess and try to get the answer right. But if we include the option of leaving the answer blank, then there would be three possibilities on each question. And so the answer now for the number of possible ways we could take, we could answer the questions would be three to the 10th power, which is considerably more than 1,000. Okay, let's go to the next problem. Let's go to the next problem. Okay, in this problem, we have a hamburger chain that offers burgers that are so incredible that in addition to the patty, you have all of these choices. You can take lettuce, you could take tomato, you could have pickles, either sweet or dill, you could have bacon, onion, they offer three types of buns. There's the toasted, the sourdough, or the plain. There are three choices for dressings and the question is how many variations are possible? Now, we're gonna assume that you are choosing the hamburger patty, otherwise, I guess we couldn't call it a hamburger, but you do have choices in everything else. You could either take the lettuce or leave it, you could take the bacon addition or leave it off, et cetera. So we wanna figure out how many variations of a hamburger there are. Okay, so let's see. For lettuce, how many choices do we have for lettuce? I'm thinking either you could take lettuce or not. That'd be two choices. So I'll put down a two. Now, going down this column for tomato, you could either take tomato or not, so I'll multiply, whoops, by two again. For pickles, how many choices do we have for pickles? Three. Three choices, either sweet or dill, or? None. Or none. Or both. Yes, exactly, someone might say both, but I don't think anyone would take sweet and dill at the same time, so let's don't consider that as a reasonable option, although theoretically it's possible. So we'll say there are three options for pickles, either sweet or dill, or no pickles at all. Now, for bacon, let's see, we should multiply by two. Three types of buns, toasted sourdough or plain, and let's say you do want a bun, otherwise I don't think we could call it a hamburger. It would just be a pile of assorted ingredients. So we'll say multiply by three in that case. Choice of three dressings. So what number shall I multiply there? Three, four. Three, four, yeah, Jeff. Jeff, what are you thinking is the fourth option? No dressing. No dressing at all. Some people may not want dressing on their burger. And then you could either take onions or not onions, so that would be two. So I guess this comes down to multiplying two times two times three, times two times three, times four times two. Now you know if we simplify this a little bit, this is two to the fourth, times three squared, times four. Now you know four is actually two squared, so why don't we just put two more twos in here and call that two to the sixth. Two to the sixth times three squared. Does anybody know what two to the sixth is right off hand? What's two to the third? Eight. Eight, right, so what's two to the sixth? 64. 64, right, just be eight squared, right? This is two to the third times two to the third. So we have 64 times nine. And 64 times nine, let's see, that's gonna be 36, 576. So we have 576 options on how we could choose a hamburger. You know, you could go to this hamburger place every day for lunch, seven days a week, for about a year and a half before you'd have to choose the same selection twice. That's why the burgers are just so incredible at this hamburger joint. Okay, let's go to the next problem. How many license plates are possible in Utah? If the plate has three numbers followed by three letters. You know, on passenger cars in Utah currently, you have three digits followed by three letters. So how many plates are possible if you do that? Well, let's see, what principle do you think we'll use to solve this problem? What principle are we discussing here? Fundamental accounting principle. Fundamental accounting principle, of course. So I'm thinking that I should write down a series of numbers, and if the license plate contains three numbers followed by three letters, I guess I need a total of six blanks. And so how many choices do we have in the first? 10. 10 choices for the 10 digits, and then 10 choices here, and then 10 choices here. So that's gonna be 1,000 choices to fill in the first three digits. What would be the smallest three digit number you could put in here? 0000. 0000, and what's the biggest you could have? 999. 999, and how many integers are there, including 0000 up to 999? 1,000. That'd be 1,000, right, and that's 10 times 10 times 10. Okay, now we go to the alphabet, and it looks like we have 26 choices here. 26 choices here, and 26 choices here. Now, you know, actually, on license plates, they might restrict some letters from being used in a license plate. Can you think of a reason why? They're some letter. Yeah, like, I'm not sure that they actually use all 26 letters in a license plate. Why is that? Some are reserved, like, I guess, for special cases. Well, that could be, I'm not aware of that, but that could be reasonable. I know the government knew this certain combination. I'm thinking, what? Q and O look a lot of likes, it might be. Q and O look a lot of like, and Q and O look a lot like, what else? That looks like a zero, don't think? So, I think O might be eliminated, whereas Q might be, it seems like I've seen Q on license plates. Also, I'm thinking that I may not be used, because I may look like a one, but we're assuming that they're gonna use every possible letter, so I'm gonna use 26 times 26 times 26, and we'll leave it up to the state licensing bureau to decide whether they wanna eliminate a letter or not. So, to find out how many license plates are possible, our answer is gonna be 10 to the third times 26 to the third, which is, well, let's just see on our calculator how much that is. So, if we can zoom in here. Well, we know that 10 to the third is 1000, so I'll just go ahead and enter that, times 26 raised to the power of three, and that gives us 17,576,000. You notice there are three zeros on the end here, which makes sense, because we multiplied by a thousand, which has three zeros on the end. So, we know it's gonna be some multiple of a thousand, so it's 17,576,000. Let's see, 17,576,000. Now, you know, there aren't nearly that many people in the state of Utah, but do you think there are that many cars in Utah? Well, it's hard to say, but if you think about families that have several cars, if you think about all the businesses that have maybe a fleet of cars, then it's probably not likely they're gonna have this many vehicles that we need all those license plates, but before the state gets even close to using up all those license plate numbers, they'll resort to a different system for numbering the license plates. For example, in many states, what they do is they reverse the letters and the numbers. They put the letters first, and then the numbers second, and then you have this many license plates all over again. Let me just ask you a couple of questions about this. While I have these numbers here on the screen, let's look at some possibilities for changing license plates in the event that these are about to be used up. Which do you think would provide more new license plates? If I changed a digit into, excuse me, a digit into a letter, or a letter into a digit? A digit into a letter. Okay, and why do you think that would create more license plates? Let's say, just to make sure everybody understands the question before Stephen answers that, suppose your license number were 754ABC. And so the question is, if we change this digit into a letter, would we get more license plates than if we changed this letter into a digit? Which one would make more license plates? Stephen, what is your choice? I said, change the digit into a letter. Yeah, okay, would change this into a letter, okay? And what is your reasoning for that? Cause we'd be changing one of those, one of those numbers up there into 26, so it would be 10 squared now, time 26 to the power of four would be the total number. Right, so what we're doing is, we're training off a smaller factor for a bigger factor, so you're gonna get a bigger answer. So you're gonna get even more than 17 million and 500,000, whatever it was, something like that. Okay, of course now, if you were to change a letter into a digit, then you'd be changing a 26 into a 10, and you'd actually be decreasing the number of license plates that were possible in that case. Now you know what a lot of states have done is they've changed individual digits in the letter, so you may have a digit, or rather a letter, followed by two digits and then three letters, or you may put a letter in the middle, have a digit on either side, or you may have a letter in the third position. So in other words, there's a number of ways you can make variations of these license plates. Now, another question, what do you think would have a greater effect if we were to do as Stephen just suggested and change the digit into a letter, or as an option, what if we added an extra digit? So this one being the new position. So I now have the 10, the 10, the 10, 26, 26, 26, but I'm gonna add an extra digit in front. So now I have a four digit number followed by three letters. Which do you think here would make more possible license plates? The top one. Let's see, okay, now in the top case, we said that would be, well it was 10 cubed times 26 cubed, now it's gonna be 10 squared times 26 to the fourth, which is how much? Let's see, let's go to the calculator and work that one out. Now we have 10 squared times 26 to the fourth. 10 squared's a, whoops, let's see, let me clear that. 10 squared's 100, I'll go ahead and write that one down, times 26 raised to the fourth power, which is gonna be 45,697,600. Let's say that's gonna be around 45,700,000, okay? So 45,700,000. Now, while I have the calculator up here, let's go ahead and do the other case. What numbers would I enter if I actually added an extra digit in front? 10 to the fourth times 26 to the third. 10 to the fourth times 26 to the third, okay? Now 10 to the fourth is gonna be 10,000, let's just verify that, 10 raised to the fourth power. And then I'm gonna multiply that times 26 to the third. And you see now I have four zeros on the end of the number because I'm multiplying by 10 to the fourth or 10,000. And this is going to be 175,760,000. Well, there's no comparison. It looks like if you add the extra digit, you get 10 times as many license plates. But if you change the 10 to a 26, you're going to do a little bit more than double it. You're not gonna quite triple it because you've replaced 10 with a number that's not even the triple of 10. So we're gonna get many more license plates by adding an extra digit in that case. Okay, let's go to the next graphic. Okay, here's a problem that's more visual, I think. And it says on this first cube with the A and the B's located on it, suppose you want to travel from A to B along the edges of the cube shown to the right. What is the length of the shortest path? Well, let's see, what I say a unit cube, what I mean is that every edge there is one unit long, like maybe one foot long. So if I go from A to B, then I could travel, say, this way, this way, and then this way, how long would that path be? Three units. It'd be three units. Now another possibility is I could go this way and then I could go straight up and then I could go across the top and that's gonna be a length of three also. And in fact, I think if you even go back behind the cube, you can go, say, back this way, then you can go up and then you can go over. That would still be three. So I think every path along here is gonna be three units long. Now let me ask you a question. In how many ways can I travel from A to B? Well, you know, what this involves is making some sort of decision every time I travel along a unit length. In the beginning, how many options do I have? Two or three. Three, actually. Yeah, this would include the path going back behind that we, let me just kind of draw that in here that we haven't shown in the illustration. So, you know, we could go to the right. We could go up or we could go back behind. Now once I get to the next point, either here or here or back there, no matter which place I get to, how many choices do I have for my next move? Two. I have only two, yeah, because we're moving toward B. So, for example, if you're at this corner, you can go back or you can go up. If you're up at this corner, you can go to the right or you can go back. And if you're at this hidden corner back here, you can go to the right or you can go up. So when I get to the second stage, I have two choices. Now when I get to the third stage, let's see, actually this would be the end of the second stage, it looks like I have only one choice. I'm gonna go directly to B. Or if I get to here, I go directly to B. Or if I got to here, I go directly to B. So to sum that up, it looks like in the first position, I have three choices. In the second position, I have two choices. And in the third position, I have only one choice. And if I multiply those together, I get six. By the way, we have a symbol for this. What do we call three times two times one? Three factorial. Three factorial, yeah. So we have three factorial ways that we can go from A to B. And that ends up being a total of six choices. Okay, now here's the real problem. And that is, go to the second illustration over here, going from A to C. And the question is to find the number of options for the shortest path from A to C in the second illustration. So in how many ways can I go from A to C? If I assume I'm following the shortest path, now what I mean by that is you don't go over and up and then back down again and then back and then up. In other words, you would just be retracing your step. So you always want to be making progress to get towards C. Anyone have an idea how you can solve this problem? The number of ways you can get from A to C. Steven. Well, in the first cube, we're going to want to get to the place that was point B. So there's going to be six ways to get to there. Yeah, let me just write a B in right there. You see, these two cubes touch right there at that vertex. So as you leave one cube, you go on to the next cube. So you had six ways to go from A to B. And then there'll be six ways again to get from B to C. So it would be six times six. Six times six, yeah. So because we know there are six ways you can go from A to the four corner B and then do the same thing from B going to C. If I can do the first thing six ways, and I can do the second thing six ways, there are six times six or 36. Six times six are 36 ways that I can travel from A to C along the shortest path. By the way, how long would the shortest path be? If these are both unit cubes? Six. Yes, because you'd travel a distance of three on the first cube and then a distance of three on the second cube. Okay, well now let's introduce permutations. And let's do this by going to the next graphic. Now if I take a permutation of objects, what I mean is I'm gonna count the number of ways that I can rearrange the objects in some order. So in this graphic it says that a permutations on a set of members of a set of distinct objects is an ordering of those objects. And I wanna count the number of permutations of those in objects. Now what if I were taking them R at a time? That is I'm not using all of them but I'm using some subset of them. The number of permutations on n objects take an R at a time which is abbreviated as P of nR can be calculated using this formula right here. Now let me explain the formula where it comes from and we'll also illustrate what we mean by a permutation. Let's go to the green board. Okay, suppose I have five objects, let's say five books. So let's say here's a book, this is my math book, I'll put an M on top of it and then I have a history book, so I'll put an H on top of that and then let's say we have a psychology book, I'll put a P on top of it for psychology and then I have one more book that might be my English book, let's say, I'll put an E on top of that. So this is my set of objects and I wanna count the number of ways that I can arrange them. Well, if I'm gonna arrange them I would consider four blanks and I have four ways that I can fill in the first blank with one of those books and then I have three ways left that I can fill in the next blank because I've already used up one of the books here and then I have two ways I can fill in the next slot and then once I filled in those three there's only one book left, there's only one way I can fill in the last slot and this gives me four factorial or 24 ways that I can arrange those four books in order. Now, suppose I didn't wanna use all the books, suppose I was only gonna pick three of the books in how many ways could I arrange three books? Well, let's see, there would be only three blanks to fill in. One of these books is not gonna be used. How many ways could I choose one of those books to fill in the first space? Four. Four ways. And in how many ways could I fill in the second space? Three. Three and then two. Now there's one book left over that I haven't used here and this gives me 24 once again so there's still 24 ways that I can arrange three books out of four. Now the way I would describe this is I would say this is the number of permutations on four objects taken three at a time because I'm only using three books at a time. Okay, one more question. What if I was only gonna take two of those books and how many ways could I arrange two of those four books in order? Well, there are four ways that I could fill in the first space and there are three ways I could fill in the second space. The other two books are not gonna be used and this gives me 12 ways that I could arrange two books out of four. So I would call this the number of permutations on four objects taken two at a time. So here's what we have calculated symbolically. If I count the number of permutations on four objects taken four at a time we saw that that was four factorial or 24. If I count the number of ways of counting the permutations on four objects taken three at a time we saw that was four times three times two and that's also 24. And if I count the number of permutations on four objects taken two at a time that was only four times three and that's equal to 12 in that case. So you see how this notation goes, four represents the number of objects I have to choose from and r or the two in this case represents the number of objects that are actually being counted. Now, you know, in some textbooks they abbreviate this first one as p sub four four where this is the number of objects you have to choose from this is the number of objects you actually use and some books then would also write this one as p sub four three, four objects taken three at a time and of course this last one would be p sub four two. Now, you know, one case we didn't consider is what would be p sub four one or p of the ordered pair four one in how many ways can you arrange four objects when they're taken one at a time? Four? That'd be four, yeah, because it'd only be one blank to fill in that would be four in that case. Now, you know, there's a formula that will compute this and the formula goes as follows and this is the formula that you just saw in that graphic a moment ago and it says that if you wanna calculate p of n, r and of course this is assuming that n is greater than or equal to r and r is greater than or equal to zero then the formula says what you do is you take n factorial and you divide it by the difference factorial n minus r factorial. Now, you might say where in the world does that come from? Well, let's just take a look at how this comes about. Suppose that I had n books, not four, but n books and suppose I wanted to choose r of them to arrange in how many ways could I arrange n objects when they're taken r at a time? Well, in this case I would have to write down r blanks because those are the r spaces that I'll need to fill in so I have r spaces and I have n books to choose from so that means I could fill in the first slot with one of n books. How many books would be left over for the second slot? N minus one. N minus one, yep. How many books would be left over for this slot? N minus two. N minus two, yeah. Now, you notice the number that you're subtracting off is not quite the position number. I didn't subtract off three, I subtracted off two. So I'm subtracting off one less than the position number and that's because in the very first position I subtracted off zero. So I started subtracting zero, then I subtracted one, then I subtracted two. And the next one, of course, would be n minus three. Now, when I get down here to the rth space, if that makes sense, the space number r, then I'll be subtracting not r, I'll be subtracting r minus one. Or if I distribute that negative sign, that'll be n minus r plus one. So if I wanna calculate in how many ways I can fill in r spaces from n objects, I'll need to multiply those together. So I guess what this tells me is that p of nr should be n times n minus one times n minus two and that just keeps on going until I get to this last space n minus the quantity r minus one. Or if you prefer n minus r plus one. So I'll need to multiply those together. Now, you know, that looks like a very messy calculation. I have to multiply those all out. So I tell you what I'm gonna do. I'm gonna go ahead and fill in all of the remaining numbers so that this goes all the way down to one. I'm gonna take n, n minus one, n minus two. And then when I get to this number, n minus r minus one. And then the next number that I'll subtract off, you notice these are going up, minus one, minus two. So the next number that I would put here would be n minus r. That would be the next number that goes up after r minus one. And I'll keep going until finally I come to a one because these differences are decreasing and so eventually I'll get to a one. Now, I'll have to divide by any new factors that I've just included. Well, the factors that I have here are the same as the factors that I started with, but these are the new factors. That's n minus r all the way down to one. Well, you know, this is n minus r factorial that's on the bottom. And what is this on top? n factorial? That's n factorial. And look, that's our formula right there. n factorial over n minus r factorial. So what I've done is I've included extra factors so that I get a factorial on top, but that meant I had to divide by those same extra factors and this is n minus r factorial on the bottom. Hence, we have our formula. Okay, now let's just try our formula in verifying that problem about four books taken four or three or two at a time. So let's just verify our formula for those same numbers that we just looked at. Let's see, we had p of four, four. Now you remember that was where we had four books and we're choosing them four at a time. So this would be four factorial over the difference factorial. That would be four minus four factorial. Our four factorial over zero factorial. Our four factorial over, let's see, what is zero factorial? Yeah, you remember, just by definition, we say zero factorial is one and so this gives me four factorial or 24 ways of arranging four books taken four at a time. If I take p of four, three, this would be four factorial over the difference factorial and that's four factorial over one again, our four factorial, which is 24 and you remember that was the answer for four books chosen three at a time. Now, how many permutations are there on four books taken two at a time? Well, that'll be four factorial divided by the difference factorial, two factorial. And now rather than multiplying these numbers out individually, I would say let's write four times three times two times one over two times one. In other words, we can see that part of this cancels and there's my four times three or 12, just like we saw before. If you prefer to multiply out four factorial than two factorial, you can do two factorials too. You can certainly do that and you'll get the very same answer. Okay, let's go to the next graph you can look at another example. And how many ways can five books be arranged on a shelf? Well, in terms of permutations, this would be p of five, five or the other way to write it is to call it p sub five, five, that's the number of permutations on five objects taken five at a time and this would be five factorial divided by the difference factorial, zero factorial, which is five factorial. And you know, we just found out that four factorial was 24 and this just has an extra factor in it of five. This would be five times 24 and that's 120. So there are 120 ways of arranging five books. Okay, let's go to a different problem. Okay, so in this next problem, we'll see a problem that can be done two different ways. In how many ways can a class of 30 students elect a president, vice president, secretary and treasurer, assuming that no one student can hold two offices? Well, now one way to work this problem would be to use the fundamental accounting principle and to think of there being four spaces where we make a choice for president, for vice president, secretary and treasurer and there are 30 ways that we can elect a president. And then once that office is filled, there are 29 choices for vice president, 28 choices for secretary and then 27 choices for treasurer. So if I multiply these numbers together, we will get, well, let's see here, we will get, if we zoom in, 30 times 29, times 28, times 27. So there are gonna be 657,720. That's almost two thirds of a million. Let's write that down here, 657,720. Now the other way that we could work this problem would be to do it in terms of a permutation. So that would be P of 34. And that would be 30 factorial divided by the difference factorial, 26 factorial. Now we obviously wouldn't wanna write out all of these factors on top and bottom and cancel, but I think you can see that if you cancel 26 factorial out of 30, what will be left on top will be the 30, the 29, the 28, and the 27. We're 26 on down if canceled off. And you see that's exactly what I've written up above and multiplied together. So it seems reasonable then that this ratio is gonna be the same as that product right here. Now we've already computed that answer, but let me show you how to find this on a calculator. If I go to my TI-82, the way I'll calculate this is to enter 30. And then I'll go to the math button and let me just raise this up so you can see it. There's a button here that says math. If I push that and I scroll over to the right under PRB, that stands for probability, you notice there's on item number two it says NPR. That's the number of permutations on N objects taken R at a time. Now I'm gonna insert that right now after the 30. So if I insert that, I have 30, that's my value for N, and now I'll enter four for my value for R because remember there were 30 things taken four at a time. And if I push enter, I get 657, 720 exactly. Let's just go back to that screen one more time and you'll notice that under math, and if I scroll over to PR, I also have a factorial item here that I can choose. So if you wanna compute a factorial, if you go under the math button under the menu PRB, you can find your factorial that you could enter at that point. You know, on a lot of calculators, on simpler calculators than a graphing calculator, they'll have NPR and the factorial on the keyboard and you can actually access it directly on the keyboard. So you might look for that on your calculator if you have that available to you. Okay, so this answer turned out to be 657, 720 by this alternate approach. Okay, we have another permutation problem on the next graphic. In this case, it says six friends sit together in one row at a movie. In how many ways can they sit together? Well, in terms of permutations, that would be P of six people taken six at a time and how many ways can they be arranged? So when I multiply that out, that would be, let's say let's go to the green screen. That would be P of six, six, which is six factorial over zero factorial, or simply six factorial. You see, we have six ways the first person can be placed in a seat. Then we have five ways for the second person and then four and then three and then two and then one. So whether you think of it that way or using the formula, we get six factorial and if I'm not mistaken, that turns out to be 720 ways for six people to sit in the theater next to one another. Now, let's go back to that graphic and we'll look at another question that's asked. The next question says, in how many ways can they sit together if two of them insist on sitting side by side? You know, you've been to theater with that couple before. Yeah, they have to sit side by side. So anyone have a suggestion on how we can work that? See, we have six people at the theater. They're gonna sit in a row but two of them wanna sit next to each other. You could treat them as if they're one object and then the four others are a different object. So there's five people sitting in five. Yeah, I bet it's gonna be something about five factorial because if they have to sit together, we just kinda think of them as one group, as one person. And so we kinda think of this as being five people sitting in a row when really they're two next to each other. Okay, now on the green screen, this would say take P of five, five. However, there's one other issue we have to take care of in which order do those two sit? Like if the two people are John and Mary, does John sit on the right of Mary or does Mary sit on the right of John? We have to double it. We have to double it exactly. So we're gonna have to double this two times P of five, five. And this gives me two times five factorial over zero factorial, which is two times, let's see, five factorial is 120 and that's 240. Okay, so out of the 720 ways of seating these people, 240 of them have John and Mary sitting next to each other. Okay, but you know what happens? John and Mary have a falling out. Now let's go back to that last graphic. Now in the last part, it says what if two people refuse to sit side by side? So let's say John and Mary don't want any part of each other now. How many ways can they seat, can they be seated so that they're not sitting next to each other? Okay, we'll come back to the green screen. Okay, now let's go back to that graphic one more time and look at the last question. What if two people refuse to sit side by side? Now you see what if John and Mary have had a falling out and now rather than wanting to sit side by side, they refuse to sit side by side. In how many ways could that happen? Well, if you go to the green screen, it says that all together there were 720 ways that we could seat the six people. In 240 ways, they're sitting side by side. So now let me ask the class in how many ways are they not sitting side by side? 480. 480, yeah, it'd just be whatever's left over when I subtract those. So if we take 720 and subtract off 240, we have 480 ways in which the six people can be seated and these two particular people are not sitting side by side. Yeah, okay, well, let's go now to the next problem on the next graphic. Okay, in this problem, it says you are given five balls each of a different color. And then we have two questions. The first one is one that we've actually worked before, I think, or something very much like it, but the second one is a derivative of that. The first question says, in how many ways can these five balls be arranged? Now, if they're all of a different color, then we can distinguish each ball separately. And so there would be five objects taken five at a time and this would be P of five five, which is five factorial over zero factorial or five factorial. And that's 120 ways of arranging the balls. Okay, but now do you think there would be more or fewer possibilities if we change the condition to there being three red and two yellow? Do you think we'll have more possibilities than 120 or fewer? Fewer. There'll be fewer, yeah, because now if three are red, if I switch to red balls, we wouldn't know the difference. So it would be counted as the same arrangement. For example, if you had red, red, red, yellow, yellow and you switch two of the reds, it's still red, red, red, yellow, yellow. So we'd have to count that one twice. So what I need to do is to find out, within this 120, how many of them would I duplicate if I make three of them red? And in how many of these would I duplicate if I have two of them yellow? So I think what I'll need to do at this time is to take the total number of permutations, P of five five, and I'll need to divide out all of the ways in which the three balls can be rearranged because any rearrangement of the three red balls is gonna count as the same arrangement. And let's see, the number of permutations on three red balls taken three at a time is P of three three. Now what this is doing is counting out the number of ways the three red balls can be rearranged in their positions and I wanna count that only one time. And in the same way, there are two yellows. Now I could switch the two yellows and I wouldn't recognize any difference in one of the arrangements. So I'm gonna divide out P of two two. And this gives me five factorial over three factorial times two factorial. And this gives me, let's see, now if I cancel one of these out, I'm gonna cancel the larger factorial, the three factorial. That gives me five times four and I'm canceling the three, the two and the one, but I still have to divide by two factorial or two. And this gives me 10 ways of arranging three red balls and two yellow balls in some ordering. In fact, 10 is so small, let's see if we can actually write them down. If we just go to the green screen, let's try determining what are the 10 ways I could arrange three red and two yellow balls. So we have red, red, red, yellow, yellow. In fact, that's one of the arrangements of the five balls. Now if I count other arrangements, what I'll do is try moving this yellow one through the red so there could be a red, a red, a yellow, red and yellow. That's where I switch the yellow with this red. Now let's move that yellow over one more time. Red, yellow, red, red, yellow. And then let's move it one more time. Yellow, red, red, red and yellow. But you notice if I were to switch these two yellows right here, that would still be the same arrangements. That's why I divided by two factorial. And if I switch any two of the three reds right here, that would still be the same arrangement. That's why I divided by three factorial. Now you know what I've done is I've moved this y all the way through. Now let's move this second y all the way through. So I'm gonna switch that y right here and I get red, red, yellow, yellow, red. Okay, so I've switched it with this red. Now let's try switching it with this red. Red, yellow, red, yellow, red. So I switched it here. Now you know another possibility is I could switch the yellow with this red and that would be yellow, red, red, yellow, red. So I've switched it right there. So let's move the yellow into the second position, into the, actually that'd be the fourth position. Now let's try moving this second yellow into the third position. I could switch it right here and I would get red, yellow, yellow, red, red. Or I could switch it right here and that would be yellow, red, yellow, yellow, red, yellow, red, and red. Now is there any way I can get the second yellow into the second column? I think the only way to do it would be to switch it right here and that would be yellow, yellow, red, red, and red. Now how many orderings do I have here? Two, four, six, eight, 10. Those are the 10 orderings of three red and two yellow that we've actually listed. Now of course when the answer is only 10 it's not that difficult to write out all those arrangements. If the answer had been 120 we wouldn't want to approach it this way but for a small number like this we can work it out. Okay let's go to the next graphic and we'll conclude this by looking at combinations. Now in this case a combination of members of a set of distinct objects is a subset of the objects where the ordering is no longer important. And the number of combinations of n objects taken r to time will abbreviate as C in r and it's computed by the formula n factorial over r factorial times n minus r factorial. So you notice that the difference here is I have an extra factor in the denominator, r factorial as well as the difference factorial. And you notice we've seen this before this is the same thing as the binomial coefficient in r that we just discussed recently when we looked at the binomial theorem. Okay so the difference between combinations and permutations is we're no longer counting order we're only calculating the number of subsets that we could choose. So let's go to a problem where we could apply this. In how many ways can a class of 30 students select a committee of three to represent them? This assumes the order of the selection makes no difference. Now you know just a few moments ago we worked a problem where the class was electing officers and so of course the order in which we choose the people is important because the first person we pick we were assuming would be the president, the second person would be the vice president. This time we just wanna pick committees of three and in how many ways can we choose committees? So what we'll do is compute the number of combinations on 30 objects chosen three at a time. So these are the 30 students in the class who were choosing a committee of three people. And according to the formula this is 30 factorial over three factorial times the difference factorial that'll be 27 factorial. Okay well if I cancel off the 27 factorial I'll have 30 times 29 times 28 and I'll divide it by three factorial or three times two times one. Now you know I can cancel the three with the 30 to give me a 10. That'll be a 10, I'll put the 10 right over here. And I can cancel the two with the 28 and get a 14. So this ends up being 10 times 29 times 14. Now let's compute this on a calculator and then we'll look for a button that will allow us to compute combinations more quickly. Okay so we wanna multiply 10 times 29 times 14. And we get 4,060. So you remember when we were electing officers I still have that up here on the screen. We had almost two thirds of a million, 650, 657 ways we could elect four officers. Now we're selecting how many committees of three people could be chosen and look how much smaller it is. Of course we're only choosing three people but it's just over 4,000 or 4,060. Okay now here's an alternative to solving that problem. Suppose on the same screen here I'll show this. I'm gonna enter 30 and then I'm gonna go to my math menu. Let's see if you can scroll screen out or pull out just a little bit. I'm gonna go to the math button and I'm gonna scroll over under PRB probability and you see on the third line I have the number of combinations on N objects taken R at a time. Okay so I'm gonna enter that and we're looking at, whoops I must push the wrong button. Let me do that one again. I'm gonna enter 30, push the math button and I'm gonna enter number three and oh okay. So we have 30 objects and we're choosing these three at a time because we're choosing committees of three. Now if I enter that I get 4,060. Yeah just like we computed before. Okay now one of the things you may be wondering about is where the extra factor comes from in the denominator in our combinations formula. Well you know if you look at the number of permutations on N objects taken R at a time the formula was N factorial over N minus R factorial. This is where we were choosing R objects out of a total of N objects and counting all of those arrangements but you see within those R objects we have those R objects arranged in different orderings and if I'm choosing committees I only wanna count those once rather than all of the various rearrangement of those R objects. So when I go to calculate the number of combinations on N objects taken R at a time I'm gonna take the number of permutations and divide it by the number of ways those R objects can be arranged and the number of ways the R objects can be arranged as R factorial or another way to write this is P of R, R. So this ends up being N factorial divided by N minus R factorial divided by R factorial and that's the same thing if I invert and multiply as N factorial over R factorial times N minus R factorial and the purpose of this factor is to eliminate all the duplications of the various rearrangements of those R objects since the ordering makes no difference in combinations. Okay as our last example, let's look at how many ways that a five card poker hand can be dealt when using an ordinary deck of 52 cards. So you know in the game of poker you're dealt five cards and we're wondering in how many ways you could get five cards out of a deck of 52 cards. Now this is clearly a problem of combinations rather than permutations because we're not looking at the order you receive the cards just the cards that you receive once they've been dealt out and this would be the number of combinations on 52 objects taken five at a time. Now if I were to use the formula that would be 52 factorial divided by five factorial times the difference factorial. Now the difference here is 47 so that'll be 47 factorial and if I were to cancel off 47 factorial what would be left in the numerator? 52 times 51 times 50 times. Right. Times 50 times 49. Times 49. Times 48. Times 48 and that would be divided by five times four times three times two times one. Now of course we could actually multiply that out on a calculator but instead let's go to our menu and choose combinations from our math key. So let's see I'm gonna enter 52 and then under the math key I'll scroll over to probability and I'll select number three and enter that. Whoops, let's see why is there an error? Okay and that's gonna be chosen five at a time and when I enter that I get 2,598,960. In other words this is about 2.6 million. Roughly 2.6 million. So let's just put that down here as our answer. Approximately 2.6 million ways that you can receive your hand in poker. Well thank you very much. We'll see you next time for episode 38.