CombinatoricsGenerateCombination(Int32, Int32, Random) Method |
Generate a random combination, without repetition, by randomly selecting k of N elements.
Namespace: Altaxo.CalcAssembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax public static bool[] GenerateCombination(
int n,
int k,
Random randomSource = null
)
Parameters
- n Int32
- Number of elements in the set.
- k Int32
- Number of elements to choose from the set. Each element is chosen at most once.
- randomSource Random (Optional)
- The random number generator to use. Optional; the default random source will be used if null.
Return Value
BooleanBoolean mask array of length
N, for each item true if it is selected.
See Also