Permut(SetSize: Integer; SampleSize: Integer): Double;
SetSize is the value that sets the number of objects. The value must meet the constraints:
SetSize > 0;
SetSize >= SampleSize.
SampleSize is a value determining the number of objects for each permutation. The value must meet the constraint: SampleSize >= 0.
The Permut method returns the number of permutations for the specified number of objects.
A permutation is any set or subset of objects or events whose internal order has significance. Permutations differ from combinations whose internal order has no significance. This function is used, for example, to calculate lottery probabilities.
To execute the example, add a link to the Stat system assembly.
Sub UserProc;
Var
st: Statistics;
d0: Double;
Begin
st := New Statistics.Create;
d0 := st.Permut(120,3);
If st.Status <> 0 Then
Debug.WriteLine(st.Errors);
Else
Debug.WriteLine("Number of permutations: " + d0.ToString);
End If;
End Sub UserProc;
Executing the example shows the number of permutations in the console window:
Unit execution started
Number of permutations: 1685040
Unit execution finished
See also: