Hypergeometric distribution random generator.
procedure RandomHypGeometric(const M: Integer; const K: Integer; const N: Integer; const Results: TMtxVecInt; Seed: Integer = -1);
This routine generates Result.Length pseudo random numbers, using the hypergeometric distribution with parameters M (lot size), K (size of sampling) and N (marked elements in the lot). The random numbers are stored in the Results vector. An exception is raised if Result vector is complex.
Generate 2000 random numbers by using the hypergeometric distribution with parameters M=100, K=50 and N=30.
Uses MtxExprInt, StatRandom; procedure Example; var Res: VectorInt; begin Res.Size(2000); RandomHypGeometric(100,50,30, Res); end;
#include "MtxExprInt.hpp" #include "StatRandom.hpp" void __fastcall Example() { VectorInt Res; Res.Size(2000); RandomHypGeometric(100,50,30, Res, -1); }
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
|
What do you think about this topic? Send feedback!
|