| Permutation Constructor (Int32, Int32) |
Initializes a new permutation 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 Permutation(
int choices,
int picks
)
Parameters
- choices
- Type: SystemInt32
Number of values to choose 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-permutation also known as a variation.
Examples using System;
using Kaos.Combinatorics;
namespace ExampleApp
{
class PnExample06
{
static void Main()
{
var pn = new Permutation (choices:4, picks:3);
Console.WriteLine ($"n={pn.Choices}, k={pn.Picks}, count={pn.RowCount}:\n");
foreach (var row in pn.GetRows())
Console.WriteLine ($"{row.Rank,2}: {row}");
}
}
}
See Also