m-submultisets and m-permutations of multisets elements
aa r X i v : . [ m a t h . G M ] S e p m -submultisets and m -permutationsof multisets elements Oleksandr Makhnei Roman Zatorskii
Faculty of Mathematics and Computer ScienceVasyl Stefanyk Precarpathian National UniversityIvano-Frankivsk, Ukraine [email protected] [email protected]
September 4, 2020
Abstract
The article contains some important classes of multisets. Combinatorial proofs ofproblems on the number of m -submultisets and m -permutations of multiset elementsare considered and effective algorithms for their calculation are given. In particular,the Pascal triangle is generalized in the case of multisets. Mathematics Subject Classifications:
The first spontaneous combinatorial studies of permutations of multisets, apparently,begin with the studies of the Indian mathematician Bh¯askara II (1150). The polynomialformula for the number of all permutations of an arbitrary multiset was considered byJean Prestet in the paper [18].In discrete mathematics, problems of investigating sets of objects with identical objectsoften arise. Therefore, from the middle of the last century the concept of multiset (see [23,24]) begins to gain more and more weight. Since the multiset is a natural generalization ofthe set, the problems of generalization of the classical results of combinatorics of finite setsnaturally arise. Thus, in the paper [11], Green and Kleitman, in fact, consider the problemof calculating the number of m -submultisets of a multiset. However, in the general case,few problems are solved. As a rule, authors are limited to considering only some partialbut very important classes of multisets.In the papers [3, 6], Dominique Foata introduced the concept of “joining product” α ⊤ β , which extended a number of known results concerning ordinary permutations ofsets to the case of multisets. In the book [15], Donald Knuth develops combinatorialtechniques for multisets. Using the theorem that each permutation of a multiset can bewritten as σ ⊤ σ ⊤ . . . ⊤ σ t , t > , σ j are cycles such that their elements are not repeated, Knuth gives examples ofenumeration of permutations of multisets with some restrictions.The paper [22] is very useful from an applied point of view.The so-called nondecreasing series in the permutations of multisets (see [4, 17]) haveimportant applications in the study of “order statistics”. In the case of a constant multiset { p , p , . . . , m p } in his paper [16, 212–213], Percy MacMahon showed such that the numberof permutations with k +1 series is equal to the number of permutations with mp − p − k +1series. Also, by the generatrix method, MacMahon proved such that the number ofpermutations of the multiset 1 n , , n , . . . , m n m with k series is equal to k X j =0 ( − j (cid:18) n + 1 j (cid:19)(cid:18) n − k − jn (cid:19)(cid:18) n − k − jn (cid:19) · . . . · (cid:18) n m − k − jn m (cid:19) , where n = n + n + . . . + n m . An interesting approach for enumerating submultisets of multisets is proposed in [13].Sometimes a continual apparatus is used to solve discrete mathematics problems. Forinstance, in [7], using the generatrix method, Goculenko proved an integral formula forcalculating the number of m -submultisets of the given multiset | C m ( A ) | = 12 π Z π − π exp ( − imϕ ) n Y j =1 exp { i ( k j + 1) ϕ } − exp { iϕ } − , where i = √− . In [7] the problem for m -submultisets of a multiset is also somewhatgeneralized.This paper contains some important classes of multisets. Combinatorial proofs ofproblems on the number of m -submultisets and m -permutations of multiset elements areconsidered and effective algorithms for their calculation are given. In particular, thePascal triangle is generalized in the case of multisets. The multiset A means an arbitrary disordered set of elements of some set [ A ], whichwe call the base of this multiset. Therefore, an arbitrary multiset can be written in thecanonical form A = { a k , a k , . . . , a k n n } , (1)where [ A ] = { a , a , . . . , a n } and indices k i of elements a i indicate the multiplicity ofoccurrence of the element a i to the multiset A. We can assume without loss of generalitythat k > k > . . . > k n . The multiset A ′ = { k , k , . . . , k n } of indices of multiset (1) is called its primaryspecification. Suppose the primary specification A ′ of multiset (1) is represented in thecanonical form A ′ = { λ , λ , . . . , r λ r } , r = max( k , k , . . . , k n ); (2)then the multiset of its indices A ′′ = { λ , λ , . . . , λ r } is called the secondary specificationof the multiset A. If i does not belong to the multiset A ′ , then we assume that λ i = 0 . Note that for thesecondary specification of multiset (1) we have the equality | A | = λ + 2 λ + . . . + rλ r . (3)Multisets A = { a k , a k , . . . , a k n n } and A = { a k , a k , . . . , a k r r } are called the adjointmultisets if k i = |{ k j : k j > i }| = |{ j : k j > i }| , i = 1 , , . . . , r, j = 1 , , . . . , n. (4)Here r is given by equality (2).Let us remark that k i has a certain combinatorial meaning. Namely k i is the maximumnumber of groups of i identical elements that can be chosen from multiset (1).If the equality A = A holds true, then the multiset A is called the multiset with aself-adjoint primary specification or the self-adjoint multiset.If A and A are the adjoint multisets and A ′ = { k , . . . , k n } , A ′′ = { λ , . . . , λ r } , A ′ = { k , . . . , k r } , ( A ) ′′ = { λ , . . . , λ n } , r = max( k , k , . . . , k n ) , then between the elements of their specifications, in addition to relationship (4), you cangive 11 next relationships. k i = |{ λ j + . . . + λ r : λ j + . . . + λ r > i }| , i = 1 , . . . , n, j = 1 , . . . , r, (5) λ i = (cid:12)(cid:12) { j : k j = i } (cid:12)(cid:12) , i = 1 , . . . , n, j = 1 , . . . , r, (6) k i = (cid:12)(cid:12) { λ j + . . . + λ r : λ j + . . . + λ r > i } (cid:12)(cid:12) , i = 1 , . . . , r, j = 1 , . . . , n, (7) λ i = |{ j : k j = i }| , i = 1 , . . . , r, j = 1 , . . . , n, (8) k i = (cid:12)(cid:12) { k j : k j > i } (cid:12)(cid:12) , i = 1 , . . . , n, j = 1 , . . . , r, (9) λ i = |{ j : λ j + . . . + λ r = i }| , i = 1 , . . . , n, j = 1 , . . . , r, (10) λ i = (cid:12)(cid:12) { j : λ j + . . . + λ r = i } (cid:12)(cid:12) , i = 1 , . . . , r, j = 1 , . . . , n, (11)3 · λ = k, (12) M − · k = λ, (13) M · λ = k, (14) M − · k = λ. (15)In equalities (12) and (13) k and λ are n -dimensional column vectors such that theircoordinates coincide with the elements of the specifications k ( A ) and k ( A ) accordingly.In equalities (12) and (13) M and M − are square matrices of order n of the next form M = · · · · · · · · · · · · · · · ...0 0 · · · · · · , M − = − · · · · · · · · · · · · · · · ...0 0 · · · −
10 0 · · · . In equalities (14) and (15) λ and k are similar r -dimensional column vectors, M and M − are similar matrices of order r . Remark . Since k ( A ) = k ( A ), it follows that formulas (4), (5), (6), (10), (12), (13) areanalogous to formulas (9), (7), (8), (11), (14), (15) correspondingly. In fact, formulas (12),(13) establish the one-to-one correspondence between the sets of solutions of equation (3)and the equation | A | = λ + 2 λ + . . . + nλ n , which is analogous to equation (3). A similarconclusion can be made for formulas (14), (15).Finally, we give a well-known statement about a cardinality of multiboolean of multiset(1). Proposition 2. If A = { a k , a k , . . . , a k n n } and C ( A ) is a set of submultisets of the multiset A , then | C ( A ) | = n Y i =1 ( k i + 1) . (16) The multiset with a positive integer function of a natural argument is the multiset ofthe form A = { a g (1)1 , a g (2)2 , . . . , a g ( n ) n } , (17)4here g : N → N is some nondecreasing function that satisfies the inequality g ( i ) > i forall i ∈ N .2. The multiset with a continuous function f is the multiset of the form A = { [ f (1)] , [ f (2)] , . . . , [ f ( n )] } , (18)where f is some continuous increasing function f : D → E, D = [1 , n ] , E ⊇ [1 , [ f ( n )]]that satisfies the inequality f ( x ) > x, [ ] is an integer part of the number. Specification(18) is a partial case of multiset (17).For example, for the function f = exp( x ) and n = 5 the first derivative of the multisethas the form A ′ = { , , , , } . The linear multiset is the multiset that has the form A = { a p + q , a p +2 q , . . . , a p + nqn } , (19)where p ∈ N , q ∈ Z and 1 p + q. The constant multiset is the multiset that has the form A = { a q , a q , . . . , a qn } , (20)where q > . The multiset with repetitions without restrictions is the specification that has theform A = { a ∞ , a ∞ , . . . , a ∞ n } . (21)Finally, we give an example of another class of multisets such that a number of m -submultisets is calculated relatively simply. A = { a k − , a k − , . . . , a kn − n } , k k . . . k n . (22) m -submultisets of a multiset Definition 3.
The set C m ( A ) = { B ⊆ A : | B | = m } (23)of all m -submultisets of the multiset A = { a k , . . . , a k n n } is called the set of m -combinationsof elements of this multiset.To denote the cardinality of set (23) we use the notation | C m ( A ) | = (cid:18) k k . . . k n m (cid:19) , (24)5hich was proposed in the [10].For some specifications of the multiset A the cardinality of the set has been consideredformerly. In particular, for n -element sets the classical formula (cid:18) . . . | {z } n m (cid:19) = n ! m !( n − m )! (25)is known.For a multiset with repetitions without restrictions it is known such that the formula (cid:18) ∞ ∞ . . . ∞ | {z } n m (cid:19) = ( n + m − m !( n − Theorem 4.
The number of m -submultisets ( m -combinations) of the multiset A = { a k , . . . , a k n n } is equal to (cid:18) k k . . . k n m (cid:19) = | C m ( A ) | = X λ ∈ Λ m ( A ) s Y j =1 (cid:18) k j − P si = j +1 λ i λ j (cid:19) , (27) where Λ m ( A ) is the set of those solutions of the equation s X i =1 iλ i = m (28) that satisfy the inequalities s X i = j λ i k j , j = 1 , . . . , s, (29) where s = min( m, r ) , r = max { k i } , i = 1 , . . . , n,k j is the j th element of specification (4), which is adjoint to the primary specification ofthe multiset A. Proof.
From the definition of the set Λ m ( A ) it follows that this set satisfies the conditions:1) ∀ B ∈ C m ( A ) ⇒ B ′′ ∈ Λ m ( A );2) ∀ λ ∈ Λ m ( A ) ⇒ ∃ B ∈ C m ( A ) : B ′′ = λ. Let us prove that the set Λ m ( A ) consists of all integer non-negative solutions of equa-tion (28) that satisfy inequalities (28).Indeed, let B be some multiset that belongs to set (23) and λ = { λ , λ , . . . , λ p } = B ′ . Since | B | = m, it is obvious that the elements of this secondary specification satisfyequation (28). The truth of inequalities (29) for solutions of this equation follows fromthe inequalities k x ( B ) k x ( A ), x ∈ [ B ], where the symbol k x ( B ) denotes the multiplicityof occurrence of the element x to the multiset B . 6et λ = { λ , . . . , λ s } be some solution of equation (28) that satisfies inequalities (29).We construct a multiset B ∈ C m ( A ) such that B ′′ = λ. Let us start by selecting from themultiset
A λ s different groups of s identical elements. This can always be done because λ s k s due to (4). Suppose we have already selected P si = j +1 λ i different groups ofelements such that each group consists of at least j + 1 identical elements. Let k j be themaximum number of groups of j identical elements that can be selected from the multiset A ; then there are k j − s X i = j +1 λ i groups of j identical elements in each group, in addition to other groups, in the multiset A after selecting from this multiset of the above groups of elements. Thus, the selectionof the following λ j groups of identical elements from the multiset A ensures the fulfillmentof inequalities (29).If every secondary specification from the set Λ m ( A ) is assigned a non-empty set C λm ( A ) = { B ∈ C m ( A ) : B ′′ = { λ , . . . , λ s }} (30)of the multisets from the set C m ( A ), then set (30) for λ ∈ Λ m ( A ) forms a partition of theset C m ( A ). Under this condition the equality | C m ( A ) | = X λ ∈ Λ m ( A ) | C λm ( A ) | (31)is valid. Let us find the cardinality of set (30). It has already been determined such thatthe multiset A contains k j − s X i = j +1 λ i groups of j identical elements after selecting from the multiset A of all groups of identicalelements that consist of at least j + 1 identical elements. Therefore, there is exactly (cid:18) k j − P si = j +1 λ i λ j (cid:19) different choices for these groups from the multiset A . The number of all elements be-longing to the set (30) is equal to | C λm ( A ) | = Π sj =1 (cid:18) k j − P si = j +1 λ i λ j (cid:19) (32)by the combinatorial rule of the product. Here and then we have P si>s λ i = 0. Notethat if the inequalities k > k > . . . > k n are fulfilled, then the elements of specification k ( A ), in addition to the relation (4), can be calculated according to one of the followingformulas: k j = n − k − ( j ) + 1 , j = 1 , . . . , k n , (33)7 j = k n X i = j λ i , j = 1 , . . . , k n , (34)where λ i ∈ A ′′ , k − ( j ) = min { i : k i > j } (35)is the minimum preimage of those elements of the primary specification A ′ that are notless than j . Formula (34) follows from relation (14). Now from (31) and (32) it followsthat formula (24) is valid. Example 5.
Calculate the number of all 6-submultisets of the multiset A = { a , a , a , a , a , a , a , a , a , a , a , a , a } . Here n = 13, m = 6, r = 5, s = min(5 ,
6) = 5. We get the elements of the specification k ( A ) from relations (4): k = 13 , k = 9 , k = 7 , k = 3 , k = 3 . To find the elements of the set Λ m ( A ) we seek all solutions of the equation λ + 2 λ + 3 λ + 4 λ + 5 λ = 6 . (36)There are ten solutions of this equation:(6 , , , , , (4 , , , , , (3 , , , , , (2 , , , , , (2 , , , , , (1 , , , , , (1 , , , , , (0 , , , , , (0 , , , , , (0 , , , , . Moreover, all these solutions satisfy the inequalities λ + λ + λ + λ + λ ,λ + λ + λ + λ ,λ + λ + λ ,λ + λ ,λ . For each solution of equation (36) we calculate the product (32) and seek the sum ofthese products: C ( A ) = (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) == 1716 + 4455 + 1540 + 1980 + 198 + 616 + 36 + 84 + 24 + 21 = 10670 . m -submultisets of the multiset whose primaryspecification is a positive integer function of a natural argument (17). Theorem 6.
Suppose the multiset A = { a k , . . . , a k n n } has the primary specification of theform A ′ = { g (1) , g (2) , . . . , g ( n ) } and g ( i ) > i, i = 1 , , . . . , n ; then the equality | C m ( A ) | = X λ + ... + mλ m = m m Y j =1 (cid:18) n − g − ( j ) − P mi = j +1 λ i + 1 λ j (cid:19) (37) is fulfilled for m n , where g − ( j ) = min { i : g ( i ) > j } , j = 1 , . . . , m. Proof.
First note that since the inequalities g ( n ) > n > m , we have s = min ( m, g ( n )) = m . Therefore equation (28) and inequalities (29) have the form λ + . . . + mλ m = m ; (38) m X i = j λ i k j , j = 1 , . . . , m. (39)We prove that each solution of equation (38) satisfies inequalities (39). By Λ denotethe set of solutions of equation (38). From the obvious inequalities m X i = j λ i max Λ ( m X i = j λ i ) (cid:22) mj (cid:23) , j = 1 , . . . , m, min { i : g ( i ) > j } j, j = 1 , . . . , m it follows that to prove the statement it is enough to prove the validity of inequalities (cid:22) mj (cid:23) n − j + 1 , j = 1 , . . . , m. (40)Inequalities (40) can be proved by induction on n .Thus from (33) and (35) it follows that equality (37) holds true due to Theorem 4. Example 7.
Suppose A = { a , a , a , a , a } ; then g ( i ) = 2 i − > i. We shall find C ( A ) . Here n = 5, m = 4 and the equation λ + 2 λ + 3 λ + 4 λ = 4 has 5 solutions:(4 , , , , (2 , , , , (1 , , , , (0 , , , , (0 , , , .
9e have: g − (1) = min { i : 2 i − > } = 1; g − (2) = min { i : 2 i − > } = 2; g − (3) = min { i : 2 i − > } = 2; g − (4) = min { i : 2 i − > } = 3 . Therefore, | C ( A ) | = X λ +2 λ +3 λ +4 λ =4 4 Y j =1 (cid:18) n − g − ( j ) − P i = j +1 λ i + 1 λ j (cid:19) == (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) + (cid:18) (cid:19) = 5 + 24 + 16 + 6 + 3 = 54 . If the primary specification of a multiset is given by some continuous function f ( x ),then the following theorem is useful for calculation of the number of all its m -submultisets. Theorem 8.
Suppose the primary specification of the multiset A = { a k , . . . , a k n n } has theform A ′ = {⌊ f (1) ⌋ , ⌊ f (2) ⌋ , . . . , ⌊ f ( n ⌋} , where f : D → E, D = [1 , n ] , E ⊇ [1 , ⌊ f ( n ) ⌋ ] is some continuous increasing function. Then the formula | C m ( A ) | = X λ + ... + mλ m = m m Y j =1 (cid:18) ⌊ n − max( f − ( j ) , ⌋ − P mi = j +1 λ i λ j (cid:19) (41) is fulfilled for m n .Proof. Since the function f is continuous and increases in its domain, we see that theequality min { i : f ( i ) > j } = f − ( j ) holds true for all j >
1. Hence, we obtain theequality min { i : ⌊ f ( i ) ⌋ > j } = ( max(1 , f − ( j )) , f − ( j ) ∈ Z D , max(1 , ⌊ f − ( j ) ⌋ + 1) , f − ( j ) = Z D , (42)where Z D = D ∩ N. Therefore the equality n − min { i : ⌊ f ( i ) ⌋ > j } = ⌊ n − max(1 , f − ( j )) ⌋ is valid and we have the equality k j = n − min { i : k i > j } + 1 = ⌊ n − max(1 , f − ( j )) ⌋ + 1 . Since the inequalities max λ + ... + mλ m = m ( λ j + . . . + λ m ) (cid:22) mj (cid:23) and f − ( j ) j are fulfilled for all j = 1 , . . . , m , we see that inequality (39) is equivalentto inequality (40). The proof of this theorem is finished with similar reasoning to thereasoning over the proof of theorem 6. 10 xample 9. Suppose in the multiset A = { a k , a k , a k , a k , a k , a k } the primary specification is given by the continuous function f ( x ) = √ x on the interval[1 , k i = ⌊√ i ⌋ , i = 1 , , , , , . Then k = 1 , k = 1 , k = 1 , k = 2 , k = 2 , k = 2 . Find, for example, the number of all 5-submultisets of the given multiset. We have 7solutions of the equation λ + 2 λ + 3 λ + 4 λ + 5 λ = 5 :(5 , , , , , (3 , , , , , (2 , , , , , (1 , , , , , (1 , , , , , (0 , , , , , (0 , , , , . Since f − ( x ) = min { i : f ( i ) > j } = j , we have ⌊ n − max( f − ( j ) , ⌋ = n − j . Therefore, | C ( A ) | = X λ + ... +5 λ =5 m Y j =1 (cid:18) − j − P i = j +1 λ i λ j (cid:19) . In the last sum each summand is corresponded to each of the seven solutions of the aboveequation. Moreover, only those summands are non-zero that are corresponded to the first,second and fourth solutions of above equation. Thus, | C ( A ) | = (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) = 6 + 30 + 12 = 48 . Consider the case of a linear multiset.
Theorem 10.
Suppose A is a linear multiset with the primary specification k ( A ) = { pi + q : i = 1 , . . . , n } , where p + q , q ∈ Z , p ∈ N ; then we have | C m ( A ) | = X λ ∈ Λ m ( A ) s Y j =1 (cid:18)j n − max (cid:16) , j − qp (cid:17)k + 1 − P si = j +1 λ i λ j (cid:19) , p = 0 , (43) where s = min( m, pn + q ) .If m n , then equality (43) have the form | C m ( A ) | = X λ + ... + sλ s = m s Y j =1 (cid:18)j n − max (cid:16) , j − qp (cid:17)k + 1 − P si = j +1 λ i λ j (cid:19) , p = 0 . (44)11 roof. Consider first the case when p = 0. Since the linear function f ( i ) = pi + q satisfiesthe conditions of Theorem 8, we have k j = (cid:22) n − max (cid:18) , j − qp (cid:19)(cid:23) + 1 . (45)Hence equality (43) is valid.In addition, suppose that m n ; then, using equality (45) and inequality px + q > x , x ∈ [1 , n ], from Theorem 4 it follows equality (44). Theorem 11.
The number of m -submultisets of the constant multiset A = { a q , a q , . . . , a qn } can be obtained by the following formulas.1) | C m ( A ) | = X λ ∈ Λ m ( A ) n ! λ ! · . . . · λ r !( n − λ − . . . − λ r )! , (46) where r = min( m, q ) .
2) If m q, then | C m ( A ) | = X λ +2 λ + ... + mλ m = m n ! λ ! · . . . · λ m !( n − λ − . . . − λ m )! . (47)
3) If m n, then | C m ( A ) | = X λ + ... + sλ s = m n ! λ ! · . . . · λ s !( n − λ − . . . − λ s )! , (48) where s = min( m, q ) . Proof.
1) In the case of a constant multiset we have s = min( m, q ) and k j = n , j =1 , , . . . , s. Therefore, | C m ( A ) | = X λ ∈ Λ m ( A ) s Y j =1 (cid:18) n − P si = j +1 λ i λ j (cid:19) = X λ ∈ Λ m ( A ) n ! λ ! · . . . · λ s !( n − λ − . . . − λ s )! .
2) If m q , then the set Λ m ( A ) coincides with the set of all solutions of the equation λ + 2 λ + . . . + mλ m = m. Therefore formula (46) has the form (47).3) If m n, then inequalities (29) hold for all j = 1 , . . . , s and equality (48) isvalid. Remark . From Theorem 11 (see item 2)) and equality (26) it follows that X λ +2 λ + ... + mλ m = m n ! λ ! · . . . · λ m !( n − λ − . . . − λ m )! = (cid:18) n + m − m (cid:19) . Notice that the left side of this identity consists only of those summands such that n − ( λ + . . . + λ m ) > . Generatix method
A generatix is the function f ( t ) = n Y i =1 k i X j =0 t j = k + ... + k n X i =0 | C i ( A ) | t i for the calculation of the number of m -submultisets of the multiset A = { a k , . . . , a k n n } . Therefore, after m -fold differentiation of this function we obtain the equality | C m ( A ) | = 1 m ! · d m f ( t ) dt m | t =0 . We have d m f ( t ) dt m = X r + ... + r n = m m ! r ! · . . . · r n ! d r g ( t ) dt r · . . . · d r n g n ( t ) dt r n , where g i ( t ) = 1 + t + t + . . . + t k i . Since d r i ( g i ( t )) dt r i = r r i i + ( r i + 1) r i t + . . . + k r i i t k i − r i and d r i ( g i ( t )) dt r i | t =0 = r i ! , we obtain | C m ( A ) | = 1 m ! · d m f ( t ) dt m | t =0 = 1 m ! X r + ... + r n = m m ! r ! · . . . · r n ! · r ! · . . . · r n ! = X r + ... + r n = m , where 0 r i k i . Thus, we have the next theorem.
Theorem 13.
The number of m -submultisets of the multiset A = { a k , . . . , a k n n } is equal to | C m ( A ) | = X r + r + ... + r n = m r i k i , i =1 ,...,n . (49)Let us use Theorem 13 to determine the formula for the calculation of the number of m -submultisets of the constant multiset A = { a q , a q , . . . , a qn } . s , s , . . . , s n ) of the equation r + r + . . . + r n = m (50)satisfies the inequalities 0 s i q, then an arbitrary permutation of the components of this solution leads to a new solutionof this equation. Therefore we need to find all disordered solutions of equation (50), i. e.,such solutions ( r , r , . . . , r n ) that satisfy the inequalities r > r > . . . > r n > r , r , . . . , r n ) are λ zeros, λ ones, and so on; thenall disordered solutions of equation (50) can be counted using the system of equations ( λ + 1 λ + . . . + qλ q = m,λ + λ + . . . + λ q = n. Therefore, C m ( A ) = X · λ +1 λ + ... + qλ q = mλ + λ + ... + λ q = n n ! λ ! λ ! · . . . · λ q ! . Thus the next theorem is valid.
Theorem 14.
The number of m -submultisets of the constant multiset A = { a q , a q , . . . , a qn } is equal to C m ( A ) = X · λ +1 λ + ... + qλ q = mλ + λ + ... + λ q = n n ! λ ! λ ! · . . . · λ q ! . (51) Remark . If in Theorem (14) m q, then, using equality (26) (see page 6), we obtainthe following combinative identity X λ +1 λ + ... + mλ m = mλ + λ + ... + λ m = n n ! λ ! λ ! · . . . · λ m ! = (cid:18) m + n − m (cid:19) . Example 16.
Let us find the number of those m -submultisets of the multiset A = { x ∞ , x ∞ , . . . , x ∞ n } such that they contain each element of basis [ A ] (see [19]) of the multiset A . To find them we use the generatrix W ( t ) = ∞ X i =1 t i ! n = t n (1 − t ) − n = t n ∞ X i =0 n i i ! t i = ∞ X i =0 n i i ! t n + i . Put n + i = m ; then W ( t ) = ∞ X m = n n m − n ( m − n )! t m = ∞ X m = n (cid:18) m − n − (cid:19) t m .
14e shall consider one more class of multisets with primary specification (22), i. e., A = n a l − , . . . , a ln − n o , l l . . . l n such that their number of m -submultisets is calculated relatively easily. As shown in [19],the generatrix of the number of m -submultisets of such multisets has the form W ( t ) = n Y i =1 2 li − X j =0 t j . However 1 + t + . . . + t l − = (1 + t )(1 + t )(1 + t ) · . . . · (1 + t l − )whence, using the designation t i = x i +1 , i = 0 , . . . , l − , we get W ( t ) = (1 + x ) m · . . . · (1 + x l n ) m n . Obviously, the number | C m ( A ) | is equal to the sum of coefficients of the monomials K ( λ , . . . , λ l n ) x λ · . . . · x λ ln l n with l n variables such that their indices λ , λ , . . . , λ l n are the components of solutionsof the equation λ + 2 λ + 2 λ + . . . + 2 l n − λ l n = m and these indices satisfy the inequalities λ i k i − , i = 1 , . . . , l n , where ( k , . . . , k ln − ) is the specification of the multiset A that is adjoint to the multiset A. Therefore, | C m ( A ) | = X +2 λ + ... +2 ln − λ ln = mλ i k i − , i =1 ,...,l n l n Y i =1 (cid:18) k i − λ i (cid:19) . Thus the next theorem is valid.
Theorem 17.
The number of m -submultisets of the multiset A = { a l − , . . . , a ln − n } , l l . . . l n is equal to | C m ( A ) | = X +2 λ + ... +2 ln − λ ln = mλ i k i − , i =1 ,...,l n l n Y i =1 (cid:18) k i − λ i (cid:19) . (52)15 xample 18. Suppose we have the multiset A = { a , a , a , a } . We seek the primaryspecification of the adjoint multiset A : k = (4 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , . Therefore, k = 4 , k = 4 , k = 3 , k = 2 , k = 1 . The equation λ + 2 λ + 4 λ + 8 λ + 16 λ = 21have 60 solutions. But only 13 solutions satisfy the inequalities λ k , λ k , λ k , λ k , λ k . List of these solutions:(3 , , , , , (3 , , , , , (3 , , , , , (3 , , , , , (3 , , , , , (1 , , , , , (1 , , , , , (1 , , , , , (1 , , , , , (1 , , , , , (1 , , , , , (1 , , , , , (1 , , , , . Thus, we have | C ( A ) | = (cid:18) (cid:19) · (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) · (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) · (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) · (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) · (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) · (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) · (cid:18) (cid:19) + (cid:18) (cid:19) · (cid:18) (cid:19) · (cid:18) (cid:19) = 492 . m -submultisets of an arbitrarymultiset Let us construct a recursive algorithm for calculation of the number of m -submultisets ofthe multiset A = { a k , a k , . . . , a k n n } . We use for the number C m ( A ) the notation from [10]. Then we have n Y i =1 (1 + t + t + . . . + t k i ) = r X i =0 (cid:18) k , k , . . . , k n i (cid:19) t i , r = P ni =1 k i . If the coefficients A ( i ) = (cid:18) k , k , . . . , k l − i (cid:19) , i = 0 , . . . , s of the polynomial s X i =0 A ( i ) t i = l − Y i =1 (1 + t + . . . + t k i ) , s = l − X i =1 k i are known, then the coefficients B ( j ) = (cid:18) k , k , . . . , k l j (cid:19) , j = 0 , , . . . , s + k l of the polynomial s + k l X j =0 B ( j ) t j = (1 + t + . . . + t k l ) · s X i =0 A ( i ) t i are obtained by summing k l + 1 last elements of the row0 . . . | {z } k l A (0) A (1) . . . A ( j ) . More exactly, we have (cid:18) k , k , . . . , k l j (cid:19) = j X q = j − k l (cid:18) k , k , . . . , k l − q (cid:19) , j = 0 , . . . , s + k l , (53)where (cid:18) k , k , . . . , k l − q (cid:19) = 0if q < q > s. The calculation process is convenient to design in the form of a generalized Pascaltriangle.If the first element of the multiset A has multiplicity k , then the calculation is begunfrom the zero row of the table 0 . . . | {z } k . . . | {z } k . The first row of this table is obtained with the help of the zero row by using relation (53).Then the first row has the form 0 . . . | {z } k . . . | {z } k +1 . . . | {z } k , k is the multiplicity of the second element of multiset A. Continuing the calculation process to the n th line inclusive, we obtain the requirednumbers C i ( A ) , i = 0 , . . . , r + 1 , r = n X i =1 k i . Example 19.
Suppose we have the multiset A = { a , a , a , a } ;then, using the above algorithm, we obtain the table C ( A ) C ( A ) C ( A ) C ( A ) C ( A ) C ( A ) C ( A ) C ( A ) C ( A ) C ( A ) C ( A ) C ( A )0 0 0 0 1 0 0 0 00 0 0 1 1 1 1 1 0 0 00 0 0 1 2 3 4 4 3 2 1 0 0 00 1 3 6 10 13 14 13 10 6 3 1 01 4 9 16 23 27 27 23 16 9 4 1The results are written in the last row of this table: C ( A ) = 1, C ( A ) = 4, C ( A ) = 9, C ( A ) = 16, . . . At the same time the equality X i =0 C i ( A ) = (4 + 1)(3 + 1)(3 + 1)(1 + 1) = 160is fulfilled.The Pascal triangle for the set A = { a , a , a , a } , according to the above algorithm,has the form C ( A ) C ( A ) C ( A ) C ( A ) C ( A )0 1 00 1 1 00 1 2 1 00 1 3 3 1 01 4 6 4 1In addition, we have the relation X i =0 C i ( A ) = (1 + 1)(1 + 1)(1 + 1)(1 + 1) = 16 . Remark . If the multiplicities of the multiset elements are large, then it is convenientto use the relations (cid:18) k , k , . . . , k l j (cid:19) = (cid:18) k , k , . . . , k l j − (cid:19) + (cid:18) k , k , . . . , k l − j (cid:19) − (cid:18) k , k , . . . , k l − j − k l − (cid:19) , = 0 , . . . , l X i =1 k i , which follow from relations (53). This can significantly reduce the number of operations. Remark . Since any k -submultiset B of the multiset A uniquely corresponds to ( | A |− k )-submultiset A − B of this multiset, we have (cid:18) k , k , . . . , k l j (cid:19) = (cid:18) k , k , . . . , k l s − j (cid:19) , j = 0 , . . . , s, where s = P li =1 k i , i. e., the numbers that are equidistant from the ends of each row ofthe table are equal to each other. Thus, if m > ⌊ s ⌋ , then instead of calculating | C m ( A ) | it is more convenient to calculate | C s − m ( A ) | . m -permutations of the multiset elements Definition 22.
The set of all ordered m -samples of elements of the multiset A = { a k , . . . , a k n n } is called the set of m -permutations on this multiset. By P m ( A ) we de-note this set.The following statement is well known. Proposition 23.
The number of all permutations of elements of the multiset A is equalto | P | A | ( A ) | = ( k + k + . . . + k n )! k ! k ! · . . . · k n ! . To determine the number of all m -permutations of the multiset A = { a k , . . . , a k n n } we use the theorem (see Theorem 4 on page 6) about the number of all m -submultisets( m -combinations) of this multiset.In this theorem it was found that the number of all m -combinations of the multiset A is equal to | C m ( A ) | = X λ ∈ Λ m ( A ) | C λm ( A ) | , where C λm ( A ) = { B ∈ C m ( A ) : B ′′ = { λ , . . . , λ n }} . Obviously, | P m ( A ) | = X λ ∈ Λ m ( A ) | P | B | ( B ) | · | C λm ( A ) | (54)but | P | B | ( B ) | = m !1! λ λ · . . . · s ! λ s whence equality (54) leads to the following theorem. 19 heorem 24. The number of all m -permutations of the multiset A = { a k , . . . , a k n n } isequal to | P m ( A ) | = X λ ∈ Λ m ( A ) m !1! λ λ · . . . · s ! λ s s Y j =1 (cid:18) k j − P si = j +1 λ i λ j (cid:19) , (55) where Λ m ( A ) is the set of those solutions of the equation s X i =1 iλ i = m (56) that satisfy the inequalities s X i = j λ i k j ; j = 1 , . . . , s, (57) s = min( m, r ) , r = max { k i } , i = 1 , . . . , n,k j is the j th element of specification (4), which is adjoint to the primary specification ofthe multiset A. The number of solutions of the equation P si =1 iλ i = m increases with increasing m and s . For example, already at m = s = 20 this equation has 627 solutions. Consequentlyformula (55) is not always convenient for practical use because it requires large amountsof computation.We construct an algorithm for calculating m -permutations of elements of the multiset A = { a k , . . . , a k n n } such that in many cases this algorithm eliminates these shortcomings.Let | P m ( A ) | = (cid:20) k k · · · k n m (cid:21) . In particular, if k = k = . . . = k n = 1 , then the multiset coincides with its basis andthis multiset is an ordinary set, i. e., . . . | {z } n m = n !( n − m )! , m n. If k = n , k = k = . . . = k n = 0 , then (cid:20) nm (cid:21) = 1 , m n. In the case, where the multiset A has specification (21) (see page 5), we have theobvious equality ∞ ∞ · · · ∞ | {z } n m = n m . heorem 25. For any r = 2 , , . . . , n the equality (cid:20) k k . . . k r i (cid:21) == P min( i,k + ... + k r − ) j =0 (cid:0) ij (cid:1) " k k . . . k r − i , i k r , P min( i,k + ... + k r − ) j = i − k r (cid:0) ij (cid:1) " k k . . . k r − i , k r < i k + . . . + k r (58) is fulfilled, where i | A | . Proof.
The generatrix for the number of permutations (cid:20) k k . . . k r i (cid:21) of elements of the multiset A = { a k , . . . , a k n n } has the form n Y i =1 k i X j =0 t j j ! = k + ... + k n X i =0 (cid:20) k k . . . k n i (cid:21) t i i ! . Hence, k + ... + k r − X j =0 (cid:20) k k . . . k r − j (cid:21) t j j ! ! · k r X s =0 t s s ! = k + ... + k r X i =0 (cid:20) k k . . . k r i (cid:21) t i i ! . Since k + ... + k r − X j =0 (cid:20) k k . . . k r − j (cid:21) t j j ! ! k r X s =0 t s s ! == k + ... + k r X i =0 X j + s = i (cid:20) k k . . . k r − j (cid:21) t i j ! s ! ! , we have (cid:20) k k . . . k r i (cid:21) = X j + s = i i ! j ! s ! (cid:20) k k . . . k r − j (cid:21) = X j + s = i (cid:18) ij (cid:19) (cid:20) k k . . . k r − j (cid:21) . For both expressions (cid:0) ij (cid:1) and (cid:20) k , . . . , k r − j (cid:21) in the last sum to have meaning, it isnecessary to have the inequalities j i and j k + . . . + k r − , i. e., the inequality j min( i, k + . . . + k r − ) is valid. If i k r , then from the inequality 0 s k r it followsthat the smallest value of the index j under the restriction j + s = i is j = 0 . If i > k r , then the smallest value of the index j is j = i − k r . This completes the proof. 21ecurrence equality (58) can be used to calculate the number of all m -permutationsof the multiset A = { a k , . . . , a k n n } , where m = 0 , . . . , | A | . For this purpose1. Write the row of k + 1 ones, which are numbers of i -permutations (cid:20) k i (cid:21) on themultiset A = { a k } , i = 0 , . . . , k . This row is called the basic row.2. Under the basic row we construct a table with k + 1 columns and k + k + 1 rows.We number rows of the table from top to bottom by numbers from 0 to k + k .
3. In the i th row of the table we write the first k + 1 elements of the i th row of thePascal triangle. If the i th row of the Pascal triangle contains the less than k + 1 elements,then we add the required number of zeros.4. In the lower left corner of the table we replace the written numbers by zeros so thatthe zeros form a right isosceles triangle with the leg k .
5. We calculate the sum of the products of elements for the i th ( i = 0 , . . . , k + k )row of the table and the corresponding elements of the basic row. The resulting numberof permutations (cid:20) k , k i (cid:21) , i = 0 , . . . , k + k is added to the i th row on the right.6. If the number of rows of the last table is greater than the cardinality of the multiset,then the calculation is completed and the result of the algorithm is the column of numberssuch that these numbers were added to the table on the right. Otherwise, we transposethe column of numbers that were added to the table on the right, consider this as thebase row of the new table, the parameters of the table are increased by the value of themultiplicity of the next element of the multiset, and then we go to item 2.Thus, if the multiset A has the cardinality basis n, then the execution of the algorithmrequires the construction of the ( n − Example 26.
Find the number of all m -permutations of the multiset A = { a , a , a } , m =0 , , . . . , . For this purpose we build the following tables:1 1 10 1 0 0 11 1 1 0 22 1 2 1 43 1 3 3 74 1 4 6 115 0 5 10 156 0 0 15 15 22 2 4 7 11 15 150 1 0 0 0 0 0 0 11 1 1 0 0 0 0 0 32 1 2 1 0 0 0 0 93 1 3 3 1 0 0 0 264 1 4 6 4 1 0 0 725 1 5 10 10 5 1 0 1916 0 6 15 20 15 6 1 4827 0 0 21 35 35 21 7 11348 0 0 0 56 70 56 28 24229 0 0 0 0 126 126 34 453610 0 0 0 0 0 252 210 693011 0 0 0 0 0 0 462 6930Therefore, P ( A ) = 1 , P ( A ) = 3 , P ( A ) = 9 , P ( A ) = 26 , P ( A ) = 72 , P ( A ) = 191 ,P ( A ) = 482 , P ( A ) = 1134 , P ( A ) = 2422 , P ( A ) = 4536 , P ( A ) = 6930 ,P ( A ) = 6930 . This algorithm is effective for multisets of relatively large cardinality but with a smallbase. For example, to calculate the number of 20-permutations on the multiset A = { a , a , a } this algorithm requires the construction of two tables of sizes 4 ×
13 and13 ×
26 accordingly and the calculation by the formula requires the analysis of the set of627 solutions of equation (56) and significant calculations.
Example 27.
For the multiset A = { a , a , a , a , a , a , a , a , a , a } we have P ( A ) = 1 , P ( A ) = 10 , P ( A ) = 97 , P ( A ) = 912 , P ( A ) = 8299 ,P ( A ) = 72946 , P ( A ) = 617874 , P ( A ) = 5029948 , P ( A ) = 39237380 ,P ( A ) = 292327224 , P ( A ) = 2072330400 , P ( A ) = 13920355680 ,P ( A ) = 88179787080 , P ( A ) = 523856052720 , P ( A ) = 2899520704080 ,P ( A ) = 14831963546400 , P ( A ) = 6938695764000 ,P ( A ) = 292608485769600 , P ( A ) = 1088829613872000 ,P ( A ) = 3456466684070400 , P ( A ) = 8834757003072000 ,P ( A ) = 162615846032640000 , P ( A ) = 162615846032640000 . eferences [1] M. Aigner. Combinatorial theory . Springer-Verlag, 1979.[2] L. Babai and P. Frankl.
Linear algebra methods in combinatorics with applicationsto geometry and computer science . Preliminary Version 2. Department of ComputerScience the University of Chicago, 1992.[3] P. Cartier and D. Foata.
Probl`emes combinatoires de commutation et r´earrangements ,volume 85 of
Lecture Notes in Mathematics . Springer-Verlag, 1969.[4] F. N. David and D. E. Barton.
Combinatorial Chance . Griffin, 1962.[5] P. Doubilet, G.-C. Rota, and R. Stanley. On the foundations of combinatorial theory.VI. The idea of generating function. In
Proceedings of the Sixth Berkely Symposiumon Mathematical Statistics and Probability , volume II, pages 267–318. University ofCalifornia Press, 1972.[6] D. Foata. Etude alg´ebrique de certains probl`emes d’analyse combinatoire et du calculdes probabilit´es.
Publ. Inst. Statist. Univ. Paris , 14:81–241, 1965.[7] V. V. Goculenko. A formula for the number of combinations with constrained repe-titions and its application.
Prikladnaya Diskretnaya Matematika , 20(2):71–77, 2013.DOI 10.17223/20710410/20/8.[8] V. V. Goculenko. Combinatorial numbers of the finite multiset patitions.
PrikladnayaDiskretnaya Matematika , 22(4):67–72, 2013. DOI 10.17223/20710410/22/7.[9] R. L. Graham, M. Gr¨otschel, and L. Lov´asz.
Handbook of Combinatorics . Volumes 1and 2. Elsevier (North-Holland), Amsterdam, and MIT Press, Cambridge, 1995.[10] C. Green and D. J. Kleitman. Proof techniques in the theory of finite sets. In
Studiesin combinatorics , edited by G.-C. Rota, volume 17 of
M. A. A. Studies in Math. ,pages 22–79. Math. Assoc. of Amer., Washington, DC, 1978.[11] D. H. Greene and D. E. Knuth.
Mathematics for the analysis of algorithms .Birkh¨auser, 1990.[12] I. P. Goulden and D. M. Jackson.
Combinatorial enumeration . John Wiley & Sons,1983.[13] J. Hage. Enumerating submultisets of multisets.
Inf. Proc. Letters , 85(4):221–226,2003.[14] M. Hall.
Combinatorial theory . John Wiley & Sons, 1986.[15] D. E. Knuth.
The art of computer pragramming . Volume 3. Addison-Wesley, 1998.[16] P. A. MacMahon.
Combinatory analysis . Cambridge, 1915.[17] C. L. Mallows. Some aspects of the random sequence.
Annals of Math. Statistics ,36:236–260, 1965.[18] J. Prestet. ´El´emens de Math´ematiques . Paris, 1675.[19] J. Riordan.
An introduction to combinatorial analysis . John Wiley & Sons, New York,1958. 2420] J. Riordan.
Combinatorial identities . John Wiley & Sons, 1968.[21] H. J. Ryser.
Combinatorial mathematics . Mathematical Association of America, 1963.[22] C. Savage and H. Wilf. Pattern avoidance in compositions and multiset permutations.
Adv. in Appl. Math. , 36(2):194–201, 2006.[23] R. P. Stanley.
Enumerative Combinatorics . Volume 1. Cambridge University Press,1997.[24] R. P. Stanley.
Enumerative Combinatorics . Volume 2. Cambridge University Press,1999.[25] H. S. Wilf.