排列是一组中对象的集合或组合,其中所选对象的顺序或排列确实很重要。换句话说,排列是对象按确定顺序的排列。因此,在深入研究置换之前,让我们先对阶乘进行简要讨论。
阶乘
- 自然数n的阶乘由符号n!表示。
- n!是从1到n(包括1和n)的所有自然数的乘积。
即n×(n-1)×(n-2)×(n-3)。 。 。 ×1
例子:
If n = 3
3! = 3 × 2 × 1 = 6
If n = 5
5! = 5 × 4 × 3 × 2 × 1 = 120
If n = 1
1! = 1
Note: The factorial of 0 is defined as 1 by convention i.e. 0! = 1
为什么要使用阶乘?
阶乘的主要用途是计算排列的数量(排列某些对象的方式的数量)。让我们通过示例来理解这一点。
例子
问题1.一个班级只有3个职位空缺。三个人P,A和R同时到达。在这3个空位上,P,A和R可以通过几种方式排列?
解决方案:
For the very first seat, we have 3 choices i.e. P, A and R.
Let us randomly select A for the first seat.
For the second seat, we have 2 choices i.e. P and R
Let us randomly select R for the second seat.
For the third seat, we have 1 choice i.e. P
To summarize, we did the following:
Placed a person on seat 1 and placed a person on seat 2 and placed a person on seat 3.
Usage of and comes from the fact that occupation of all 3 seats was mandatory.
In mathematics, and is related with multiplication, hence we can say that total choices = 3 × 2 × 1 = 3!
If we change the seating order to P on the first seat, A on the second seat, and R on the third, does that change the total number of choices?
No, it does not. This is because equal importance is given to all three P, A, and R.
问题2:如果其中2个人始终坐在一起,可以找到安排5个人的方式数量?
解决方案:
Let us consider the 2 people as a unit and the remaining 3
person as 3 separate units, So we have total 4 units.
The number of ways of arranging these 4 units is 4!
(just the way we proved in previous problem)
The number of ways of arranging the 2 person amongst themselves is 2!
In conclusion, the number of ways of arranging the 4 units and 2 person amongst themselves is 4! × 2!
问题3.找到以元音开头和结尾的所有三个字母的单词。鉴于不允许重复字母。
解决方案:
Total vowels in english = 7 ( a, e, i, o, u, y, w)
Total consonants in english = 26 – 7 = 19
1.The choices for the first letter are 7
2.The choices for the third letter are 6
(since 1 vowel was placed as first letter)
3.The choices for the middle letter are 19 + (7 – 2) = 24
(19 consonants + the vowels which were not placed)
Hence total permutations are 7 × 6 × 24 = 1008
Do observe that here we first satisfied the vowel condition
for first and third letter and then placed the middle letter.
排列
- 如果有n个对象可用并且我们安排了所有对象,则每种可能的安排都称为置换。
- 如果在n个可用对象中,我们选择r并对其进行排列。然后,每种可能的排列都称为r –排列。
- 在排列中,对象的顺序很重要。
在置换中,我们主要处理四种问题
- 重复排列
- 排列无重复
- r –无需重复的排列
- 重复排列
重复排列
这是最简单的。在此类问题中,对象可能会重复。让我们通过一些例子来理解这些问题。
例子
问题1.使用3、4、5和7可以形成多少个大于500的3位数字?
解决方案:
Since a three-digit number, greater than 500 will have either 5 or 7 at its hundredth place, we have 2 choices for this place.
There is no restriction on repetition of the digits, hence for the remaining 2 digits we have 4 choices each
So the total permutations are: 2 × 4 × 4 = 32
问题2.使用数字1、2、4、5和9可以形成1000到2000之间的偶数个数?
解决方案:
Since the number is supposed to be even, the digits at units place must either be 2 or 4 leaving us with 2 choices for the digit at units place.
The number is supposed to lie between 1000 and 2000, So the digits at thousand’s place must be 1, we thus have
1 choice for the digit at thousands place.
Rest of the 2 digits can be any one from 1, 2, 4, 5 and 9 i.e. 5 choices each
So the total permutations are: 2 × 5 × 5 × 1 = 50
排列无重复
在此类问题中,不允许重复对象。让我们通过一些例子来理解这些问题。
例子
问题1.用数字2、4、6和8可以无重复地形成3个可被3整除的3位数?
解决方案:
For a number to be divisible by 3, the sum of it digits must be divisible by 3
From the given set, various arrangements like 444 can be formed but since repetition isn’t allowed we won’t be considering them.
We are left with just 2 cases i.e. 2, 4, 6 and 4, 6, 8
The number of arrangements are 3! in each case
Hence the total number of permutations are: 3! + 3! = 12
问题2.如果不允许重复数字,可以使用0、3、5、7和9形成多少个可被5整除的4位数字?
解决方案:
For the number to be divisible by 5, the digit at units place must either be 0 or 5, hence we have 2 possibilities.
Case 1. The digit at units place is 0
There are 4 choices for 103 place (all numbers except 0)
There are 3 choices for the 102 place (1 got used up at 103 place)
There are 2 choices for the 101 place (1 got used up at 103 place and 1 at 102 place)
Hence the possible arrangements with 0 at units place are
4 × 3 × 2 = 24
Case 2. The digit at units place is 5
There are 3 choices for 103 place (all except 0 and 5)
There are 2 choices for 102 place (1 got used up at 103 place)
There is 1 choice for 101 place (1 got used up at 103 place and 1 at 102 place)
Hence the possible arrangements with 5 at units place are 3 × 2 × 1 = 6
Total arrangements = Number of arrangements in case 1 + Number of arrangements in case 2
= 24 + 6 = 30
r –无重复排列
这是当我们仅在n个对象中不重复地排列r个对象时。让我们通过一个例子来理解这一点。
例子。一家冰淇淋店有10种口味的冰淇淋。找到制备具有3种不同口味的冰淇淋蛋筒的方法有多少种?
解决方案:
Let us consider n = 10 (total number of flavors) and r = 3 (number of different flavors needed)
For first flavor we have 10 choices
For second flavor we have 10 – 1 choices
For third flavor we have 10 – 2 choices and this is same as (n – r + 1)
The numbers of arrangement would be: 10 × (10 – 1) × (10 – 3 + 1) = 720
From this we can generalize that, the number of ways of arranging r objects out of n different objects is:
n × (n – 1) . . . (n – r + 1) = nPr
置换公式( n P r )
From the previous example, we understood thatr
nPr = n × (n – 1) . . . (n – r + 1)
Multiplying and Dividing by (n – r)!
nPr = n × (n – 1) × (n – 2) × . . . × (n – r + 1) × (n – r)! / (n – r)!
nPr = n × (n – 1) × (n – 2) × . . . × (n – r + 1) × (n – r) × (n – r – 1) × . . . × 1 / (n – r)!
nPr = n! / (n – r)! where 0 ≤ r ≤ n
问题1.找到6 P 3 ?
解决方案:
As per the above formula:
6P3 = 6! / (3!) = 6 × 5 × 4 = 120
问题2。10名奥运会选手参加比赛。查找1日,2日和3第三名可能的不同安排?
解决方案:
We have to find different arrangements of 10 taken 3 at time.
Here n = 10
r = 3
10P3 = 10! / (7!) = 10 × 9 × 8 = 720
问题3.如果n P 2 = 12,求n?
解决方案:
nPr = n! / (n – r)!
nP2 = n! / (n – 2)!
= n × (n – 1) × (n – 2)! / (n – 2)!
= n × (n – 1)
= n2 – n
∴ n2 – n = 12
Solving the equation,
n2 – n – 12 = 0
n (n – 4) + 3 (n – 4) = 0
(n + 3) (n – 4) = 0
∴ n = -3 or n = 4
∵ n ≥ 0, n = 4
r –重复排列
可以认为这是将n个对象分布到r个盒子中,其中允许重复对象,并且任何盒子都可以容纳任意数量的对象。
The 1st box can hold n objects
The 2nd box can hold n objects
The 3rd box can hold n objects
. .
. .
. .
The rth box can hold n objects
Hence total number of arrangements are:
n × n × n . . . (r times)
= nr
问题1.一名警官每周3次访问犯罪现场进行调查。如果每天的访问次数没有限制,请问如何安排他的访问时间?
解决方案:
The number of ways to schedule first visit is 7 (any of the 7 days)
The number of ways to schedule second visit is 7 (any of the 7 days)
The number of ways to schedule third visit is 7 (any of the 7 days)
Hence, the number of ways to schedule first and second and third visit is 7 × 7 × 7 = 73 = 343
问题2.如果一个囚室中可以容纳任意数量的囚犯,可以将多少名囚犯放在4个牢房中?
解决方案:
The 1st prisoner can be sent to any of the 4 cells
The 2nd prisoner can be sent to any of the 4 cells
. .
. .
. .
The 6th prisoner can be sent to any of the 4 cells
The total arrangements are:
4 × 4 × 4 . . . (6 times) = 46
排列组合关系
Permutation |
Combination |
---|---|
A permutation is a way of arranging some objects. |
A Combination is a way of selecting objects. |
In permutation the order matters |
In Combination, the order does not matter |
The permutation of n objects taken r at a time is denoted by nPr |
The combination of n objects taken r at a time is denoted by nCr |
n P r和n C r之间的关系
We can understand nCr through the following analogy
Consider that we have n distinct boxes and r identical
balls. (n > r)
The task is to place all the r balls into boxes such that no
box contains more than 1 ball.
Had the balls been distinct, this was a problem of
r – permutation without repetition and then the
answer was nPr as discussed earlier.
But since all r objects are same, the r! ways of arranging them
can be considered as a single way.
To group all r! ways of arranging, we divide nPr by r!
nCr =
因此,n P r和n C r之间的关系为:
n C r =
例子
问题1.如果不允许重复字母,则可以在单词“ SATURDAY”中形成多少个4个字母的含意或无意的单词?
解决方案:
The word SATURDAY has 8 letters i.e. S, A, T, U, R, D, A, and Y
To form 4-letter words, we first have to select 4 letters from these 8 letters
The ways of selecting 4 letters from 8 letters disregarding the order is 8C4 .
After selection, there are 4! arrangements.
Hence, total number of words formed are: 8C4 × 4!
Note:
Selecting r objects out of n objects and then arranging them is same as r-permutation of n objects.
So the above result can be directly obtained using nPr formula where n = 8 and r = 4
问题2.考虑到选择每种颜色必须有2个球,找到从4个红色,6个蓝色和5个白色中选择6个球的方法的数目吗?
解决方案:
We need to select 2 balls each of color red, blue and white as per the given condition.
The number of ways of selecting 2 red balls is 4C2
The number of ways of selecting 2 blue balls is 6C2
The number of ways of selecting 2 white balls is 5C2
Hence, the total ways of selection are 4C2 × 6C2 × 5C2 = 900