procedure RandomHypGeometric(const M: Integer; const K: Integer; const N: Integer; const results: TMtxVecInt; Seed: Integer);
Hypergeometric distribution random generator.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | M | Integer | |
| 2 | K | Integer | |
| 3 | N | Integer | |
| 4 | results | TMtxVecInt | |
| 5 | Seed | Integer |
Result: stored in self (calling object)
Remarks:
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.
Examples
Uses MtxExprInt, StatRandom;
procedure Example;
var Res: VectorInt;
begin
Res.Size(2000);
RandomHypGeometric(100,50,30, Res);
end;