Skip to content

SebastianoF/counting_sub_multisets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Counting sub-multisets of fixed cardinality

How many distinct handfuls of 7 may be drawn from a packet containing 4 blue candies, 3 green ones, 3 red, 2 orange and 1 yellow?

The code here provided is a tool to compute the answer to this one and similar questions, both with brute force and with an enumerative combinatorics closed form formula. Theoretical grounds about the closed form computations can be found here: http://arxiv.org/abs/1511.06142 . Use the same link to cite the code.

Python version

Based on python 3.5+. All the methods and main_example.py are back compatible with python 2.7. Use python 3 to have optimal performance (see xrange).

Install

To install the required libraries, please install pip and run

  • pip install -r requirements.txt

Testing

Unit testing with pytest:

  • pytest .

License

Counting_sub_multisets is licensed under the terms of the MIT or any later version.

About

Enumerative combinatorics methods to compute constrained k-resolutions of n.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages