package combinations
Contains classes required to compute all combinations of k shares which can be chosen from among n shares. This is needed for the complete verification of a SecretSharing instance.
- Alphabetic
- By Inheritance
- combinations
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- class BinomialCombinator[T] extends Tracing
Produces all combinations of k unordered items which can be chosen from among n items (k <= n).
Produces all combinations of k unordered items which can be chosen from among n items (k <= n). If k == n every item is to be selected. On the other hand if k == 0 none item will be selected. In the both cases there is exactly one solution: all items or the the empty set. If k > 0 and k < n we have two choices: Either a particular item will be selected or discarded. In the former case k decreases and in the latter case k remains unchanged. Now we have a new problem instance which can be solved recursively.
- T
the type of the provided items
- class Combination[T] extends Tracing
A particular combination of either selected, discarded or unprocessed items.
A particular combination of either selected, discarded or unprocessed items.
- T
the type of the items
- class Element[T] extends AnyRef
Acts as container for items which can either be SELECTED, DISCARDED or unprocessed (NEITHER).
Acts as container for items which can either be SELECTED, DISCARDED or unprocessed (NEITHER).
- T
the type of the item
- class LazyBinomialCombinator extends Tracing
Produces all combinations of k unordered integers which can be chosen from among n integers (k <= n) by applying a lexicographic algorithm.
Produces all combinations of k unordered integers which can be chosen from among n integers (k <= n) by applying a lexicographic algorithm. The starting point is given by the lexicographic smallest word comprising k integers, e.g. (0,1,2) for k == 3. First, the algorithm evaluates the rightmost column in order to find new combinations, e.g. (0,1,3), (0,1,4) and (0,1,5) for n == 6. Now the algorithm has run out of options for the rightmost column and switches to (0,2,3) but not (0,2,1) since the latter would be identical to (0,1,2). In due course more to the left columns have to be considered, e.g. at (0,4,5). The algorithm finishes if the options have run out for all columns. For k == 3 and n == 6 that would be (3,4,5). The total number of solutions is given by the binomial coefficient "n choose k". For the given example that would be 20. To compute actual solution sizes , see WolframAlpha.