Now that we have a little bit of background in factorial, we want to move on to talking about permutations
and combinations.
We'll start here with permutations.
And the thing to remember about permutations is the word position.
So when you think permutations, think position or order or arrangement, in other words, order matters
or the position of the items matters.
Now, you might be wondering, we just talked about factorial and we said that a factorial represented
an arrangement.
So the question then becomes how are permutations different than factorial if factorial represent an
arrangement?
Well, if you remember before, when we talked about factorial, we did an example where we talked about
the playing cards.
We had a king, a queen and a jack.
We had three face cards.
And in the context of factorial, when we talk about the number of ways in which we can arrange these
three face cards, we have two limitations.
The first limitation is that we have to arrange all three cards in our set.
In other words, we have three face cards.
We have to arrange all three of them.
We didn't address what it would mean to have three face cards, but only want to arrange two of them
because as you can imagine, if we only want to arrange two of these, but we have three that we can
pick from.
We could look at all the arrangements with the King and the Queen, but we could also look at arrangements
with the queen and the jack.
Or we could look at arrangements with the king and the jack and the number of ways in which each of
those subsets can be arranged.
And when we talked about factorial, we also didn't address the possibility of repeats.
So when we had this king, Queen and Jack, we only imagined a scenario in which we could arrange one
king, one queen and one Jack.
But what if we have a whole deck of playing cards and we therefore have the possibility that we could
arrange one king, one queen and one Jack, or that we could keep repeating.
We could have king, king, king or Queen Jack Queen.
In other words, we can repeat a card and we still want to know the number of ways in which we can arrange
that set when the order of that set or the order of that arrangement still matters.
So now that we're introducing permutations, we're going to be able to address both of those things.
And what we're going to be working toward is filling out this table right here.
We're going to start by looking at permutations.
So we're going to start by working on this top row.
Then later on, we'll look at combinations and we'll fill in this bottom row.
And within each one of these rows, when we talk about permutations, when we talk about combinations,
we're going to talk about how to calculate the number of permutations or the number of combinations
when we can repeat items in the set versus when we can't repeat or when repeats aren't allowed.
So to start building out this table, let's go back to our King Queen Jack example from the Factorial
Lecture.
If you remember when we had three face cards and we wanted to arrange all three of them, we said that
the number of possible arrangements was going to be equal to three factorial because we had three items
in the set.
So in other words, given an items, the number of arrangements was in factorial.
And if you remember when we did that calculation, we said that the order mattered.
We said that the arrangement King Queen Jack, for example, was different than the arrangement.
KING Jack.
QUEEN So because the order mattered, when we calculated that in factorial value, we were actually
calculating a permutation.
In other words, in the last lecture, instead of saying that we were talking about factorial, we could
have said that we were talking about permutations.
We were just forcing the arrangement of the entire set instead of allowing for subsets of the arrangement.
When we allow for subsets, we use a different formula, and that formula is the one that we'll put
here.
It's n factorial divided by quantity, n minus k factorial.
And the idea here is that we have n number of items in our set and we're choosing K of them to make
permutations.
So for instance, if we start with one king, one queen, one Jack, we have this set of three items,
then in this case an equals three.
And let's say we want to determine the number of ways in which we can arrange just two of these cards
in that case.
K equals two.
So what we're doing is we're starting with this set of three.
We're picking just two of these three items so we could pick the king in the queen.
We could pick the queen in the jack or we could pick the king in the jack.
So we're picking two first, and then once we have our set of two, we're calculating the number of
permutations, the number of ways in which we can arrange that set of two.
So, for instance, if we picked the king and the queen, we know we could arrange that as king, then
queen or as queen, then king.
So of course, if we plug that into this formula here, we're going to get an equals three factorial
divided by RN, minus K or three minus two.
So three minus two factorial.
And the result here is three factorial over one factorial or three times two times one in the numerator
is six.
One factorial, of course is just one.
So we get six over one or six.
Now what happens if we start with this same set of three?
King, Queen and Jack.
But we only want to choose one of the cards.
In that case, N equals three and K equals one.
And so we would end up with three factorial divided by quantity, three minus one factorial or three
factorial over two factorial, in which case we get six divided by two or three.
And that should make sense because if we're only choosing one card from the set to a range at a time,
then we're either choosing the king and there's only one way to arrange that we're choosing the Queen,
and there's only one way to arrange just the single queen, or we're choosing the jack.
And there's only one way to arrange just that single jack.
So there's three ways to arrange.
There are three permutations.
If we start with a set of three and we just pick one item at a time or to pick an entirely different
example, if we're trying to figure out the number of ways in which we can seat five people around a
table, and in this case, maybe order really does matter to us.
Maybe we really do want the permutation because we care who sits next to who.
Well, look what happens if we arrange all five people using this formula because we want the number
of permutations.
Order matters to us.
We care who sits next to who.
But of course, we're dealing with people here so we can't repeat them.
We can't have the same person sitting in two different seats.
So we're looking at the number of permutations with no repeats.
We can use this formula.
If we want to arrange all five people around the table, then both N equals five and K equals five.
We have an equal to K and we would set that up as five factorial divided by quantity, five minus five
factorial or five factorial over zero factorial.
That denominator always goes to zero factorial when n is equal to K, we know that zero factorial is
equal to one, which means this simplifies to just five factorial.
And remember we said we had n equals five people.
So this is really just n factorial.
And we're back to this factorial idea.
Remember earlier we said that factorial were just like a permutation, except that we always used the
entire set.
Well here, that's just what we did.
We had five people and we wanted to arrange the entire set of all five of them instead of some subset,
like just three of the five people.
So with five people when we want to arrange all of them, but order matters.
So we're finding a permutation.
This denominator always simplifies to zero factorial we always get and factorial.
So when you think about five people and you want to arrange all of them, that's this formula here.
But you know, that's just going to simplify to RN factorial.
So in this case, we know five factorial is 120.
There are 120 ways to arrange five people around a table.
So that's how the idea of permutations and factorial are related to one another.
Let's just fill out this one last box here permutations where we allow for repeats.
So an easy example or an easy way to think about this is with phone numbers.
So let's say we want to figure out how many seven digit phone numbers we can make.
Well, if we use all the digits zero through nine.
So zero one, two, three, all the way up through nine, that's ten digits.
If we had started with one, we would have had nine digits.
One, two, three, four.
All the way up to nine is nine digits.
But when we add in the zero as a digit, this is ten digits.
And if we're allowing repeats and making a phone number with seven different digits, then think about
it this way.
When we pick the first digit, we can pick any one of these ten digits.
So we have ten possibilities for the first digit of the seven digit phone number.
So if we say one, two, three and then four, five, six, seven for our seven digit phone number,
we have ten possibilities here.
When we go to pick the second digit, of course, we're allowing repeats.
We can use the same digit again in the phone number.
So we again have ten possibilities and this is always the case.
We'll have ten possible.
Abilities for every digit in our seven digit phone number, which means that when we allow repeats,
the calculation we use is simply nn to the power of K, where n is the number of things we have to pick
from, in this case ten digits.
And K is the number of times that we're making that pick here.
We picked seven times because we had seven spots to fill to make a phone number.
So we're picking from ten things.
We're picking seven times, which means that in this phone number example, the number of phone numbers
we can build is given by ten to the seven, which is equal to 10 million.
So there are 10,000,007 digit phone numbers that we can make if we allow ourselves to use all ten digits,
zero through nine, and repeat them as many times as we want.
Meaning we can start with the phone number, 0000000 and go all the way up to the phone number 9999999.
But the order of the digits matters, which of course makes sense because the phone number, 1000000
is not the same as the phone number, 0100000.
The place where we put the one changes the phone number.
So order matters.
We're dealing with a permutation.
We have ten digits to pick from every time and we can make seven picks.
That calculation permutations with repeats aloud is end to the K where we pick from n items K number
of times.
So that's how we calculate permutations.
And in the next lecture we'll compare this to combinations and learn how to calculate combinations with
both repeats and no repeats.