N1: Integer;
The N1 property determines size of the entire population.
The property value must satisfy the conditions: 1 ≤ N ≤ N1 and 1 ≤ M ≤ N1. Where:
Where N is the volume of the single sample determined by value of the ISmHyperGeometricDistribution.N property.
M1 is the number of successful elements in the entire population determined by value of the ISmHyperGeometricDistribution.M property.
To execute the example, add a link to the Stat system assembly.
Sub UserProc;
Var
Distrib: ISmHyperGeometricDistribution;
Values: Array Of Double;
i: Integer;
Cnt: Integer = 10;
Begin
Distrib := New SmHyperGeometricDistribution.Create;
Distrib.N1 := 10000;
Distrib.N := 500;
Distrib.M := 10;
Values := Distrib.RandomVector(Cnt);
For i := 0 To Cnt - 1 Do
Debug.WriteLine(Values[i]);
End For;
End Sub UserProc;
After executing the example the console window shows a sample of pseudo-random values from discrete hypergeometric distribution based on selected parameters.
See also: