Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Factorial number system

From Wikipedia, the free encyclopedia
Numeral system in combinatorics
Part ofa series on
Numeral systems
List of numeral systems
icon
This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Factorial number system" – news ·newspapers ·books ·scholar ·JSTOR
(March 2021) (Learn how and when to remove this message)

Incombinatorics, thefactorial number system (also known asfactoradic), is amixed radixnumeral system adapted to numberingpermutations. It is also calledfactorial base, althoughfactorials do not function asbase, but asplace value of digits. By converting a number less thann! to factorial representation, one obtains asequence ofn digits that can be converted to a permutation ofn elements in a straightforward way, either using them asLehmer code or asinversion table[1] representation; in theformer case the resulting map fromintegers to permutations ofn elements lists them inlexicographical order. General mixed radix systems were studied byGeorg Cantor.[2]

The term "factorial number system" is used byKnuth,[3]while the French equivalent "numération factorielle" was first used in 1888.[4] The term "factoradic", which is aportmanteau of factorial and mixed radix, appears to be of more recent date.[5]

Definition

[edit]

The factorial number system is amixed radixnumeral system: thei-th digit from the right has base i, which means that the digit must be strictly less thani, and that (taking into account the bases of the less significant digits) its value is to be multiplied by(i − 1)! (its place value).

Radix/Base87654321
Place value7!6!5!4!3!2!1!0!
Place value in decimal5040720120246211
Highest digit allowed76543210

From this it follows that the rightmost digit is always 0, the second can be 0 or 1, the third 0, 1 or 2, and so on (sequenceA124252 in theOEIS). The factorial number system is sometimes defined with the 0! place omitted because it is always zero (sequenceA007623 in theOEIS).

In this article, a factorial number representation will be flagged by a subscript "!". In addition, some examples will have digits delimited by a colon. For example, 3:4:1:0:1:0! stands for

= 3×5! + 4×4! + 1×3! + 0×2! + 1×1! + 0×0! 
= ((((3×5 + 4)×4 + 1)×3 + 0)×2 + 1)×1 + 0
=  46310.

(The place value is the factorial of one less than the radix position, which is why the equation begins with 5! for a 6-digit factoradic number.)

General properties of mixed radix number systems also apply to the factorial number system. For instance, one can convert a number into factorial representation producing digits from right to left, by repeatedly dividing the number by the radix (1, 2, 3, ...), taking the remainder as digits, and continuing with the integerquotient, until this quotient becomes 0.

For example, 46310 can be transformed into a factorial representation by these successive divisions:

463 ÷ 1 = 463, remainder 0
463 ÷ 2 = 231, remainder 1
231 ÷ 3 = 77, remainder 0
77 ÷ 4 = 19, remainder 1
19 ÷ 5 = 3, remainder 4
3 ÷ 6 = 0, remainder 3

The process terminates when the quotient reaches zero. Reading the remainders backward gives 3:4:1:0:1:0!.

In principle, this system may be extended to representrational numbers, though rather than the natural extension of place values (−1)!, (−2)!, etc., which are undefined, the symmetric choice of radix valuesn = 0, 1, 2, 3, 4, etc. after the point may be used instead. Again, the 0 and 1 places may be omitted as these are always zero. The corresponding place values are therefore 1/1, 1/1, 1/2, 1/6, 1/24, ..., 1/n!, etc.

Examples

[edit]

The following sortable table shows the 24 permutations of four elements with differentinversion related vectors. The left and right inversion countsl{\displaystyle l} andr{\displaystyle r} (the latter often calledLehmer code) are particularly eligible to be interpreted as factorial numbers.l{\displaystyle l} gives the permutation's position in reversecolexicographic order (the default order of this table), and the latter the position inlexicographic order (both counted from 0).

Sorting by a column that has the omissible 0 on the right makes the factorial numbers in that column correspond to the index numbers in the immovable column on the left. The small columns are reflections of the columns next to them, and can be used to bring those in colexicographic order. The rightmost column shows the digit sums of the factorial numbers (OEISA034968 in the tables default order).

The factorial numbers of a given length form apermutohedron when ordered by the bitwise{\displaystyle \leq } relation

These are the right inversion counts (aka Lehmer codes) of the permutations of four elements.
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
π{\displaystyle \pi }v{\displaystyle v}l{\displaystyle l}p-br{\displaystyle r}#
0123443210000000000000000000000000
1213443121000000100100100100000011
2132442310100001001000010010000101
3312442131100001101100110200000022
4231441322000000202000020110000112
5321441232100001202100120210000123
6124334210010010010000001001001001
7214334121010010110100101101001012
8142332410110011011000011020000202
9412332141110011111100111300000033
10241331422010010212000021120000213
11421331242110011212100121310000134
12134224310200002020000002011001102
13314224131200002120100102201001023
14143223410210012021000012021001203
15413223141210012121100112301001034
16341221432200002222000022220000224
17431221342210012222100122320000235
18234114323000000330000003111001113
19324114233100001330100103211001124
20243113423010010331000013121001214
21423113243110011331100113311001135
22342112433200002332000023221001225
23432112343210012332100123321001236

For another example, the greatest number that could be represented with six digits would be 543210! which equals 719 indecimal:

5×5! + 4×4! + 3x3! + 2×2! + 1×1! + 0×0!.

Clearly the next factorial number representation after 5:4:3:2:1:0! is 1:0:0:0:0:0:0! which designates 6! = 72010, the place value for the radix-7 digit. So the former number, and its summed out expression above, is equal to:

6! − 1.

The factorial number system provides a unique representation for each natural number, with the given restriction on the "digits" used. No number can be represented in more than one way because the sum of consecutive factorials multiplied by their index is always the next factorial minus one:

i=0nii!=(n+1)!1.{\displaystyle \sum _{i=0}^{n}{i\cdot i!}={(n+1)!}-1.}

This can be easilyproved withmathematical induction, or simply by noticing thati,ii!=(i+11)i!=(i+1)!i!{\displaystyle \forall i,i\cdot i!=(i+1-1)\cdot i!=(i+1)!-i!}: subsequent terms cancel each other, leaving the first and last term (seeTelescoping series).

However, when usingArabic numerals to write the digits (and not including the subscripts as in the above examples), their simple concatenation becomes ambiguous for numbers having a "digit" greater than 9. The smallest such example is the number 10 × 10! = 36,288,00010, which may be written A0000000000!=10:0:0:0:0:0:0:0:0:0:0!, but not 100000000000! = 1:0:0:0:0:0:0:0:0:0:0:0! which denotes 11! = 39,916,80010. Thus using letters A–Z to denote digits 10, 11, 12, ..., 35 as in other base-N make the largest representable number 36 × 36! − 1. For arbitrarily greater numbers one has to choose a base for representing individual digits, say decimal, and provide a separating mark between them (for instance by subscripting each digit by its base, also given in decimal, like 24031201, this number also can be written as 2:0:1:0!). In fact the factorial number system itself is not truly anumeral system in the sense of providing a representation for all natural numbers using only a finite alphabet of symbols.

Permutations

[edit]

There is a naturalmapping between the integers0, 1, ..., n! − 1 (or equivalently the numbers withn digits in factorial representation) andpermutations ofn elements inlexicographical order, when the integers are expressed in factoradic form. This mapping has been termed theLehmer code (or inversion table). For example, withn = 3, such a mapping is

decimalfactoradicpermutation
0100:0:0!(0,1,2)
1100:1:0!(0,2,1)
2101:0:0!(1,0,2)
3101:1:0!(1,2,0)
4102:0:0!(2,0,1)
5102:1:0!(2,1,0)

In each case, calculating the permutation proceeds by using the leftmost factoradic digit (here, 0, 1, or 2) as the first permutation digit, then removing it from the list of choices (0, 1, and 2). Think of this new list of choices as zero indexed, and use each successive factoradic digit to choose from its remaining elements. If the second factoradic digit is "0" then the first element of the list is selected for the second permutation digit and is then removed from the list. Similarly, if the second factoradic digit is "1", the second is selected and then removed. The final factoradic digit is always "0", and since the list now contains only one element, it is selected as the last permutation digit.

The process may become clearer with a longer example. Let's say we want the 2982nd permutation of the numbers 0 through 6.The number 2982 is 4:0:4:1:0:0:0! in factoradic, and that number picks out digits (4,0,6,2,1,3,5) in turn, via indexing a dwindling ordered set of digits and picking out each digit from the set at each turn:

                            4:0:4:1:0:0:0!  ─►  (4,0,6,2,1,3,5)factoradic: 4              :   0            :   4          :   1        :   0      :   0    :   0!            ├─┬─┬─┬─┐          │                ├─┬─┬─┬─┐      ├─┐          │          │        │sets:      (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)

A natural index for thedirect product of twopermutation groups is theconcatenation of two factoradic numbers, with two subscript "!"s.

           concatenated decimal   factoradics        permutation pair    010     0:0:0!0:0:0!           ((0,1,2),(0,1,2))    110     0:0:0!0:1:0!           ((0,1,2),(0,2,1))               ...    510     0:0:0!2:1:0!           ((0,1,2),(2,1,0))    610     0:1:0!0:0:0!           ((0,2,1),(0,1,2))    710     0:1:0!0:1:0!           ((0,2,1),(0,2,1))               ...   2210     1:1:0!2:0:0!           ((1,2,0),(2,0,1))               ...   3410     2:1:0!2:0:0!           ((2,1,0),(2,0,1))   3510     2:1:0!2:1:0!           ((2,1,0),(2,1,0))

Fractional values

[edit]

Unlike single radix systems whose place values arebasen for both positive and negative integraln, the factorial number base cannot be extended to negative place values as these would be (−1)!, (−2)! and so on, and these values are undefined (seefactorial).

One possible extension is therefore to use 1/0!, 1/1!, 1/2!, 1/3!, ..., 1/n! etc. instead, possibly omitting the 1/0! and 1/1! places which are always zero.

With this method, all rational numbers have a terminating expansion, whose length in 'digits' is less than or equal to the denominator of the rational number represented. This may be proven by considering that there exists a factorial for any integer and therefore the denominator divides into its own factorial even if it does not divide into any smaller factorial.

By necessity, therefore, the factoradic expansion of the reciprocal of aprime has a length of exactly that prime (less one if the 1/1! place is omitted). Other terms are given as the sequenceA046021 on the OEIS. It can also be proven that the last 'digit' or term of the representation of a rational with prime denominator is equal to the difference between the numerator and the prime denominator.

Similar to how checking the divisibility of 4 in base 10 requires looking at only the last two digits, checking the divisibility of any number in factorial number system requires looking at only a finite number of digits. That is, it has adivisibility rule for each number.

There is also a non-terminating equivalent for every rational number akin to the fact that in decimal 0.24999... = 0.25 = 1/4 and0.999... = 1, etc., which can be created by reducing the final term by 1 and then filling in the remaining infinite number of terms with the highest value possible for the radix of that position.

In the following selection of examples, spaces are used to separate the place values, otherwise represented in decimal. The rational numbers on the left are also in decimal:

There are also a small number of constants that have patterned representations with this method:

See also

[edit]

References

[edit]
  1. ^Knuth, D. E. (1973), "Volume 3: Sorting and Searching",The Art of Computer Programming, Addison-Wesley, p. 12,ISBN 0-201-89685-0
  2. ^Cantor, G. (1869),Zeitschrift für Mathematik und Physik, vol. 14.
  3. ^Knuth, D. E. (1997), "Volume 2: Seminumerical Algorithms",The Art of Computer Programming (3rd ed.), Addison-Wesley, p. 192,ISBN 0-201-89684-2.
  4. ^Laisant, Charles-Ange (1888),"Sur la numération factorielle, application aux permutations",Bulletin de la Société Mathématique de France (in French),16:176–183.
  5. ^The term "factoradic" is apparently introduced inMcCaffrey, James (2003),Using Permutations in .NET for Improved Systems Security, Microsoft Developer Network.

External links

[edit]
Retrieved from "https://en.wikipedia.org/w/index.php?title=Factorial_number_system&oldid=1309641022"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp