IStatistics.HypGeomDist

Syntax

HypGeomDist(SuccessfulTrials: Integer; Trials: Integer; SuccessfulInPopulation: Integer; PopulationSize: Integer): Double;

Parameters

SuccessfulTrials. The number of successful trials in the sample. This value must meet the following restrictions:

Trials. Sample size. Tolerance range: [0; PopulationSize];

SuccessfulInPopulation. The number of successful trials in general population. Tolerance range: [0; PopulationSize].

PopulationSize. Size of population. This value must meet the following constraint: PopulationSize >= 0.

Description

The HypGeomDist method returns the hypergeometric distribution.

Comments

The method returns probability for the specified number of successful trials in a sample, if you have defined the sample size, the number of successful trials in a universal set and the size of the universal set. The function is used to solve problems involving a finite universal set, where each observation is assumed to be a success or a failure and each subset of the specified size can be selected with equal probability. The method is used for samples with no repeats from a finite universal set.

Example

Sub UserProc;
Var
    st: Statistics;
    d0: Double;
Begin
    st := New Statistics.Create;
    d0 := st.HypGeomDist(14820);
    If st.Status <> 0 Then
        Debug.WriteLine(st.Errors);
    Else
        Debug.WriteLine("Distribution: " + d0.ToString);
    End If;
End Sub UserProc;

Executing this example shows hypergeometric distribution value in the console window:

Module execution started

Distribution: 0.36326109345456303

Module execution finished

See also:

IStatistics | Hypergeometric distribution