inferi.combinatorics¶
Contains tools for combining and permutating collections.

inferi.combinatorics.
permutations
(n, r=None)[source]¶ Returns the number of ways of arranging r elements of a set of size n in a given order  the number of permuatations.
Parameters:  n (int) – The size of the set containing the elements.
 r (int) – The number of elements to arange. If not given, it will be assumed to be equal to n.
Raises:  TypeError – if nonintegers are given.
 ValueError – if r is greater than n.
Return type: int

inferi.combinatorics.
combinations
(n, r=None)[source]¶ Returns the number of ways of combining r elements of a set of size n, where order doesn’t matter
Parameters:  n (int) – The size of the set containing the elements.
 r (int) – The number of elements to arange. If not given, it will be assumed to be equal to n.
Raises:  TypeError – if nonintegers are given.
 ValueError – if r is greater than n.
Return type: int

inferi.combinatorics.
multiplications
(*counts)[source]¶ Returns the product of the integers given  useful for calculating the number of simple events in a multistage process.
Raises: TypeError – if nonintegers are given. Return type: int

inferi.combinatorics.
permutate
(collection, r=None)[source]¶ Generates all the permutations of a given iterable, of a given length.
It is essentially a wrapper around the builtin
itertools.permutations
.Parameters:  collection (iterable) – The iterable to permutate.
 r (int) – The number of elements to arange. If not given, it will be assumed to be equal to the length of the collection.
Raises: ValueError – if r is greater than the length of the collection.
Return type: tuple

inferi.combinatorics.
combine
(collection, r=None)[source]¶ Generates all the combinations of a given iterable, of a given length.
It is essentially a wrapper around the builtin
itertools.combinations
.Parameters:  collection (iterable) – The iterable to combine.
 r (int) – The number of elements to arange. If not given, it will be assumed to be equal to the length of the collection.
Raises: ValueError – if r is greater than the length of the collection.
Return type: set