Basic knowledge-permutation and combination

definition:

P (m,n): Take the number of permutations of m elements from n different elements.
C(m,n): Take the number of combinations of m elements from n different elements

official:

P (n,m)=n(n-1)(n-2)…(n-m+1)
Example: P(2,5)=5 * 4=20

C(n,m)=n(n-1)(n-2)…(n-m+1)/m!
Example: C(2,5)=5 * 4 /1 * 2=10

Circle arrangement

Take out m(1<=m<=n) elements from n different elements without repeating them and arrange them on the circle, find out how many different arrangement methods there are in total
(if one m-circle is arranged and rotated, another m- Circle arrangement, the two circles are considered the same arrangement)

Formula: P(m,n)/m

Misalignment

There is an arrangement of n elements. If all elements are not in their original positions after the rearrangement, then this arrangement is called a stagger of the original arrangement. How many different staggering methods are there

Formula: D(n)=(n-1) [D(n-1) + D(n-2)]
In particular, D(1) = 0, D(2) = 1

Special conditions for arrangement

Example: 7 students stand in a row, how many different arrangements are there according to the following requirements

①A certain fixed position of station A:
P(6,6)

②A stands in the middle, and B is adjacent to A:
P(2,2) P(5,5)

③A and B are adjacent:
P(2,2)P(6,6)

④A and B cannot be adjacent:
P(7,7)-P(2,2)P(6,6)

⑤ A, B, and C are adjacent to each other:
== P(5,5)P(3,3)==

⑥The two persons of A and B do not stand at the head and end of the row:
P(2,5)P(5,5)

⑦A, B, and C are not adjacent to any two:
P(3,5)P(4,4)

⑧ A and B must be adjacent to each other, and C does not stand at the head or end of the row:
P(2,2)P(1,4)P(5,5)

Combination of n balls and m boxes

N balls, m boxes, whether the balls are the same, whether the boxes are the same, whether the boxes can be empty, a total of 2^3=8 types (only the common two are discussed below):

1. Same ball, different box, no empty box
C(n-1,m-1)
2. Same ball but different box, empty box allowed
C(n+m-1,m-1)

Guess you like

Origin blog.csdn.net/weixin_45485187/article/details/101686429