Addition & Multiplication Principles
Addition principle
Completing a project can include class method, Represents the first The number of class methods. Then there are a total of different methods.
multiplication principle
It takes minutes to complete a project steps, Represents the first The number of different methods for each step. Then there are a total of different methods.
Basics of permutations and combinations
number of permutations
from any of the different elements (, with are all natural numbers, the same below) elements are arranged in a column in a certain order, which is called from extracted from different elements an arrangement of elements; starting from extracted from different elements () The number of all permutations of elements is called from extracted from different elements The number of permutations of elements, using symbols (or ) means.
The calculation formula for permutation is as follows:
represent The factorial of 。
The formula can be understood like this: personal choice Come and line up (). The first position can be selected , the second position can be selected , and so on, the first (the last one) can be selected one, get:
Full arrangement: Everyone comes and lines up. The captain is . The first position can be selected , the second position can be selected , and so on:
Total permutations are a special case of permutations.
number of combinations
from any of the different elements () elements form a set, called from extracted from different elements a combination of elements; from extracted from different elements () The number of all combinations of elements is called from extracted from different elements The number of combinations of elements. use symbols to express.
Combination number calculation formula
How to understand the above formula? we consider personal () come out, don’t line up, don’t care about the order . If you care about arrangement, then yes , if you don’t care, then you have to get rid of the duplications, so how many duplications are there? Also selected Individuals, they still need to "completely arrange" , so we get:
Combination numbers are also commonly used means, read as " choose ”, that is . In fact, the latter is clear in meaning, beautiful and concise, so it is now commonly used in mathematics circles. mark instead of 。
Combinatorial numbers are also called "binomial coefficients", and the following binomial theorem will explain the connection.
In particular, it is stipulated that when when,。
binomial theorem
Before entering the advanced chapter on permutations and combinations, we first introduce a theorem closely related to combinatorial numbers - the binomial theorem.
The binomial theorem states the coefficients of an expansion:
The proof can be done using mathematical induction, using Make a generalization.
The binomial theorem can also be easily extended to polynomial form:
Let n be a positive integer, is a real number,
of which is a polynomial coefficient, and its properties are also very similar:
Advanced Arrangement and Combination
Next we introduce some variations of permutations and combinations.
Number of permutations of multisets | Number of multicombinations
Please make sure to distinguish Multiple combinations with Number of combinations of multisets! The two are completely different concepts!
Multiset refers to a generalized set containing repeated elements. Set Expressed by a , a ,…, a A multiset consisting of The total number of permutations is
It is equivalent to removing the number of permutations of the same elements. Specifically, you can think of you as having Plant different balls, and the number of each type of balls is , and . this The total number of permutations of balls is Number of permutations of multisets. The number of permutations of a multiset is often called Multiple combinations. We can express the above formula using the symbols of multiple combinatorial numbers:
It can be seen that Equivalent to , but the latter is more cumbersome, so it is not used.
Number of combinations of multisets 1
Set Expressed by a , a ,…, a composed of multisets. So for integers , from Select The number of ways that elements can form a multiset is Number of combinations of multisets. This question is equivalent to The number of non-negative integer solutions of can be solved using the plug-and-board method. The answer is
Number of combinations of multisets 2
Consider this question: Suppose Expressed by a , a ,…, a composed of multisets. Then for positive integers , from Select The number of ways elements can form a multiset.
This limits the number of elements that can be taken. Likewise, we can transform this problem into a linear equation solution with restrictions:
So it is natural to think of the principle of inclusion and exclusion. The model of inclusion and exclusion is as follows:
- Complete set: The non-negative integer solution of .
- Properties:。
So suppose it satisfies the property The set is , Indicates that the attribute is not satisfied The set of , which satisfies collection. Then the answer is
According to the principle of inclusion and exclusion, there are:
Get the full set Subtract the above formula to get the number of combinations of multisets
where A acts as a subset of the enumeration, satisfying 。
non-adjacent arrangement
this natural numbers selected This, this The combination of any two numbers that are not adjacent is species.
misaligned arrangement
Let’s concretize the problem of misalignment and consider this question:
Different letters, numbered respectively , now we need to put these five letters in the numbered In the envelope, the envelope number is required to be different from the letter number. How many different placement methods are there?
Suppose we consider the envelope, initially we temporarily put the Put the letter on the envelopes, and then consider the recursion in two situations:
- front All envelopes were packed incorrectly;
- front One of the envelopes was packed incorrectly, and all the others were packed incorrectly.
For the first case, the front All envelopes were packed incorrectly: because the front All of them have been installed incorrectly, so the second one has been installed incorrectly. The seal only needs to be exchanged with any of the previous positions. There are a total of situation.
For the second case, the previous One of the envelopes is not packed incorrectly and the rest are all incorrectly packed: the purpose of considering this situation is that if If one of the envelopes is packed correctly, then we compare the one that is packed correctly with the By swapping, a fully misaligned arrangement can be obtained.
In other cases, we cannot turn it into a length of misaligned.
Therefore, the recursive formula for the misalignment arrangement can be obtained as 。
The first few items of the misaligned sequence are 。
circular arrangement
All individuals come to form a circle, and the number of all arrangements is recorded as . Consider a circle that has been lined up, disconnected from different locations, and turned into different queues.
so there is
From this we know the formula for partial circle arrangement:
Properties of combinatorial numbers | Binomial corollary
Here we introduce some properties of combinatorial numbers.
It is equivalent to taking the complement of the selected set to the complete set, so the value remains unchanged. (symmetry)
A recurrence derived from a definition.
The recursive expression of combination numbers (the formula expression of Yang Hui's triangle). We can use this formula to The number of combinations is deduced under the complexity.
This is a special case of the binomial theorem. take We get the above formula.
Another special case of the binomial theorem, it is advisable . The special case of the formula is to take when the answer is 。
The formula for splitting a combination is used when dealing with certain data structure problems.
This is special case, take That’s it.
An expression with weighted sum, by pairing The corresponding derivation of the polynomial function can be proved.
Similar to the above equation, it can be proved by derivation of the polynomial function.
Consider one by one through combined analysis of Subset numbers can be proved and are commonly used in identity proofs.
It can be proved by definition.
Among them It is the Fibonacci sequence.