| Multicombination Constructor (Int32, Int32) |
Initializes a new multicombination of
Rank 0
with the supplied number of
picks from the supplied number of
choices.
Namespace:
Kaos.Combinatorics
Assembly:
KaosCombinatorics (in KaosCombinatorics.dll) Version: 6.0.0.0
Syntax public Multicombination(
int choices,
int picks
)
Parameters
- choices
- Type: SystemInt32
Number of values to pick from. - picks
- Type: SystemInt32
Number of elements in the sequence.
Exceptions Remarks
Supplying a value for choices that is greater than picks
will instantiate a k-multicombination also known as a k-combination with repetition.
Examples using System;
using Kaos.Combinatorics;
namespace ExampleApp
{
class McExample01
{
static void Main()
{
var mc = new Multicombination (choices:4, picks:3);
Console.WriteLine ($"n={mc.Choices}, k={mc.Picks}:\n");
foreach (var row in mc.GetRows())
Console.WriteLine ($"{row.Rank,2}: {row}");
}
}
}
See Also