# Triangular distribution

Parameters Probability density function Cumulative distribution function $a:~a\in (-\infty ,\infty )$ $b:~a $c:~a\leq c\leq b\,$ $a\leq x\leq b\!$ ${\begin{cases}0&{\mathrm {for\ }}x ${\begin{cases}0&{\mathrm {for\ }}x ${\frac {a+b+c}{3}}$ ${\begin{cases}a+{\frac {{\sqrt {(b-a)(c-a)}}}{{\sqrt {2}}}}&{\mathrm {for\ }}c\geq {\frac {a+b}{2}},\\[6pt]b-{\frac {{\sqrt {(b-a)(b-c)}}}{{\sqrt {2}}}}&{\mathrm {for\ }}c\leq {\frac {a+b}{2}}.\end{cases}}$ $c\,$ ${\frac {a^{2}+b^{2}+c^{2}-ab-ac-bc}{18}}$ ${\frac {{\sqrt 2}(a\!+\!b\!-\!2c)(2a\!-\!b\!-\!c)(a\!-\!2b\!+\!c)}{5(a^{2}\!+\!b^{2}\!+\!c^{2}\!-\!ab\!-\!ac\!-\!bc)^{{\frac {3}{2}}}}}$ $-{\frac {3}{5}}$ ${\frac {1}{2}}+\ln \left({\frac {b-a}{2}}\right)$ $2{\frac {(b\!-\!c)e^{{at}}\!-\!(b\!-\!a)e^{{ct}}\!+\!(c\!-\!a)e^{{bt}}}{(b-a)(c-a)(b-c)t^{2}}}$ $-2{\frac {(b\!-\!c)e^{{iat}}\!-\!(b\!-\!a)e^{{ict}}\!+\!(c\!-\!a)e^{{ibt}}}{(b-a)(c-a)(b-c)t^{2}}}$

In probability theory and statistics, the triangular distribution is a continuous probability distribution with lower limit a, upper limit b and mode c, where a < b and a ≤ c ≤ b. The probability density function is given by $Probability density function for the triangular distribution.$
whose cases avoid division by zero if c = a or c = b.

## Special cases

### Two points known

The distribution simplifies when c = a or c = b. For example, if a = 0, b = 1 and c = 1, then the equations above become:

$\left.{\begin{matrix}f(x)&=&2x\\[8pt]F(x)&=&x^{2}\end{matrix}}\right\}{\text{ for }}0\leq x\leq 1$
{\begin{aligned}E(X)&={\frac {2}{3}}\\[8pt]{\mathrm {Var}}(X)&={\frac {1}{18}}\end{aligned}}

### Distribution of mean of two standard uniform variables

This distribution for a = 0, b = 1 and c = 0.5 is distribution of X = (X1 + X2)/2, where X1, X2 are two independent random variables with standard uniform distribution.

$f(x)={\begin{cases}4x&{\text{for }}0\leq x<{\frac {1}{2}}\\4-4x&{\text{for }}{\frac {1}{2}}\leq x\leq 1\end{cases}}$
$F(x)={\begin{cases}2x^{2}&{\text{for }}0\leq x<{\frac {1}{2}}\\1-2(1-x)^{2}&{\text{for }}{\frac {1}{2}}\leq x\leq 1\end{cases}}$
{\begin{aligned}E(X)&={\frac {1}{2}}\\[6pt]\operatorname {Var}(X)&={\frac {1}{24}}\end{aligned}}

### Distribution of the absolute difference of two standard uniform variables

This distribution for a = 0, b = 1 and c = 0 is distribution of X = |X1 − X2|, where X1, X2 are two independent random variables with standard uniform distribution.

{\begin{aligned}f(x)&=2-2x{\text{ for }}0\leq x<1\\[6pt]F(x)&=2x-x^{2}{\text{ for }}0\leq x<1\\[6pt]E(X)&={\frac {1}{3}}\\[6pt]\operatorname {Var}(X)&={\frac {1}{18}}\end{aligned}}

## Generating Triangular-distributed random variates

Given a random variate U drawn from the uniform distribution in the interval (0, 1), then the variate

${\begin{matrix}{\begin{cases}X=a+{\sqrt {U(b-a)(c-a)}}&{\text{ for }}0[1]

Where F(c) = (c-a)/(b-a)

has a Triangular distribution with parameters a, b and c. This can be obtained from the cumulative distribution function.

## Use of the distribution

The triangular distribution is typically used as a subjective description of a population for which there is only limited sample data, and especially in cases where the relationship between variables is known but data is scarce (possibly because of the high cost of collection). It is based on a knowledge of the minimum and maximum and an "inspired guess" [2] as to the modal value. For these reasons, the triangle distribution has been called a "lack of knowledge" distribution.