Count and combine

Count and combine

1. The basic principle of combined counting

1. The principle of addition and multiplication

Addition principle : Set elements can be divided into set families F = {S1, S2, S3...} The number of elements in S is the sum of the numbers of these elements: |S| = |S1| + |S2| + |S3| +...|Sn|

Note: 1) Classification criteria: no repetition, no omission

2) The classified count should be simpler than the original count

Multiplication principle : If each element of the set S is a sequence of n elements, and each element si may have mi values, then: |S| = m1*m2...mn

Note: 1) Distributed way of thinking

2) Each subtask has independence and relevance

About the comprehensive application of the principle of addition and multiplication :

1) The order in which subtasks are completed may affect the application of the multiplication principle, and priority should be given to subtasks with many constraints

2) If the completion order of subtasks cannot guarantee the independence of successive tasks, the principle of multiplication cannot be used directly, and the methods for completing subtasks should be classified, and finally the principle of addition should be used

Subtraction principle : the full set is U, then |S| = |U| - |US|

Division principle : If there is a full function f between the set S and the set T: S->T, and each element of T has exactly k preimages under f, then the number of elements of T is equal to the number of elements of S Divide by k, ie |T| = |S| / k

2. The principle of tolerance and exclusion

Lemma: Suppose A and B are finite sets, |A - B| = |A| - |A ∩ B|

The principle of inclusion and exclusion of two sets : |AUB| = |A| + |B| - |A ∩ B|

The principle of inclusion and exclusion of three sets : |AUBUC| = |A| + |B| + |C| - |A ∩ B| - |A ∩ C| - |B ∩ C| + |A ∩ B ∩ C|

3. Pigeon cage principle (Dirichlet's drawer principle)

Pigeon cage principle : Suppose k is a positive integer, k+1 or more pigeons are locked in k pigeon cages, then at least one pigeon cage has two or more pigeons

**Generalized pigeonhole principle: **Put N objects in k boxes, at least one box has at least N/k (upward estimate) objects

2. Arrangement and combination

1. The basic definition of permutation and combination

Arrangement : It is not allowed to repeatedly select r objects for orderly arrangement from n distinguishable objects, which is called r-arrangement of n objects, that is, P(n , r)

P(n, r) = n! / ( n - r ) !

Combination : No repetition is allowed from n distinguishable objects, and r objects are selected regardless of order, which is called r-combination of n objects, that is, C(n, r)

C(n, r) = n! / ( n - r ) ! * r!

Symmetry of the combination: C(n, r) = C(n, n - r)

Lemma: (r + 1) C(n, r + 1) = (n - 1) C(n, r)

ps Combination proof: a way of thinking from abstraction to concreteness, which is proved by giving specific explanations on both sides of the combination equation, that is, what set is counted specifically.

​ Algebraic proof: The proof of mathematical induction and the proof of using the combination number calculation formula are all algebraic proofs, which usually require certain skills.

2. Binomial Theorem and Combination Equations

The binomial theorem : [External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-i53fp261-1623514641320) (C:\Users\Qingkong\AppData\Roaming\Typora\typora -user-images\image-20210612195951391.png)]

Pascal's Equation : [External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-I2FL7Rkj-1623514579779) (C:\Users\Qingkong\AppData\Roaming\Typora\typora- user-images\image-20210612200107631.png)]

3. Allow repeated permutations and combinations

The number of repeated r- arrangements allowed for n-type objects is the r-th power of n

Each type of object has m1,...mn n types of objects that allow repeated m1+m2...+mn = r arrangement order is:

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-CKJajJbw-1623514579781) (C:\Users\Qingkong\AppData\Roaming\Typora\typora-user-images\ image-20210612201938812.png)]

n types of objects with unlimited number of objects allow to repeatedly select the number of combinations of r objects: C(n - 1 + r, r)

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-cVYH7kc5-1623514579783) (C:\Users\Qingkong\AppData\Roaming\Typora\typora-user-images\ image-20210612203527064.png)]

4. Re-discuss the principle of tolerance and exclusion

The principle of tolerance and exclusion in general form: [External link image transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the image and upload it directly (img-HFCQmAs4-1623514579784) (C:\Users\Qingkong\AppData\Roaming\Typora \typora-user-images\image-20210612203744639.png)]

Another form of tolerance and exclusion principle : [External link image transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the image and upload it directly (img-NZOfZ2OZ-1623514579785) (C:\Users\Qingkong\AppData\Roaming\ Typora\typora-user-images\image-20210612203832846.png)]

3. Recurrence relation

1. Recursive relational modeling of counting problems

Recursive relational expression : Use the previous item to represent the later item.

Closed formula solution : A solution sequence of a recurrence relation can be expressed by a general term formula that does not contain any term in the sequence

2. Solving linear recurrence relation

3. Divide and conquer algorithm and recursive relation

Supongo que te gusta

Origin blog.csdn.net/m0_51653236/article/details/117857486
Recomendado
Clasificación