# Triangular distribution

Parameters Probability density functionPlot of the Triangular PMF Cumulative distribution functionPlot of the Triangular CMF ${\displaystyle a:~a\in (-\infty ,\infty )}$${\displaystyle b:~b>a\,}$${\displaystyle c:~a\leq c\leq b\,}$ ${\displaystyle a\leq x\leq b\!}$ ${\displaystyle \left\{{\begin{matrix}{\frac {2(x-a)}{(b-a)(c-a)}}&\mathrm {for\ } a\leq x\leq c\\&\\{\frac {2(b-x)}{(b-a)(b-c)}}&\mathrm {for\ } c\leq x\leq b\end{matrix}}\right.}$ ${\displaystyle \left\{{\begin{matrix}{\frac {(x-a)^{2}}{(b-a)(c-a)}}&\mathrm {for\ } a\leq x\leq c\\&\\1-{\frac {(b-x)^{2}}{(b-a)(b-c)}}&\mathrm {for\ } c\leq x\leq b\end{matrix}}\right.}$ ${\displaystyle {\frac {a+b+c}{3}}}$ ${\displaystyle \left\{{\begin{matrix}a+{\frac {\sqrt {(b-a)(c-a)}}{\sqrt {2}}}&\mathrm {for\ } c\!\geq \!{\frac {b\!-\!a}{2}}\\&\\b-{\frac {\sqrt {(b-a)(b-c)}}{\sqrt {2}}}&\mathrm {for\ } c\!\leq \!{\frac {b\!-\!a}{2}}\end{matrix}}\right.}$ ${\displaystyle c\,}$ ${\displaystyle {\frac {a^{2}+b^{2}+c^{2}-ab-ac-bc}{18}}}$ ${\displaystyle {\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}}}}}$ ${\displaystyle -{\frac {3}{5}}}$ ${\displaystyle {\frac {1}{2}}+\ln \left({\frac {b-a}{2}}\right)}$ ${\displaystyle 2{\frac {(b\!-\!c)e^{at}\!-\!(b\!-\!a)e^{ct}\!+\!(c\!-\!a)e^{bt}}{(b-a)(c-a)(b-c)t^{2}}}}$ ${\displaystyle -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, mode c and upper limit b.

${\displaystyle f(x|a,b,c)=\left\{{\begin{matrix}{\frac {2(x-a)}{(b-a)(c-a)}}&\mathrm {for\ } a\leq x\leq c\\&\\{\frac {2(b-x)}{(b-a)(b-c)}}&\mathrm {for\ } c\leq x\leq b\\&\\0&\mathrm {for\ any\ other\ case} \end{matrix}}\right.}$

## 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:

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

### Distribution of two standard uniform variables

This distribution for a=0, b=1 and c=0.5 is distribution of ${\displaystyle X={\frac {X_{1}+X_{2}}{2}}}$, where ${\displaystyle X_{1},X_{2}}$ are two random variables with standard uniform distribution.

${\displaystyle f(x)=\left\{{\begin{matrix}4x&\mathrm {for\ } 0\leq x<{\frac {1}{2}}\\\\4-4x&\mathrm {for\ } {\frac {1}{2}}\leq x\leq 1\end{matrix}}\right.}$
${\displaystyle F(x)=\left\{{\begin{matrix}2x^{2}&\mathrm {for\ } 0\leq x<{\frac {1}{2}}\\\\1-2(1-x)^{2}&\mathrm {for\ } {\frac {1}{2}}\leq x\leq 1\end{matrix}}\right.}$
${\displaystyle {\begin{matrix}E(X)&=&{\frac {1}{2}}\\\\\mathrm {Var} (X)&=&{\frac {1}{24}}\end{matrix}}}$

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

This distribution for a=0, b=1 and c=0 is distribution of ${\displaystyle X=|X_{1}-X_{2}|}$, where ${\displaystyle X_{1},X_{2}}$ are two random variables with standard uniform distribution.

${\displaystyle {\begin{matrix}f(x)&=&2-2x\qquad \mathrm {for\ } 0\leq x<1\\\\F(x)&=&2x-x^{2}\qquad \mathrm {for\ } 0\leq x<1\\\\\end{matrix}}}$

${\displaystyle {\begin{matrix}E(X)&=&{\frac {1}{3}}\\\\\mathrm {Var} (X)&=&{\frac {1}{18}}\end{matrix}}}$

## 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" [1] as to the modal value.