Categorial random vector.


Prototype

static Veci randi(int M, int n)

Parameters

MNumber of categories.
nNumber of points to generate.

Returns

A vector of \(n\) integers between \(0\) et \(M-1\).

Description

Example

  // 100 tirages de dés à 6 faces (0, 1, ... ou 5)
  soit x = randi(6, 500);

  Figure f;
  f.plot(x, "mo");

See also

randn(int), randu(int,float,float), randb()