如果存钱罐里有 20 枚硬币,它可以包含多少种五分硬币、一角硬币和四分之一硬币的组合?
给定一定数量的元素,它们的不同排列,或者通过一个接一个地选择,或者其中一些,或者一次全部选择,称为排列。它们被视为将线性序列分配给给定序列的成员的过程。它也被称为对给定序列或系列的元素重新排序的过程。换句话说,排列一个序列意味着列出该序列的所有可能排列。例如,序列 {1, 2} 可以写成两种方式:{1, 2} 或 {2, 1}。
置换公式
在给定序列中的 n 个元素中排列 r 个元素时的排列数
nPr = n! / (n – r)!
例如,设 n = 5 和 r = 2。排列数为5 P 2 = 5! /(5 - 2)! = 20。
组合
它被定义为从给定序列中选择一个或两个或一些元素的过程,而不管元素的顺序如何。比如说,一个系列的两个元素要选择只有两个元素的元素,首先,这些元素的顺序无关紧要。
组合配方
从给定序列中的 n 个元素中选择 r 个元素时的组合数
nCr = n! / r! (n – r)!
例如,让 n = 5 和 r = 2,然后从 5 = 5 C 2 = 5 中选择 2 个元素的方法数! /2! (5 - 2)! = 10。
值得注意的一点是,如果要从具有 n 个元素的集合中导出 r 个组合,其中允许重复这些元素,则,
n+r−1Cr = n+r−1Cn−1.
假设存钱罐中有 20 枚硬币,求存钱罐包含五分硬币、硬币和 25 美分硬币的组合数。
解决方案:
Clearly order of the coins does not matter in this question. Also there is no mention as to whether repetition is allowed or not.
Following the rule, there are in case of r number of combinations from a sequence having n number of elements where elements can be repeated n+r−1Cr = n+r−1Cn−1, we have:
Number of combinations = 20+3-1C20 = 22C20
= 22! / (22 – 20)! 20!
= 11 × 21
= 231
类似问题
问题 1. 假设我们有 1 个三人间和 2 个双人间,请说出分配 7 名学生参加大学旅行的方法的数量。
解决方案:
This problem can be interpreted as having to put the 7 students into groups of 3, 2 and 2.
Number of ways to choose 3 students in the triple = 7C3 = 7! / 3!4! = 35
Number of ways to choose 2 out of the remaining 4 students = 4C2 = 4!/ 2!2! = 6
Number of ways to choose 2 students out of the remaining two students = 1
Total number of arrangements = 35 × 6 × 1 = 210.
Hence, 7 students can be assigned to 1 triple and 2 double hotel rooms during a conference in 210 ways.
问题 2:如果要从 7 名男性和 6 名女性中选出一个由 5 人组成的委员会,找出其中至少有 3 名男性参加的人数。
解决方案:
At least three men on the committee means we can have either exactly three, four or all five men in the committee.
Number of arrangements when there are 3 men and 2 women on the committee = (7C3 x 6C2) = 525
Number of arrangements when there are 4 men and 1 woman on the committee= (7C4 x 6C1) = 210
Number of arrangements when there are all 5 men on the committee = (7C5) = 21
Total arrangements = 525 + 210 + 21
= 756
问题 3. 找出元音总是一起出现的单词“LEADING”的字母排列数?
解决方案:
If the vowels are to appear together, they would form a separate letter in the word. Hence we are left with 4 + 1 = 5 letters, which can be arranged in 5! = 120 ways.
Furthermore, there are 3! = 6 ways to arrange the vowels together.
Total number of ways of arranging the letters = 120 x 6 = 720.
问题 4. 找出由 8 个辅音和 5 个元音组成的有 4 个辅音和 3 个元音的单词的数量。
解决方案:
Number of ways of selecting 4 consonants out of 8 and 3 vowels out of 5 = 8C4 x 5C3
=
= 70 × 10 = 700
Number of ways of arranging the 7 letters among themselves = 7! = 5040
Number of words that can be formed = 5040 × 700 = 3528000.
问题 5. 如果不允许重复,“GEEKSFORGEEKS”这个词可以组成多少个四个字母的词?
解决方案:
Since there are 7 different letters in the word ‘GEEKSFORGEEKS’
Required number of words = 7P4
= 7! / 3!
= 840