The OpenD Programming Language

uniformDiscretePMF

Computes the discrete uniform probability mass function (PMF).

@safe pure nothrow @nogc
double
uniformDiscretePMF
(
const size_t x
,
const size_t lower = 0
,
const size_t upper = 1
)

Parameters

x size_t

value to evaluate PMF

lower size_t

lower bound

upper size_t

upper bound

Examples

import mir.test: shouldApprox;

1.uniformDiscretePMF.shouldApprox == 0.5;
2.uniformDiscretePMF(1, 3).shouldApprox == 1.0 / 3;

See Also

Meta