[Tex/LaTex] LaTeX: Statistics CDF and PDF


Is there any way to type the CDF and PDF of a distribution on LaTeX similar to how it's done on this site?


Best Answer

I yield to @CarLaTeX’s invite to provide a slightly simplified version of her answer:

% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly 
                                 % declare the paper format.

\usepackage[T1]{fontenc}         % Not always necessary, but recommended.
% End of standard header.  What follows pertains to the problem at hand.



Probability density function:
        \frac{1}{b-a} & for $x\in[a,b]$ \\
        0 & otherwise \\

Cumulative distribution function:
        0 & for $x<a$ \\
        \frac{x-a}{b-a} & for $x\in[a,b)$ \\
        1 & for $x\ge b$ \\


See the manual of the mathtools package, section 3.4.3 (p. 18) for details.

Related Question