.DESLib.RandomLib.Variates.Discrete.DiscreteUniform

Information

DiscreteUniform

Discrete Uniform probability distribution.

Syntax

DiscreteUniform(g,i,j)

Description

Generates a random variate following the Discrete Uniform probability distribution in the interval [i,j].

The pseudo-code algorithm used for this distribution is:

1. Generate u as U(0,1).
2. Return x = i + floor((j - i + 1)*u)

Examples


(u,g) := DiscreteUniform(g,2,4);

Interface

function DiscreteUniform
  extends Var;
end DiscreteUniform;

Generated at 2024-11-21T19:25:40Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos