fbpx
Wikipedia

Combinatorial number system

In mathematics, and in particular in combinatorics, the combinatorial number system of degree k (for some positive integer k), also referred to as combinadics, or the Macaulay representation of an integer, is a correspondence between natural numbers (taken to include 0) N and k-combinations. The combinations are represented as strictly decreasing sequences ck > ... > c2 > c1 ≥ 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. The numbers less than correspond to all k-combinations of {0, 1, ..., n − 1}. 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.

The number N corresponding to (ck, ..., c2, c1) is given by

.

The fact that a unique sequence corresponds to any non-negative number N was first observed by D. H. Lehmer.[1] Indeed, a greedy algorithm finds the k-combination corresponding to N: take ck maximal with , then take ck−1 maximal with , and so forth. Finding the number N, using the formula above, from the k-combination (ck, ..., c2, c1) 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 systems, and in computational mathematics.[2][3]

The originally used term "combinatorial representation of integers" was shortened to "combinatorial number system" by Knuth,[4] who also gives a much older reference;[5] the term "combinadic" is introduced by James McCaffrey[6] (without reference to previous terminology or work).

Unlike the factorial number system, the combinatorial number system of degree k is not a mixed radix system: the part of the number N represented by a "digit" ci 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 k-combinations 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, sampling, quality control, and the analysis of lottery games.

Ordering combinations edit

A k-combination of a set S is a subset 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   possible k-combinations of a set S of n elements. Choosing, for any n, {0, 1, ..., n − 1} 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 {0, 1, ..., n − 1} are less than those representing k-combinations not contained in {0, 1, ..., n − 1}, 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 ordering of the decreasing sequence of their elements. So comparing the 5-combinations C = {0,3,4,6,9} and C′ = {0,1,3,7,9}, 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 of a number, so that C = {c1, ..., ck} describes the number

 

(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) k-combinations.

Place of a combination in the ordering edit

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 = {ck, ..., c2, c1} with ck > ... > c2 > c1 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 ci is absent from S, while ck, ..., ci+1 are present in S, and no other value larger than ci is. One can therefore group those k-combinations 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 ck, ..., ci+1 in S, and the remaining i elements of S must be chosen from the ci non-negative integers strictly less than ci; moreover any such choice will result in a k-combinations S strictly less than C. The number of possible choices is  , which is therefore the number of combinations in group i; the total number of k-combinations strictly less than C then is

 

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 edit

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 ck 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 ck as the largest element is  , and it has ci = i − 1 for all i < k (for this combination all terms in the expression except   are zero). Therefore ck is the largest number such that  . If k > 1 the remaining elements of the k-combination form the k − 1-combination corresponding to the number   in the combinatorial number system of degree k − 1, and can therefore be found by continuing in the same way for   and k − 1 instead of N and k.

Example edit

Suppose one wants to determine the 5-combination at position 72. The successive values of   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 c5 = 8, and the remaining elements form the 4-combination at position 72 − 56 = 16. The successive values of   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 c4 = 6. Continuing similarly to search for a 3-combination at position 16 − 15 = 1 one finds c3 = 3, which uses up the final unit; this establishes  , and the remaining values ci will be the maximal ones with  , namely ci = i − 1. Thus we have found the 5-combination {8, 6, 3, 1, 0}.

National Lottery example edit

For each of the   lottery combinations c1 < c2 < c3 < c4 < c5 < c6 , there is a list number N between 0 and   which can be found by adding

 

See also edit

References edit

  1. ^ Applied Combinatorial Mathematics, Ed. E. F. Beckenbach (1964), pp.27−30.
  2. ^ Generating Elementary Combinatorial Objects, Lucia Moura, U. Ottawa, Fall 2009
  3. ^ "Combinations — Sage 9.4 Reference Manual: Combinatorics".
  4. ^ Knuth, D. E. (2005), "Generating All Combinations and Partitions", The Art of Computer Programming, vol. 4, Fascicle 3, Addison-Wesley, pp. 5−6, ISBN 0-201-85394-9.
  5. ^ Pascal, Ernesto (1887), Giornale di Matematiche, vol. 25, pp. 45−49
  6. ^ McCaffrey, James (2004), Generating the mth Lexicographical Element of a Mathematical Combination, Microsoft Developer Network

Further reading edit

  • Huneke, Craig; Swanson, Irena (2006), "Appendix 5", Integral closure of ideals, rings, and modules, London Mathematical Society Lecture Note Series, vol. 336, Cambridge, UK: Cambridge University Press, ISBN 978-0-521-68860-4, MR 2266432
  • Caviglia, Giulio (2005), "A theorem of Eakin and Sathaye and Green's hyperplane restriction theorem", Commutative Algebra: Geometric, Homological, Combinatorial and Computational Aspects, CRC Press, ISBN 978-1-420-02832-4
  • Green, Mark (1989), "Restrictions of linear series to hyperplanes, and some results of Macaulay and Gotzmann", Algebraic Curves and Projective Geometry, Lecture Notes in Mathematics, vol. 1389, Springer, pp. 76–86, doi:10.1007/BFb0085925, ISBN 978-3-540-48188-1

combinatorial, number, system, mathematics, particular, combinatorics, combinatorial, number, system, degree, some, positive, integer, also, referred, combinadics, macaulay, representation, integer, correspondence, between, natural, numbers, taken, include, co. In mathematics and in particular in combinatorics the combinatorial number system of degree k for some positive integer k also referred to as combinadics or the Macaulay representation of an integer is a correspondence between natural numbers taken to include 0 N and k combinations The combinations are represented as strictly decreasing sequences ck gt gt c2 gt c1 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 The numbers less than nk displaystyle tbinom n k correspond to all k combinations of 0 1 n 1 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 The number N corresponding to ck c2 c1 is given by N ckk c22 c11 displaystyle N binom c k k cdots binom c 2 2 binom c 1 1 The fact that a unique sequence corresponds to any non negative number N was first observed by D H Lehmer 1 Indeed a greedy algorithm finds the k combination corresponding to N take ck maximal with ckk N displaystyle tbinom c k k leq N then take ck 1 maximal with ck 1k 1 N ckk displaystyle tbinom c k 1 k 1 leq N tbinom c k k and so forth Finding the number N using the formula above from the k combination ck c2 c1 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 systems and in computational mathematics 2 3 The originally used term combinatorial representation of integers was shortened to combinatorial number system by Knuth 4 who also gives a much older reference 5 the term combinadic is introduced by James McCaffrey 6 without reference to previous terminology or work Unlike the factorial number system the combinatorial number system of degree k is not a mixed radix system the part cii displaystyle tbinom c i i of the number N represented by a digit ci 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 k combinations 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 sampling quality control and the analysis of lottery games Contents 1 Ordering combinations 2 Place of a combination in the ordering 3 Finding the k combination for a given number 3 1 Example 4 National Lottery example 5 See also 6 References 7 Further readingOrdering combinations editA k combination of a set S is a subset 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 nk displaystyle tbinom n k nbsp possible k combinations of a set S of n elements Choosing for any n 0 1 n 1 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 0 1 n 1 are less than those representing k combinations not contained in 0 1 n 1 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 ordering of the decreasing sequence of their elements So comparing the 5 combinations C 0 3 4 6 9 and C 0 1 3 7 9 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 of a number so that C c1 ck describes the number 2c1 2c2 2ck displaystyle 2 c 1 2 c 2 cdots 2 c k nbsp 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 k combinations Place of a combination in the ordering editThe 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 ck c2 c1 with ck gt gt c2 gt c1 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 ci is absent from S while ck ci 1 are present in S and no other value larger than ci is One can therefore group those k combinations 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 ck ci 1 in S and the remaining i elements of S must be chosen from the ci non negative integers strictly less than ci moreover any such choice will result in a k combinations S strictly less than C The number of possible choices is cii displaystyle tbinom c i i nbsp which is therefore the number of combinations in group i the total number of k combinations strictly less than C then is c11 c22 ckk displaystyle binom c 1 1 binom c 2 2 cdots binom c k k nbsp 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 editThe 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 ck 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 ck as the largest element is ckk displaystyle tbinom c k k nbsp and it has ci i 1 for all i lt k for this combination all terms in the expression except ckk displaystyle tbinom c k k nbsp are zero Therefore ck is the largest number such that ckk N displaystyle tbinom c k k leq N nbsp If k gt 1 the remaining elements of the k combination form the k 1 combination corresponding to the number N ckk displaystyle N tbinom c k k nbsp in the combinatorial number system of degree k 1 and can therefore be found by continuing in the same way for N ckk displaystyle N tbinom c k k nbsp and k 1 instead of N and k Example edit Suppose one wants to determine the 5 combination at position 72 The successive values of n5 displaystyle tbinom n 5 nbsp 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 c5 8 and the remaining elements form the 4 combination at position 72 56 16 The successive values of n4 displaystyle tbinom n 4 nbsp 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 c4 6 Continuing similarly to search for a 3 combination at position 16 15 1 one finds c3 3 which uses up the final unit this establishes 72 85 64 33 displaystyle 72 tbinom 8 5 tbinom 6 4 tbinom 3 3 nbsp and the remaining values ci will be the maximal ones with cii 0 displaystyle tbinom c i i 0 nbsp namely ci i 1 Thus we have found the 5 combination 8 6 3 1 0 National Lottery example editFor each of the 496 displaystyle binom 49 6 nbsp lottery combinations c1 lt c2 lt c3 lt c4 lt c5 lt c6 there is a list number N between 0 and 496 1 displaystyle binom 49 6 1 nbsp which can be found by adding 49 c16 49 c25 49 c34 49 c43 49 c52 49 c61 displaystyle binom 49 c 1 6 binom 49 c 2 5 binom 49 c 3 4 binom 49 c 4 3 binom 49 c 5 2 binom 49 c 6 1 nbsp See also editFactorial number system also called factoradics Primorial number system Asymmetric numeral systems also e g of combination to natural number widely used in data compressionReferences edit Applied Combinatorial Mathematics Ed E F Beckenbach 1964 pp 27 30 Generating Elementary Combinatorial Objects Lucia Moura U Ottawa Fall 2009 Combinations Sage 9 4 Reference Manual Combinatorics Knuth D E 2005 Generating All Combinations and Partitions The Art of Computer Programming vol 4 Fascicle 3 Addison Wesley pp 5 6 ISBN 0 201 85394 9 Pascal Ernesto 1887 Giornale di Matematiche vol 25 pp 45 49 McCaffrey James 2004 Generating the mth Lexicographical Element of a Mathematical Combination Microsoft Developer NetworkFurther reading editHuneke Craig Swanson Irena 2006 Appendix 5 Integral closure of ideals rings and modules London Mathematical Society Lecture Note Series vol 336 Cambridge UK Cambridge University Press ISBN 978 0 521 68860 4 MR 2266432 Caviglia Giulio 2005 A theorem of Eakin and Sathaye and Green s hyperplane restriction theorem Commutative Algebra Geometric Homological Combinatorial and Computational Aspects CRC Press ISBN 978 1 420 02832 4 Green Mark 1989 Restrictions of linear series to hyperplanes and some results of Macaulay and Gotzmann Algebraic Curves and Projective Geometry Lecture Notes in Mathematics vol 1389 Springer pp 76 86 doi 10 1007 BFb0085925 ISBN 978 3 540 48188 1 Retrieved from https en wikipedia org w index php title Combinatorial number system amp oldid 1217839259, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.