使用数字 1、2、2、3、3、4、5 可以写出多少个不同的八位数字?
数字基本上是计数或测量。它是用于计数和测量物体以及进行算术计算的数学值。数字大致分为以下几类,
- 自然数
- 整数
- 整数
- 有理数
- 无理数
这里,重点类别是自然数和整数。
自然数
从 1 到无穷大的所有数字都称为自然数。示例:1、2、10、12
整数
所有自然数与数字 0 一起被称为整数。示例:0、1、2、10、12。每个自然数都是整数,但每个整数都不是自然数。谈到数字,从0到9的数字称为数字。每个数字,无论其类别如何,都是由数字组成的。
排列
排列被定义为可以排列特定集合的方式的数量,其中排列的顺序很重要。排列顺序是指元素在集合中的放置顺序。例如: [1, 2, 3] 和 [2, 1, 3] 是两个不同的排列。即使两个集合中的元素相同,但它们的排列顺序却不同。
置换公式
nPr = n!/(n – r)!
Where n = total items in the set
r = items taken for the permutation
“!” denotes factorial
上面给出了公式,但是关于排列的问题可以很容易地用逻辑来解决。通过逻辑解决更好,因为问题可能很棘手,有时,公式可能会使学生感到困惑。
使用数字 1、2、2、3、3、4、5 可以写出多少个不同的八位数字?
解决方案:
Let the eight-digit number be _ _ _ _ _ _ _ _
Now think, how many options are available for the first blank here? It can either be 1 or 2 or 3 or 4 or 5. Why wasn’t the number 2 or 3 considered twice? Because it’s the same digit, right? As mentioned multiple times, it’s PURE LOGIC.
5 options are available for the first blank and all the subsequent blanks as there is no restriction on the repetition of digits. As 5 options are available for every blank, multiply 5 eight times which means 5 to the power of 8.
Count of different 8 digit numbers = 58 = 5 × 5 × 5 × 5 5 × 5 × 5 × 5 = 390625
A question was asked at the beginning of the article. Why wasn’t the digit 0 considered for now? While generating numbers with digits including 0, the digit 0 has to be handled explicitly as it cannot be placed at the beginning of the number. Why? 1230 is a 4 digit number made using the digits 1, 2, 3, 0. Now, is 0123 a 4 digit number? No, it’s not because 0123 is equal to 123 which is a 3 digit number. Thus, the digit 0 can’t be considered at the beginning of a number and it needs to be handled explicitly.
类似问题
问题 1:给定一个集合 [1, 2, 3, 4, 5],生成所有可能的大小为 5 的子集。
解决方案:
Let the set be _ _ _ _ _
Now, find the number of ways to fill all the blanks such that each generated set is different. For the first blank, how many options are available? Either of the five numbers – 1 or 2 or 3 or 4 or 5 can be filled, thus 5 options.
Now, one of the five numbers is already filled in the first blank. So, for the second blank, (5 – 1) = 4 options are available for this blank. Similarly, for the 3rd blank, there are 3 options.
For the 4th blank, there are 2 options
For the 5th blank, there is 1 option.
So, total number of permutations = 5 × 4 × 3 × 2 × 1 = 5! = 120
问题 2:给定一个集合 [1, 2, 3, 4, 5],生成所有可能的大小为 3 的子集。
解决方案:
Let the set be _ _ _
Similar to the previous example, find the number of ways to fill all the blanks such that each generated set is different.
For the first blank, either of the five numbers – 1 or 2 or 3 or 4 or 5 can be filled, thus 5 options.
Now, one of the five numbers is already filled in the first blank.
So, for the second blank, (5 – 1) = 4 options are available for this blank.
Similarly, for the 3rd blank, there are 3 options.
So, total number of permutations = 5 × 4 × 3 = 60
问题 3:生成可以用数字 1、2、3、4、5 书写的所有不同的八位数字。
解决方案:
Let the eight-digit number be _ _ _ _ _ _ _ _
Now, find the number of ways to fill all the blanks such that each generated number is different. For the first blank, how many options are available? Either of the five numbers – 1 or 2 or 3 or 4 or 5 can be filled. So, 5 options are available.
As there is no restriction on the repetition of digits, the same 5 options are available for all the other blanks as well. Perform the calculation part now. As 5 options are available for every blank, multiply 5 eight times which means 5 to the power of 8.
Count of different 8 digit numbers = 58 = 5 × 5 × 5 × 5 × 5 × 5 × 5 × 5 = 390625