CombinatoricsGenerateVariationWithRepetition Method |
Generate a random variation, with repetition, by randomly selecting k of n elements with order.
Namespace: Altaxo.CalcAssembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax public static int[] GenerateVariationWithRepetition(
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. Elements can be chosen more than once.
- randomSource Random (Optional)
- The random number generator to use. Optional; the default random source will be used if null.
Return Value
Int32An array of length
K that contains the indices of the selections as integers of the interval
[0, N).
See Also