IMath.Combin

Fore Syntax

Combin(SetSize: Integer; SampleSize: Integer): Double;

Fore.NET Syntax

Combin(SetSize: integer; SampleSize: integer): double;

Parameters

SetSize. General number of elements of the set.

SampleSize. A set of elements selected from the general number of element set.

Description

The Combin method returns the number of combinations for the specified number of objects.

Comments

Parameters must be integer and non-negative numbers.

The value of the SampleSize parameter must not exceed the value of the SetSize parameter.

A combination is any set or a subset of objects, regardless of their order. Combinations differ from permutations, for which order is relevant.

Fore Example

To execute the example, add a link to the MathFin system assembly.

Sub UserProc;
Var
    r: Double;
Begin
    r := Math.Combin(8,2);
    Debug.WriteLine(r);
End Sub UserProc;

After executing the example the console window displays the number of combinations which is 28.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.MathFin;

Public Shared Sub Main(Params: StartParams);
Var
    r: Double;
    Math: MathClass = New MathClass();
Begin
    r := Math.Combin(8,2);
    System.Diagnostics.Debug.WriteLine(r);
End Sub;

See also:

IMath