当前位置:网站首页>[combinatorics] permutation and combination (example of permutation and combination)
[combinatorics] permutation and combination (example of permutation and combination)
2022-07-03 12:06:00 【Programmer community】
List of articles
- One 、 Examples of permutations 1 ( Combine | product rule | The law of addition )
- Two 、 Examples of permutations 2
Reference blog :
- 【 Combinatorial mathematics 】 Basic counting principle ( The principle of addition | Multiplication principle )
- 【 Combinatorial mathematics 】 Examples of permutation and combination of sets ( array | Combine | Circular arrangement | binomial theorem )
- 【 Combinatorial mathematics 】 Permutation and combination ( Arrange and combine content summary | Select the question | Set arrangement | Set combination )
One 、 Examples of permutations 1 ( Combine | product rule | The law of addition )
The basic counting formula is The law of addition , product rule ;
from
1
1
1 ~
300
300
300 Take out at will
3
3
3 Number , So that the sum of these three numbers can be
3
3
3 to be divisible by , How many selection methods are there ?
Use classification ( product rule ) , Distribution ( The law of addition ) , Permutation and combination To solve the problem ;
Put the above
1
1
1 ~
300
300
300 Numbers , Divide by
3
3
3 The remainder of is divided into the following three categories :
- ① Divide
3
3
3 Remainder is
1
1
A
=
{
1
,
4
,
⋯
,
298
}
A = \{ 1, 4, \cdots , 298 \}
A={ 1,4,⋯,298}
1 :
- ② Divide
3
3
3 Remainder is
2
2
B
=
{
2
,
5
,
⋯
,
299
}
B = \{ 2, 5, \cdots , 299 \}
B={ 2,5,⋯,299}
2 :
- ③ Divide
3
3
3 Remainder is
0
0
C
=
{
3
,
6
,
⋯
,
300
}
C = \{ 3, 6, \cdots , 300\}
C={ 3,6,⋯,300}
0 :
Combination question :
stay
A
A
A Set any
3
3
3 Number , The sum of the three numbers must be
3
3
3 Multiple , Can times
3
3
3 to be divisible by ; The selection methods are
C
(
100
,
3
)
C(100, 3)
C(100,3) Kind of ;
stay
B
B
B Set any
3
3
3 Number , The sum of the three numbers must be
3
3
3 Multiple , Can times
3
3
3 to be divisible by ; The selection methods are
C
(
100
,
3
)
C(100, 3)
C(100,3) Kind of ;
stay
C
C
C Set any
3
3
3 Number , The sum of the three numbers must be
3
3
3 Multiple , Can times
3
3
3 to be divisible by ; The selection methods are
C
(
100
,
3
)
C(100, 3)
C(100,3) Kind of ;
product rule : stay
A
,
B
,
C
A,B,C
A,B,C Take a number from each set in , The sum of the three numbers is also
3
3
3 Multiple ,
- The first set takes
1
1
1 Number , Yes
100
100
100 To plant and take
- The second set takes
1
1
1 Number , Yes
100
100
100 To plant and take
- The third set takes
1
1
1 Number , Yes
100
100
100 To plant and take
All in all
10
0
3
100^3
1003 To plant and take ;
The final choice , Use the rule of addition :
3
C
(
100
,
3
)
+
10
0
3
=
1485100
3C(100, 3) + 100^3 = 1485100
3C(100,3)+1003=1485100
Two 、 Examples of permutations 2
1000
!
1000!
1000! At the end of
0
0
0 The number of ?
This value is calculated by multiplication , A very large , Basically impossible to calculate ;
List the factors : take
1000
!
1000!
1000! regard as
1000
×
999
×
998
×
⋯
×
2
×
1
1000 \times 999 \times 998 \times \cdots \times 2 \times 1
1000×999×998×⋯×2×1
Factor ;
Principle that : Among the above factors
1000
1000
1000 A factor , Will this
1000
1000
1000 Factorization , If there is
i
i
i individual
5
5
5 ,
j
j
j individual
2
2
2, be
i
i
i and
j
j
j The smaller value in
min
{
i
,
j
}
\min\{ i,j \}
min{ i,j} Namely
0
0
0 The number of ;
Above
1
1
1 ~
1000
1000
1000 this
1000
1000
1000 It is statistically decomposed from numbers
2
2
2 and
5
5
5 The number of
Statistics
2
2
2 The number of factors : Certainly more than 500 ;
- ① yes
2
2
2 The number of multiples of is
500
500
500 individual
- ② yes
4
4
4 The number of multiples of is
250
250
2
×
2
2\times2
2×2 , One of them
2
2
2 It has been counted before , Here we add
250
250
250 individual
2
2
2 , The current is
750
750
750 individual
2
2
2 ;
250 individual , Break it down
- ③ yes
16
16
16 The number of multiples of is
62
62
2
×
2
×
2
2\times2 \times 2
2×2×2 , Two of them
2
2
2 It has been counted before , Here we add
62
62
62 individual
2
2
2 , The current is
812
812
812 individual
2
2
2 ;
62 individual , Break it down
- ④ yes
32
32
32 The number of multiples of is
31
31
2
×
2
×
2
×
2
2\times2 \times 2\times 2
2×2×2×2 , Three of them
2
2
2 It has been counted before , Here we add
31
31
31 individual
2
2
2 , The current is
833
833
833 individual
2
2
2 ;
⋮
\vdots
⋮
31 individual , Break it down
Statistics
5
5
5 The number of factors :
249
249
249 individual ;
- ① yes
5
5
5 The number of multiples of is
200
200
1
1
1 A factor
5
5
5 The situation of , There must be some factors that can be decomposed into
25
,
125
,
625
25, 125, 625
25,125,625 , etc. , Next, gradually refine and peel out the factors without statistics ;
200 individual , Statistics
- ② yes
25
25
25 The number of multiples of is
40
40
5
×
5
5\times5
5×5 , One of them
5
5
5 It has been counted before , Here we add
40
40
40 individual
5
5
5 , The current is
240
240
240 individual
5
5
5 ;
40 individual , Break it down
- ③ yes
125
125
125 The number of multiples of is
8
8
5
×
5
×
5
5\times5 \times 5
5×5×5 , Two of them
5
5
5 It has been counted before , Here we add
8
8
8 individual
5
5
5 , The current is
248
248
248 individual
5
5
5 ;
8 individual , Break it down
- ④ yes
625
625
625 The number of multiples of is
1
1
5
×
5
×
5
×
5
5\times5 \times 5 \times 5
5×5×5×5 , Three of them
5
5
5 It has been counted before , Here we add
1
1
1 individual
5
5
5 , The current is
249
249
249 individual
5
5
5 ;
1 individual , Break it down
It's broken down into
2
2
2 The number of
i
i
i It must be greater than
500
500
500 Number of numbers ;
It's broken down into
5
5
5 The number of
j
j
j The value is
249
249
249 individual ;
therefore
1000
!
1000!
1000! At the end of
0
0
0 The number of yes
249
249
249 individual ;
边栏推荐
- 【mysql官方文档】死锁
- DEJA_ Vu3d - 054 of cesium feature set - simulate the whole process of rocket launch
- 在CoreOS下部署WordPress实例教程
- Laravel time zone timezone
- PHP export word method (phpword)
- Extrapolated scatter data
- Vulnhub narak
- Dart: about Libraries
- PHP export word method (one MHT)
- Symlink(): solution to protocol error in PHP artisan storage:link on win10
猜你喜欢

Why can't my MySQL container start

Shardingsphere sub database and sub table < 3 >

vulnhub之Ripper

Solve msvcp120d DLL and msvcr120d DLL missing

Qt OpenGL 纹理贴图

Quantitative calculation research

PHP導出word方法(一mht)
![[MySQL special] read lock and write lock](/img/ac/e01c26882cc664ea2e5e731c5a8bab.png)
[MySQL special] read lock and write lock

《剑指offer 04》二维数组查找

OpenGL index cache object EBO and lineweight mode
随机推荐
php 获取文件夹下面的文件列表和文件夹列表
023(【模板】最小生成树)(最小生成树)
Extrapolated scatter data
vulnhub之GeminiInc v2
vulnhub之pyexp
小鹏 P7 撞护栏安全气囊未弹出,官方回应称撞击力度未达到弹出要求
previous permutation lintcode51
During FTP login, the error "530 login incorrect.login failed" is reported
vulnhub之momentum
4000 word super detailed pointer
Socket TCP for network communication (I)
Kubernetes three dozen probes and probe mode
Concurrent programming - singleton
C language improvement article (wchar_t) character type
previous permutation lintcode51
错排问题 (抽奖,发邮件)
Cacti monitors redis implementation process
OpenGL index cache object EBO and lineweight mode
【mysql官方文档】死锁
抓包整理外篇fiddler———— 会话栏与过滤器[二]