当前位置:网站首页>Second understanding permutation and combination
Second understanding permutation and combination
2022-06-24 21:02:00 【Messenger Xiaolin】
To tell a story is to better understand mathematical concepts , Second, to form a long-term memory , Later, I will remember this concept through stories .
The story will be a little long , But it can be understood for a long time only once and without rote learning !
Permutation and combination
Let's start with the concept description found on Wikipedia and Baidu Encyclopedia , If you understand the conceptual description, you don't need to continue reading the story .
array : It refers to taking a specified number of elements from a given number of elements for sorting .
Combine : It refers to taking only a specified number of elements from a given number of elements , Don't think about sorting .
difference : Of the selected element The order Whether it will affect the results .
1. array :
In mathematics, permutation is the act of arranging the members of a set into a sequence or order, or, if the set is already ordered,
hypothesis 7 There are three programmers 3 One will go bald , The degree of baldness is divided into , Total baldness , Half bald , Microalopecia .
that 7 Choose from the programmers 1 A totally bald programmer , For the sake of fairness , Everyone has a chance to be bald , Then there is 7 In this case ;
Next, from the rest 6 Choose from the programmers 1 Half bald , Yes 6 In this case ;
If we continue, we will 5 choose 1, It is 5 In this case ;
So there are 7x6x5 situation .
If I were cruel , I hope all programmers are bald , But the degree of baldness is different ( Three to seven percent baldness , Alopecia punctata ······). So what it says 7 A programmer has 7x6x5x4x3x2x1 Baldness .
But I am kind ! from 7 A programmer specifies 3 A programmer must be bald , other 4 One will not go bald , So how can we save these programmers ?
Compare the above two formulas , It can be seen that 4x3x2x1 Get rid of it. , And then there is (7x6x5x4x3x2x1)/(4x3x2x1), namely ( 7 ! ) / ( 4 ! ) (7!)/(4!) (7!)/(4!)
By analogy, we get the following inference : from n individual ( The programmer ) Elements k individual ( Baldness ) Sort , There is P In this case P = ( n ! ) / ( n − k ) ! = P ( n , k ) P=(n!)/(n-k)!=P(n,k) P=(n!)/(n−k)!=P(n,k)
2. Combine
In mathematics, a combination is a selection of items from a collection, such that (unlike permutations) the order of selection does not matter.
The above story is to make programmers all kinds of bald , But I think it's too cruel , So I still hope that bald programmers have no hair to take off , A uniform bald head !
The next story is 7 Programmers selected 3 One is bald !
So it's the same as the first story 7 choose 1,6 choose 1,5 choose 1 Do you ? No ! The difference is that the people selected are not uniform !
2.1 The first story is , When I want to select the first one that is slightly bald , The second half bald , The third is completely bald , So everyone rushed to sign up for the first baldness , Because I'm afraid of being chosen to be completely bald or semi bald . Choose total baldness , Half bald , The process of not balding is sequential .
2.2 The second story is , Choose to make them all bald , When they are chosen , There is no order . I'm bald anyway , Others don't care who is chosen .
The story changes , Give Way 3 The degree of baldness of a programmer is different from that of a programmer 3 Every programmer becomes bald .
Then the second story can be based on the first story , exclude 3 A bald, different programmer , How to eliminate it ? Before 7 Exclusions 4 They all use division , This is also true. . But this is not an exclusion 4 I am not bald !
It's exclusion 3 A different bald man . Some people here will directly think that only 3 The only bald person is 3 In this case , But this 3 Individual baldness should continue to be ranked ! So there will be 3x2x1 situation , The end result is :
( 7 ! ) / ( 4 ! 3 ! ) (7!)/(4!3!) (7!)/(4!3!)
By analogy, we get the following inference : from n individual ( The programmer ) Elements k individual ( Baldness ), There is no need to sort , There is C In this case C = ( n ! ) / ( n − k ) ! k ! = C ( n , k ) C=(n!)/(n-k)!k!=C(n,k) C=(n!)/(n−k)!k!=C(n,k)
边栏推荐
- Talking about the range of data that MySQL update will lock
- A/b test helps the growth of game business
- Format method and parse method of dateformat class
- 物聯網?快來看 Arduino 上雲啦
- Common member methods of the calendar class
- 传统的IO存在什么问题?为什么引入零拷贝的?
- The largest DPU manufacturer in history (Part 1)
- C langage pour le déminage (version simplifiée)
- Bridging mode -- law firm
- Stackoverflow 年度报告 2022:开发者最喜爱的数据库是什么?
猜你喜欢

顺序表的基本操作

Summary of idea practical skills: how to rename a project or module to completely solve all the problems you encounter that do not work. It is suggested that the five-star collection be your daughter

After screwing the screws in the factory for two years, I earned more than 10000 yuan a month by "testing" and counterattacked

Apple doesn't need money, but it has no confidence in its content

基于SSM的物料管理系统(源码+文档+数据库)

Interpreter mode -- formulas for dating
![[performance tuning basics] performance tuning strategy](/img/83/be41a6a0c5c186d3fb3a120043c53f.jpg)
[performance tuning basics] performance tuning strategy

Network security review office starts network security review on HowNet

传统的IO存在什么问题?为什么引入零拷贝的?

微信小程序自定义tabBar
随机推荐
Material management system based on SSM (source code + document + database)
刚购买了一个MYSQL数据库,提示已有实例,控制台登录实例要提供数据库账号,我如何知道数据库账号。
C langage pour le déminage (version simplifiée)
情绪识别AI竟「心怀鬼胎」,微软决定封杀它!
Basic properties and ergodicity of binary tree
What are the problems with traditional IO? Why is zero copy introduced?
JMeter parameterization
Implement the redis simple client customized based on socket
Steps of JMeter performance test
Vxlan and MPLS: from data center to Metro Ethernet
京东一面:Redis 如何实现库存扣减操作?如何防止商品被超卖?
CVPR 2022缅怀孙剑!同济、阿里获最佳学生论文奖,何恺明入围
史上最全DPU厂商大盘点(上)
Bytebase加入阿里云PolarDB开源数据库社区
Leetcode (135) - distribute candy
顺序栈遍历二叉树
Bean lifecycle flowchart
2022年最新四川建筑八大员(电气施工员)模拟题库及答案
Stackoverflow annual report 2022: what are developers' favorite databases?
Smooth live broadcast | analysis of key technologies for live broadcast pain points