当前位置:网站首页>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)
边栏推荐
- Combination mode -- stock speculation has been cut into leeks? Come and try this investment strategy!
- 伯克利、MIT、劍橋、DeepMind等業內大佬線上講座:邁向安全可靠可控的AI
- Hosting service and SASE, enjoy the integration of network and security | phase I review
- Berkeley, MIT, Cambridge, deepmind et d'autres grandes conférences en ligne: vers une IA sûre, fiable et contrôlable
- Agency mode -- Jiangnan leather shoes factory
- Tool composition in JMeter
- Basic properties and ergodicity of binary tree
- Berkeley, MIT, Cambridge, deepmind and other industry leaders' online lectures: towards safe, reliable and controllable AI
- Prototype mode -- clone monster Army
- 全上链哈希游戏dapp系统定制(方案设计)
猜你喜欢
得物多活架构设计之路由服务设计
伯克利、MIT、劍橋、DeepMind等業內大佬線上講座:邁向安全可靠可控的AI
Cooking business experience of young people: bloggers are busy selling classes and bringing goods, and the organization earns millions a month
[performance tuning basics] performance tuning strategy
Combination mode -- stock speculation has been cut into leeks? Come and try this investment strategy!
Internet of things? Come and see Arduino on the cloud
Behind Tiantian Jianbao storm: tens of millions in arrears, APP shutdown, and the founder's premeditated plan to run away?
Image panr
Several common command operations in win system
Sequence stack version 1.0
随机推荐
IDEA Dashboard
DX12引擎开发课程进度-这个课程到底讲到哪里了
Openvino2022 dev tools installation and use
Hosting service and SASE, enjoy the integration of network and security | phase I review
JMeter parameterization
Coinbase will launch the first encryption derivative for individual investors
Berkeley, MIT, Cambridge, deepmind and other industry leaders' online lectures: towards safe, reliable and controllable AI
伯克利、MIT、劍橋、DeepMind等業內大佬線上講座:邁向安全可靠可控的AI
Apple, Microsoft and Google will no longer fight each other. They will work together to do a big thing this year
Hongxiang Yunteng is compatible with dragon lizard operating system, and the product runs stably
Implement the redis simple client customized based on socket
Visitor model -- generation gap between young and middle-aged people
科创人·味多美CIO胡博:数字化是不流血的革命,正确答案藏在业务的田间地头
JMeter response assertion
Can the OPDS SQL component pass process parameters to the next component through context
Agency mode -- Jiangnan leather shoes factory
别再用 System.currentTimeMillis() 统计耗时了,太 Low,StopWatch 好用到爆!
Smooth live broadcast | analysis of key technologies for live broadcast pain points
Sequence stack version 1.0
Basic operation of sequence table