IMSL C# Numerical Library

Random.NextTriangular Method 

Generate a pseudorandom number from a triangular distribution on the interval (0,1).

public virtual double NextTriangular();

Return Value

A double which specifies a pseudorandom number from a triangular distribution on the interval (0,1).

Remarks

The probability density function is f(x) = 4x, for 0 \le x \le .5, and f(x) = 4(1 - 
            x), for .5 \lt x \le 1. NextTriangular uses an inverse CDF technique.

See Also

Random Class | Imsl.Stat Namespace | Example