Problems involving both permutations and combinations
On this lesson, we will focus on problems for all the past topics in combinatorics (meaning all this chapter in our statistics course), with an emphasis on both combinations and permutations. and so, we will just provide a little review in the first section (so you can have the proper formulas available to you) and then we will jump directly into example problems for you to practice.
Permutations and commutations
Remember that permutations are the different arrangements in which items from a list can be positioned side by side, thus paying attention in the order in which they are positioned; while combinations are the ways in which items from a set can be selected, meaning the combination of a particular quantity of objects from the whole set, no matter in which order they get arranged later. So, permutations and combinations have as a main difference, that permutations pays attention to the order of the items, while combinations do not.
The formula for permutations, also called the formula to calculate the number of arrangements of r items taken from a set of n distinct items (where the order in which the items are arranged matters), is:
Where:
= Permutations of items from a set of items
= number of total items in a set
= items being arranged
Remember that when all of the items in a set are used in the process of finding the total amount of possible arrangements (when you have the same amount of items as the amount of positions in which you will arrange them), the permutations formula simplifies and is equal to just the factorial of the number of the total items in the list.
Now, looking into combinations, the formula for combinations goes as follows:
Where:
= Combinations of items from a set of distinct items
= number of total distinct items in a set
= items selected from the set
Problems on permutations and combinations:
As we mentioned in the introduction for this lesson, we will not only use permutations or combinations on the next problems, we will make use of all of the concepts and processes we have studied in our combinatorics chapter of this statistics course. Still, the next problems are designed for you to work through a variety of these topics in the same problem, instead of each problem focusing in only one kind of process. So, lets get to work!
Example 1
From a standard deck of 52 cards, how many 5-card poker hands can be formed in each case:1. straight flush - 5 cards in sequence, all of the same suit, e.g. 6, 7, 8, 9, 10?
A straight flush is when you have 5 consecutive cards of the same suit (hearts, clubs, spades, or diamonds). In this case, the word straight in playing cards defines that the group of cards is following sequential order, and the word flush means all of these cards are from the same suit.
It is important to mention what each of the words define, because we will be looking at the straights for each suit, in order to find all of the possible straight flush hands that can be found.
With this being said, let us start by picking a suit: hearts. The lowest straight flush that can be found for a suit goes as A, 2, 3, 4 and 5.
While the highest straight flush possible goes as 10, J, Q, K A.
Therefore, the flushes that can be found from the heart suit go as follows:
![Problems involving both permutations and combinations](
https://dmn92m25mtw4z.cloudfront.net/img_set/stat-7-6-x-1-article/v1/stat-7-6-x-1-article-1255w.png)
As you can see, there are 10 possible straight flushes form the hearts suit, therefore, there are 10 possible flushes from each of the four possible suits.
Therefore, we have a total of 40 possible straight flushes in a deck of cards. This can be proved following the fundamental counting principle, where you multiply the possible events in each category to find the amount of different outcomes possible:
![Problems involving both permutations and combinations](
https://dmn92m25mtw4z.cloudfront.net/img_set/stat-7-6-x-2-article/v1/stat-7-6-x-2-article-1007w.png)
2. four of a kind?
On this question, four of a kind refers to having a group of 4 cards of the same rank, for example, four cards of a same rank would be the four different cards with the number 3: 3 of hearts, 3 of spades, 3 of diamonds and 3 of clubs. Another example of a set of cards belonging to the same rank could be the four kings: king of hearts, king of spades, king of diamonds or king of clubs.
So, let us find how many ways can we find a four of a kind in a 5-card hand drawn from a standard deck of cards:
![Problems involving both permutations and combinations](
https://dmn92m25mtw4z.cloudfront.net/img_set/stat-7-6-x-3-article/v1/stat-7-6-x-3-article-1291w.png)
Notice that out of 13 ranks, in order to contain a four of a kind, each hand of 5 cards must have cards of 2 different ranks: One of the ranks will be that of the four of a kind, while the fifth card not belonging to the four of a kind has the other rank.
Thus, the first thing to calculate is the total number of permutations possible to have four cards of the same rank, while having 2 out of 13 ranks in a hand: = 13 and = 2
Then, once you know the amount of permutations for the two ranks that can be on a hand, we notice that the order in which the cards are collected in a hand does not matter. Therefore, if we pay attention the cards that can be part of the 1st rank (or first selected rank) you have four possible cards in each of those positions, where the order of the cards does not matter; thus, for the first selected rank we can have the next possible combinations:
Taking into account = 4 and = 4 for this case, since you have four possible cards for four different positions.
The result in equation 4 makes sense! Because once you have selected a rank you have 4 cards, if you need them in four positions and do not care in which order (rule for combinations) then you will just have one possible combination!
For the second selected rank (from figure 3) this is not as easy, because once you select a rank, you only have ONE position. Therefore, to calculate the possible combinations you can have in there we have that = 4 and = 1, and so:
With the results coming from equations 3, 4 and 5 we can clearly see that there are three categories containing different events that one must take into account to obtain all of the possible ways a four of a kind can come up in a 5-card hand:
- The number of permutations for two out of thirteen ranks in one 5-card hand
- The possible combinations of cards in the first rank selected
- The possible combinations of cards in the second rank selected
We follow the fundamental counting principle and multiply the possibilities for each category in order to find our final result:
3. full house - 3 of a kind and a pair, e.g. 5, 5, 5, 8, 8?
A full house means we have 3 of a kind and a pair, thus, once more we have to select two ranks out of thirteen:
![Problems involving both permutations and combinations](
https://dmn92m25mtw4z.cloudfront.net/img_set/stat-7-6-x-3-article/v1/stat-7-6-x-3-article-1291w.png)
With this, we just follow the exact same method as before and define the three categories containing different events that one must take into account to obtain all of the possible ways a four of a kind can come up in a 5-card hand:
- The number of permutations for two out of thirteen ranks in one 5-card hand
- The possible combinations of cards in the first rank selected
- The possible combinations of cards in the second rank selected
And so we have that:
The first factor in equation 7 refers to the amount of permutations possible for two ranks to be selected in the hand out of the total thirteen; this is the same permutations we calculated in part 2. Then the two other factors refer to the combinations of total four cards in a rank and the 3 possible in the first rank selected, and the two possible in the second rank selected.
Therefore, the final result is:
So there are 3,744 ways in which we can obtain a full house hand!
4. flush - all 5 cards are of the same suit?
Remember the word flush means all of the cards are from the same suit. Notice that the order of the cards dont matter, we will have five cards out of 13 possible if they all belong to one same suit, therefore we we have the following:
- For each suit, the total amount of possible flushes are:
- There are 4 suits, therefore the total amount of flushes in the card deck is:
- The flushes we are talking about here are NOT straight flushes (calculated in part 1). Therefore we need to subtract those from the total amount of flushes in a deck to obtain the total number of pure flushes in the card deck.
With all of this being said, the total amount of pure flushes in the card deck is:
Example 2
There are a total of 50 numbers in a combination lock, which unlocks with a three number sequence.a) How many possible combinations (sequences) are there for this lock?
Notice that in this problem, we are asked to compute what people would usually call the combination for the lock, or how many combinations can the lock have; still, this problem is not talking about combinations as they are defined mathematically, this problem is asking to calculate the different permutations for the lock!
Why? Well, in order to find the lock combination you KNOW that this combination needs to have its contained numbers in a particular order or it wont open the lock, and since order matters, this means this is in reality a permutation of three numbers from the total set of 50 possible numbers.
Having said this, let us calculate all the possible PERMUTATIONS that a 50-number combination lock can have when is opened by a three number sequence.
We have that = 50 and = 3. Therefore:
And so, there are a total of 117,600 different ways that could serve as the lock code to be opened.
b) Now, a master thief says that he only needs to know the 3 numbers out of the total 50 that are required to unlock the lock, no need to know how they arranged, if he finds out which three are used, he could open this lock. How many possible combinations of three numbers are possible to be the password of this lock?
Remember, in this case we are looking for combinations, and so, we just need to find out the three numbers that are in there, but not how they are arranged. And so, we use the combinations formula having = 50 and = 3.
c) Do you think this thief could open the lock once he has found out the three numbers that are necessary, even if he doesnt know in which order they should go?
Yes, this could be easily done right? If you think about it, once the thief knows the exact three numbers required he is left with three numbers to be ordered in three positions, which means that the total possible arrangements of these three numbers, as learnt in our lesson on the factorial notation, is just equal to 3! = 6. And so, it sounds very simple to think the thief could just try and check for all the 6 ways individually until one of those opens.
The difficult part is to identify WHICH THREE-NUMBER COMBINATION TO USE OUT OF 19,600! (all possible combinations found in part b). Therefore, if he is bragging that he can open a lock when he knows already which three to use, then he doesnt really know how to open a lock (GOOD!).
We hope these examples were useful to you. See you in the next lesson!