Derivation of permutation and combination formula

Full arrangement:
There are n balls in total, and how many arrangements are there to take n balls?

To take n balls from n balls, you can imagine that there are n positions and one ball is placed in each position.
For the first position, there are n choices, and then for the second position, there are n-1 choices left, the third position, n-2 choices left, ... and so on, the nth position, there is only 1 choice left.

Therefore, there are
n *(n-1)*(n-2)*...* 1 = n!
permutations in n positions.
(ps: Here it is practical to the principle of step-by-step counting and multiplication)

So the full arrangement formula:
A nn = n! A_n^n = n!Ann=n!


Non-full permutation: There are
n balls in total and m balls. How many permutations are there?

To take m balls from n balls, you can imagine that there are m positions and one ball is placed in each position.
For the first position, there are n choices, and then for the second position, there are n-1 choices, and the third position, n-2 choices, ... and so on, the mth position, only n-m+ 1 choice.

Therefore, there are
n *(n-1)*(n-2)*...* (n-m+1)
= [n *(n-1)*(n-2)*...* 1] / [(nm) * (nm-1) *… * 1]
= n! / (nm)!
kinds of arrangements.
(ps: The principle of step-by-step counting and multiplication is also used here)

So the non-full permutation formula:
A nm = n! / (N − m)! A_n^m = n!/(nm)!Anm=n!/(nm)


combination:

There are a total of n balls and m balls. How many combinations are there?

The arrangement of taking m balls out of n balls can be regarded as: first taking m balls from n balls and combining them, and then performing a full arrangement for each combination.
That is:
A nm = C nm ∗ A mm A_n^m = C_n^m * A_m^mAnm=CnmAmm
(ps: The principle of step-by-step counting and multiplication is actually used here)



所以组合公式:
C n m = A n m / A m m = A n m / m ! = [ n ! / ( n − m ) ! ] / m ! = n ! / [ m ! ∗ ( n − m ) ! ] C_n^m = A_n^m / A_m^m=A_n^m /m!= [n!/(n−m)!]/m!=n!/[m!*(n-m)!] Cnm=Anm/Amm=Anm/m!=[n!/(nm)!]/m!=n!/[m!(nm)!]

Guess you like

Origin blog.csdn.net/wx_assa/article/details/107721010