Current location - Training Enrollment Network - Mathematics courses - Factors commonly used in high school mathematics
Factors commonly used in high school mathematics
The so-called factorial number means that the base of its lowest bit is 1, that is, every one goes in, and every one goes higher, that is, the carry is two, three, and the n-bit factorial number * * has n! A. For example, the three factorials are 000, 0 10, 100,1/kloc-0, 200, 2 10. Let n-ary set S={a

0,a 1,a2,…

An- 1}, then the complete permutation of s corresponds to the factorial number of n bits one by one. The corresponding way is: there are n ways to select the first element from n elements, and the subscript value of the selected element is an integer between 0 and n- 1, which is taken as the highest digit of the factorial number of n, and the rest elements are renumbered from 0 to n-2 according to the subscript, and the relative order is not changed when renumbering, so there are n- 1 ways to select the second element. The subscript value of the selected element is an integer between 0 and n-2, which is regarded as the second highest order of the n-bit factorial number ... There is only 1 method to select the last element, and the subscript value of the selected element is 0, which is regarded as the lowest order of the n-bit factorial number, so any permutation must correspond to an n-bit factorial number. Obviously, this correspondence is one to one. Question: Please use factorial method to generate a complete permutation from 1 to n. ..

[Algorithm Design] Firstly, all the n-bit factorials are generated in turn by adding one to the lowest bit, and the corresponding arrangement of any n-bit factorials is obtained by the above method.