• Day algorithm [more] combinations and permutations • 第四十一期

▎ arrangement

"introduction"

  Think about a problem:

Your eyes now there are three people: gzr, lsh, hza, how to arrange their place?

  Clearly, there is a row of law:

gzr、lsh、hza

gzr、hza、lsh

hza、lsh、gzr

hza、gzr、lsh

lsh、gzr、hza

lsh、hza、gzr

  A total of six kinds.

 ☞ "define"

  Is not that a discharge order it? I believe there is no need to come up with the definition of the terms.

  But the only thing to note: the order of arrangement is concerned.

 ☞ "n of n selected solved."

  So our program arranged in n number of how many individuals do?

  Obviously, there are n individual first embodiment;

  N-1 second individuals kinds of programs;

  There third n-2 kinds of programs;

  ……

  One species of the n individual programs;

  According to the multiplication principle, the total number of programs is n * (n-1) * (n-2) * ... * 2 * 1.

  Found? Is not this n! .

 ☞ "n m a selected solved."

  Still above ideas, but not the n! A.

  Now we have to think: n! In this case, the multi multiply how many times?

  Of course there is (nm)! Times are multi-ride, so there are n! / (Nm)! A scheme.

▎ number of permutations

  When the n of m in number, we can be represented.

  5 example, the number three position, there are arranged a program.

▎ combination

 ☞ "introduction"

  To think about the following questions:

There are three puppies, which are Chinese rural dog, Shiba Inu, Labrador.

But now only two dog snacks, so to be fair, a dog can only eat up to one, the only time two dogs eat the rest of that one can only be a next time.

So the question is: How many distribution program several species? 

   This is the problem portfolio.

 ☞ "define"

  In just the problem, the problem is still above the number of options, but not the same.

  Because the dog eating is to eat, I do not care about the order, and just arrangement is concerned about the order.

  Therefore, the combination and arrangement of different places is concerned whether the order is like.

 ☞ "solving"

  Contrast arranged just how quickly find the number of portfolio do?

  Not difficult to find the same combination will be counted as arranged , so long as the result is divided by the arrangement of it.

  So the formula is: .

▎ number of combinations

 "representation"

  Symbol of that symbol C is just a combination of, and use the same arrangement.

  That is the selected number of permutations of m n of the program denoted .


 ☞ "through项公Expressions"

  Now I do not think n-1 before the number is how election, only care about the first n numbers.

  Obviously, the situation is two kinds, either selected or not selected.

  It must be chosen from the transfer to, and must not be selected from the transition to the.

  Therefore, in accordance with the principle of addition, general term formula is this: .

Guess you like

Origin www.cnblogs.com/TFLS-gzr/p/11336424.html