Combinadic
   HOME

TheInfoList



OR:

In
mathematics Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
, and in particular in
combinatorics Combinatorics is an area of mathematics primarily concerned with counting, both as a means and as an end to obtaining results, and certain properties of finite structures. It is closely related to many other areas of mathematics and has many ...
, the combinatorial number system of degree ''k'' (for some positive
integer An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
''k''), also referred to as combinadics, or the Macaulay representation of an integer, is a correspondence between
natural number In mathematics, the natural numbers are the numbers 0, 1, 2, 3, and so on, possibly excluding 0. Some start counting with 0, defining the natural numbers as the non-negative integers , while others start with 1, defining them as the positive in ...
s (taken to include 0) ''N'' and ''k''-
combination In mathematics, a combination is a selection of items from a set that has distinct members, such that the order of selection does not matter (unlike permutations). For example, given three fruits, say an apple, an orange and a pear, there are ...
s. The combinations are represented as
strictly decreasing In mathematics, a monotonic function (or monotone function) is a function between ordered sets that preserves or reverses the given order. This concept first arose in calculus, and was later generalized to the more abstract setting of order ...
sequences In mathematics, a sequence is an enumerated collection of objects in which repetitions are allowed and order matters. Like a set, it contains members (also called ''elements'', or ''terms''). The number of elements (possibly infinite) is call ...
''c''''k'' > ... > ''c''2 > ''c''1 ≥ 0 where each ''ci'' corresponds to the index of a chosen element in a given ''k''-combination. Distinct numbers correspond to distinct ''k''-combinations, and produce them in
lexicographic order In mathematics, the lexicographic or lexicographical order (also known as lexical order, or dictionary order) is a generalization of the alphabetical order of the dictionaries to sequences of ordered symbols or, more generally, of elements of a ...
. The numbers less than \tbinom nk correspond to all of . The correspondence does not depend on the size ''n'' of the set that the ''k''-combinations are taken from, so it can be interpreted as a map from N to the ''k''-combinations taken from N; in this view the correspondence is a
bijection In mathematics, a bijection, bijective function, or one-to-one correspondence is a function between two sets such that each element of the second set (the codomain) is the image of exactly one element of the first set (the domain). Equival ...
. The number ''N'' corresponding to (''c''''k'', ..., ''c''2, ''c''1) is given by :N=\binomk+\cdots+\binom2+\binom1. The fact that a unique sequence corresponds to any non-negative number ''N'' was first observed by
D. H. Lehmer Derrick Henry "Dick" Lehmer (February 23, 1905 – May 22, 1991), almost always cited as D.H. Lehmer, was an American mathematician significant to the development of computational number theory. Lehmer refined Édouard Lucas' work in the 1930s and ...
. Indeed, a
greedy algorithm A greedy algorithm is any algorithm that follows the problem-solving heuristic of making the locally optimal choice at each stage. In many problems, a greedy strategy does not produce an optimal solution, but a greedy heuristic can yield locally ...
finds the ''k''-combination corresponding to ''N'': take ''c''''k'' maximal with \tbinomk\leq N, then take ''c''''k''−1 maximal with \tbinom\leq N - \tbinomk, and so forth. Finding the number ''N'', using the formula above, from the ''k''-combination (''c''''k'', ..., ''c''2, ''c''1) is also known as "ranking", and the opposite operation (given by the greedy algorithm) as "unranking"; the operations are known by these names in most
computer algebra system A computer algebra system (CAS) or symbolic algebra system (SAS) is any mathematical software with the ability to manipulate mathematical expressions in a way similar to the traditional manual computations of mathematicians and scientists. The de ...
s, and in
computational mathematics Computational mathematics is the study of the interaction between mathematics and calculations done by a computer.National Science Foundation, Division of Mathematical ScienceProgram description PD 06-888 Computational Mathematics 2006. Retri ...
. The originally used term "combinatorial representation of integers" was shortened to "combinatorial number system" by Knuth, who also gives a much older reference; the term "combinadic" is introduced by James McCaffrey (without reference to previous terminology or work). Unlike the
factorial number system In combinatorics, the factorial number system (also known as factoradic), is a mixed radix numeral system adapted to numbering permutations. It is also called factorial base, although factorials do not function as base, but as place value of ...
, the combinatorial number system of degree ''k'' is not a
mixed radix Mixed radix numeral systems are non-standard positional numeral systems in which the numerical base varies from position to position. Such numerical representation applies when a quantity is expressed using a sequence of units that are each a m ...
system: the part \tbinomi of the number ''N'' represented by a "digit" ''c''''i'' is not obtained from it by simply multiplying by a place value. The main application of the combinatorial number system is that it allows rapid computation of the ''k''-combination that is at a given position in the lexicographic ordering, without having to explicitly list the preceding it; this allows for instance random generation of ''k''-combinations of a given set. Enumeration of ''k''-combinations has many applications, among which are
software testing Software testing is the act of checking whether software satisfies expectations. Software testing can provide objective, independent information about the Quality (business), quality of software and the risk of its failure to a User (computin ...
, sampling,
quality control Quality control (QC) is a process by which entities review the quality of all factors involved in production. ISO 9000 defines quality control as "a part of quality management focused on fulfilling quality requirements". This approach plac ...
, and the analysis of
lottery A lottery (or lotto) is a form of gambling that involves the drawing of numbers at random for a prize. Some governments outlaw lotteries, while others endorse it to the extent of organizing a national or state lottery. It is common to find som ...
games.


Ordering combinations

A ''k''-combination of a set ''S'' is a
subset In mathematics, a Set (mathematics), set ''A'' is a subset of a set ''B'' if all Element (mathematics), elements of ''A'' are also elements of ''B''; ''B'' is then a superset of ''A''. It is possible for ''A'' and ''B'' to be equal; if they a ...
of ''S'' with ''k'' (distinct) elements. The main purpose of the combinatorial number system is to provide a representation, each by a single number, of all \tbinom nk possible ''k''-combinations of a set ''S'' of ''n'' elements. Choosing, for any ''n'', as such a set, it can be arranged that the representation of a given ''k''-combination ''C'' is independent of the value of ''n'' (although ''n'' must of course be sufficiently large); in other words considering ''C'' as a subset of a larger set by increasing ''n'' will not change the number that represents ''C''. Thus for the combinatorial number system one just considers ''C'' as a ''k''-combination of the set N of all natural numbers, without explicitly mentioning ''n''. In order to ensure that the numbers representing the ''k''-combinations of are less than those representing ''k''-combinations not contained in , the ''k''-combinations must be ordered in such a way that their largest elements are compared first. The most natural ordering that has this property is
lexicographic order In mathematics, the lexicographic or lexicographical order (also known as lexical order, or dictionary order) is a generalization of the alphabetical order of the dictionaries to sequences of ordered symbols or, more generally, of elements of a ...
ing of the ''decreasing'' sequence of their elements. So comparing the 5-combinations ''C'' =  and ''C''′ = , one has that ''C'' comes before ''C''′, since they have the same largest part 9, but the next largest part 6 of ''C'' is less than the next largest part 7 of ''C''′; the sequences compared lexicographically are (9,6,4,3,0) and (9,7,3,1,0). Another way to describe this ordering is view combinations as describing the ''k'' raised bits in the
binary representation A binary number is a number expressed in the base-2 numeral system or binary numeral system, a method for representing numbers that uses only two symbols for the natural numbers: typically "0" (zero) and "1" (one). A ''binary number'' may also ...
of a number, so that ''C'' =  describes the number :2^+2^+\cdots+2^ (this associates distinct numbers to ''all'' finite sets of natural numbers); then comparison of ''k''-combinations can be done by comparing the associated binary numbers. In the example ''C'' and ''C''′ correspond to numbers 10010110012 = 60110 and 10100010112 = 65110, which again shows that ''C'' comes before ''C''′. This number is not however the one one wants to represent the ''k''-combination with, since many binary numbers have a number of raised bits different from ''k''; one wants to find the relative position of ''C'' in the ordered list of (only) .


Place of a combination in the ordering

The number associated in the combinatorial number system of degree ''k'' to a ''k''-combination ''C'' is the number of ''k''-combinations strictly less than ''C'' in the given ordering. This number can be computed from ''C'' =  with ''c''''k'' > ... > ''c''2 > ''c''1 as follows. From the definition of the ordering it follows that for each ''k''-combination ''S'' strictly less than ''C'', there is a unique index ''i'' such that ''c''''i'' is absent from ''S'', while ''c''''k'', ..., ''c''''i''+1 are present in ''S'', and no other value larger than ''c''''i'' is. One can therefore group those ''S'' according to the possible values 1, 2, ..., ''k'' of ''i'', and count each group separately. For a given value of ''i'' one must include ''c''''k'', ..., ''c''''i''+1 in ''S'', and the remaining ''i'' elements of ''S'' must be chosen from the ''c''''i'' non-negative integers strictly less than ''c''''i''; moreover any such choice will result in a ''S'' strictly less than ''C''. The number of possible choices is \tbinomi, which is therefore the number of combinations in group ''i''; the total number of ''k''-combinations strictly less than ''C'' then is :\binom1+\binom2+\cdots+\binomk, and this is the index (starting from 0) of ''C'' in the ordered list of ''k''-combinations. Obviously there is for every ''N'' ∈ N exactly one ''k''-combination at index ''N'' in the list (supposing ''k'' ≥ 1, since the list is then infinite), so the above argument proves that every ''N'' can be written in exactly one way as a sum of ''k'' binomial coefficients of the given form.


Finding the ''k''-combination for a given number

The given formula allows finding the place in the lexicographic ordering of a given ''k''-combination immediately. The reverse process of finding the ''k''-combination at a given place ''N'' requires somewhat more work, but is straightforward nonetheless. By the definition of the lexicographic ordering, two ''k''-combinations that differ in their largest element ''c''''k'' will be ordered according to the comparison of those largest elements, from which it follows that all combinations with a fixed value of their largest element are contiguous in the list. Moreover the smallest combination with ''c''''k'' as the largest element is \tbinomk, and it has ''c''''i'' = ''i'' − 1 for all ''i'' < ''k'' (for this combination all terms in the expression except \tbinomk are zero). Therefore ''c''''k'' is the largest number such that \tbinomk\leq N. If ''k'' > 1 the remaining elements of the ''k''-combination form the -combination corresponding to the number N-\tbinomk in the combinatorial number system of degree , and can therefore be found by continuing in the same way for N-\tbinomk and instead of ''N'' and ''k''.


Example

Suppose one wants to determine the 5-combination at position 72. The successive values of \tbinom n5 for ''n'' = 4, 5, 6, ... are 0, 1, 6, 21, 56, 126, 252, ..., of which the largest one not exceeding 72 is 56, for ''n'' = 8. Therefore ''c''5 = 8, and the remaining elements form the at position . The successive values of \tbinom n4 for ''n'' = 3, 4, 5, ... are 0, 1, 5, 15, 35, ..., of which the largest one not exceeding 16 is 15, for ''n'' = 6, so ''c''4 = 6. Continuing similarly to search for a 3-combination at position one finds ''c''3 = 3, which uses up the final unit; this establishes 72=\tbinom85+\tbinom64+\tbinom33, and the remaining values ''c''''i'' will be the maximal ones with \tbinomi=0, namely . Thus we have found the 5-combination .


National Lottery example

For each of the \binom6 lottery combinations ''c''1 < ''c''2 < ''c''3 < ''c''4 < ''c''5 < ''c''6 , there is a list number ''N'' between 0 and \binom6 - 1 which can be found by adding : \binom 6 + \binom 5 + \binom 4 + \binom 3 + \binom 2 + \binom 1.


See also

*
Factorial number system In combinatorics, the factorial number system (also known as factoradic), is a mixed radix numeral system adapted to numbering permutations. It is also called factorial base, although factorials do not function as base, but as place value of ...
(also called factoradics) * Primorial number system *
Asymmetric numeral systems Asymmetric numeral systems (ANS)J. Duda, K. Tahboub, N. J. Gadil, E. J. Delp''The use of asymmetric numeral systems as an accurate replacement for Huffman coding'' Picture Coding Symposium, 2015.J. Duda''Asymmetric numeral systems: entropy coding ...
- also e.g. of combination to natural number, widely used in data compression


References


Further reading

* * * {{Citation , last=Green , first=Mark , title=Algebraic Curves and Projective Geometry , series=Lecture Notes in Mathematics , publisher=
Springer Springer or springers may refer to: Publishers * Springer Science+Business Media, aka Springer International Publishing, a worldwide publishing group founded in 1842 in Germany formerly known as Springer-Verlag. ** Springer Nature, a multinationa ...
, chapter=Restrictions of linear series to hyperplanes, and some results of Macaulay and Gotzmann , doi=10.1007/BFb0085925 , isbn=978-3-540-48188-1 , year=1989, volume=1389 , pages=76–86 Combinatorics Factorial and binomial topics