# Uniform Distribution on $\left[a,b\right]$

A r.v. $X$ follows a uniform distribution $U\left(a,b\right)$ if $X$ is continuous with pdf

$f_{X}\left(X\right)=\begin{cases} \frac{1}{b-a}, & x\in\left[a,b\right]\\ 0, & otherwise \end{cases}$

Under the Uniform distribution, all values in $\left[a,b\right]$ are “equally likely.”

Notice that if $X\sim U\left(a,b\right)$, then $X=\left(b-a\right)\widetilde{X}+a$ where $\widetilde{X}\sim U\left(0,1\right)$, and $f_{\widetilde{X}}\left(x\right)=1\left(x\in\left[0,1\right]\right)$.

## Mean

$E\left(\widetilde{X}\right)=\int_{0}^{1}xdx=\frac{1}{2}$.

So, $E\left(X\right)=E\left(\left(b-a\right)\widetilde{X}+a\right)=\left(b-a\right)E\left(\widetilde{X}\right)+a=\frac{a+b}{2}$

## Variance

$Var\left(\widetilde{X}\right)=E\left(\widetilde{X}^{2}\right)-E\left(\widetilde{X}\right)^{2}=\int_{0}^{1}x^{2}dx-\left(\frac{1}{2}\right)^{2}=\frac{1}{3}-\frac{1}{4}=\frac{1}{12}$.

So, $Var\left(X\right)=Var\left(\left(b-a\right)\widetilde{X}+a\right)=\left(b-a\right)^{2}Var\left(\widetilde{X}\right)=\frac{\left(b-a\right)^{2}}{12}$.

## MGF

$M_{X}\left(t\right)=\exp\left(at\right)M_{\widetilde{X}}\left(\left(b-a\right)t\right)=...=\frac{\exp\left(bt\right)-\exp\left(at\right)}{\left(b-a\right)t}$