Combin(SetSize: Integer; SampleSize: Integer): Double;
Combin(SetSize: integer; SampleSize: integer): double;
SetSize. General number of elements of the set.
SampleSize. A set of elements selected from the general number of element set.
The Combin method returns the number of combinations for the specified number of objects.
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.
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.
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: