Faculty-based number system

from Wikipedia, the free encyclopedia

In combinatorics , the faculty-based number system is used to generate a unique index for permutations .

definition

The faculty-based number system is the number system that has the sequence of the first natural numbers as basic numbers, and thus the faculties as modules .

Job: 7th 6th 5 4th 3 2 1 0
Base number: 8th 7th 6th 5 4th 3 2 1
Digits ≤ 7th 6th 5 4th 3 2 1 0
Significance (module): 7! 6! 5! 4! 3! 2! 1! 0!
in decimal notation: 5040 720 120 24 6th 2 1 1

In this number system, the rightmost digit is always 0, the second digit from the right 0 or 1, the third 0, 1 or 2, etc. There are several variants of the faculty-based number system:

  • The right number is omitted because it is always 0.
  • Not the products, but the smallest common multiple (sequence A003418 in OEIS ) form the modules - and thus the first prime factors form the basic numbers.

example

The number 35 in this number system would be written as follows.

properties

The sum of the successive faculties , multiplied by their index, is always the next factorial minus one:

Therefore any number can be represented in this number system and this representation is unambiguous, i.e. H. no number can be represented in more than one way.

However, you need an infinite number of characters for this. The simple combination of decimal digits would be ambiguous for numbers with a “digit” greater than 9. The smallest example of this is the number 10 × 10 !, written out in full 10 10 0 9 0 8 0 7 0 6 0 5 0 4 0 3 0 2 0 1 0 0 , where 11! 1 11 0 10 0 9 0 8 0 7 0 6 0 5 0 4 0 3 0 2 0 1 0 0 is. Therefore, a single subscription (as in the decimal system ) is insufficient for numbers with more than 10 digits.

Lenstra omits the same subscriptions in Lenstra Profinite Fibonacci numbers p. 297 , places all decimal digits up to the last one in the case of multi-digit (faculty) digits and terminates with the suffix ! , so that

10 × 10! = 10 10 0 9 0 8 0 7 0 6 0 5 0 4 0 3 0 2 0 1 0 0
= 1 00000000000 !

is.

application

The faculty-based number system is used to make a canonical assignment between the whole numbers (or the equivalent numbers with n digits in the faculty-based number system) and permutations of n elements in lexicographical order when the whole numbers are represented in relation to this number system. This assignment is called the Lehmer Code or Lucas-Lehmer Code. For example, with n = 3 the following assignment results :

decimal faculty-based permutation
0 10 0 2 0 1 0 0 (0,1,2)
1 10 0 2 1 1 0 0 (0.2.1)
2 10 1 2 0 1 0 0 (1.0.2)
3 10 1 2 1 1 0 0 (1,2,0)
4 10 2 2 0 1 0 0 (2.0.1)
5 10 2 2 1 1 0 0 (2.1.0)

the left digit 0, 1 or 2 selects itself as the permutation digit from the sorted list (0,1,2) and removes itself from the list. A shorter list is created in which the first permutation digit is missing. The second digit is used to select the second permutation digit. The counting starts with 0. The element is removed from the list. The third digit is "0". Since the list only contains one element, this is selected as the last permutation digit.

This process becomes clearer with a longer example. In the following, the digits from the faculty-based number system 4 6 0 5 4 4 1 3 0 2 0 1 0 0 are used to generate the digits from the permutation (4,0,6,2,1,3,5).

                                 46054413020100 → (4,0,6,2,1,3,5)
Fakultätsbasiert: 46        05                      44      13        02        01      00
                  |         |                       |       |         |         |       |
         (0,1,2,3,4,5,6) → (0,1,2,3,5,6) → (1,2,3,5,6) → (1,2,3,5) → (1,3,5) → (3,5) → (5)
                  |         |                       |       |         |         |       |
Permutation:     (4,        0,                      6,      2,        1,        3,      5)

The natural index for the direct sum of two permutations is simply the concatenation .

decimal faculty-based Permutation pair
0 10 0 2 0 1 0 0 0 2 0 1 0 0 ((0,1,2), (0,1,2))
1 10 0 2 0 1 0 0 0 2 1 1 0 0 ((0,1,2), (0,2,1))
...
5 10 0 2 0 1 0 0 2 2 1 1 0 0 ((0,1,2), (2,1,0))
6 10 0 2 1 1 0 0 0 2 0 1 0 0 ((0,2,1), (0,1,2))
7 10 0 2 1 1 0 0 0 2 1 1 0 0 ((0.2.1), (0.2.1))
...
22 10 1 2 1 1 0 0 2 2 0 1 0 0 ((1,2,0), (2,0,1))
...
34 10 2 2 1 1 0 0 2 2 0 1 0 0 ((2.1.0), (2.0.1))
35 10 2 2 1 1 0 0 2 2 1 1 0 0 ((2.1.0), (2.1.0))

See also

literature

  • Donald Knuth . The Art of Computer Programming . Volume 2: Seminumerical Algorithms . Third edition. Addison-Wesley, 1997, ISBN 0-201-89684-2 , pp. 65-66 (English).

Web links