Click or drag to resize

CombinatoricsGenerateCombinationWithRepetition Method

Generates a random combination, with repetition, by randomly selecting k of N elements.

Namespace: Altaxo.Calc
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public static int[] GenerateCombinationWithRepetition(
	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

Int32
Integer mask array of length N, for each item the number of times it was selected.
See Also