[Previous] [Next] [Contents]

combinat::integerVectorsWeighted -- weighted integer vectors

Introduction

The library combinat::integerVectorsWeighted provides functions for counting, generating, and manipulating weighted integer vectors.

Details

Categories

Cat::CombinatorialClass

Related Domains

combinat::integerVectors

Entries

domtype

The MuPAD domain used to represent weighted integer vectors: DOM_LIST

Method count: number of weighted integer vectors

Method list: list of the weighted integer vectors

Method generator: generator for weighted integer vectors

Method generatingSeries: generating series for weighted integer vectors

Example 1

There are 5 [3,1,2]-weighted integer vectors of sum 5:

>> combinat::integerVectorsWeighted::count(5, [3,1,2])
     
                                     5
        

Here is the list:

>> combinat::integerVectorsWeighted::list(5, [3,1,2])
     
          [[1, 0, 1], [1, 2, 0], [0, 1, 2], [0, 3, 1], [0, 5, 0]]
        

Finally, this is the generating series for the [3,1,2]-weighted integer vectors:

>> combinat::integerVectorsWeighted::generatingSeries([3,1,2]);
   series(%,z)
     
                                      1
                        - -------------------------
                            2        3
                          (z  - 1) (z  - 1) (z - 1)
      
                            2      3      4      5      6
                 1 + z + 2 z  + 3 z  + 4 z  + 5 z  + O(z )
        

Example 2

We search for all the ways to pay a 17 cents postal fee using stamps of 3, 4, and 5 cents:
>> combinat::integerVectorsWeighted(17,[3,4,5]);
     
               [[1, 1, 2], [0, 3, 1], [4, 0, 1], [3, 2, 0]]
        
Another approach is to look for the partitions of 17 including only 3, 4, and 5. This is easily done by:
>> combinat::partitions::list(17,MinPart=3,MaxPart=5);
     
      [[5, 5, 4, 3], [5, 4, 4, 4], [5, 3, 3, 3, 3], [4, 4, 3, 3, 3]]
        

Background

Super-Domain

Dom::BaseDomain

Axioms

Ax::systemRep

Changes

[Previous] [Next] [Contents]


MuPAD Combinat, an open source algebraic combinatorics package