IStatistics.Permut

Syntax

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

Parameters

SetSize is the value that sets the number of objects. The value must meet the constraints:

SampleSize is a value determining the number of objects for each permutation. The value must meet the constraint: SampleSize >= 0.

Description

The Permut method returns the number of permutations for the specified number of objects.

Comments

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.

Example

Sub Main;

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 Main;

Executing this example shows the number of permutations in the console window:

Module execution started

Number of permutations: 1685040

Module execution finished

See also:

IStatistics