Properties of the Distribution
Calculation of Mean and Variance
To calculate the mean of the Uniform distribution, we can simply integrate over x *(Uniform PDF), per the definition of mathematical expectation.
> restart;
> with(plots, display):
> f(x):=UniformPDF(alpha..beta,x);
> EX:=simplify(int(x*f(x),x=alpha..beta));
Notice that E( X ) is midway between alpha and beta.
Calculating Var( X ), we will employ the formula: Var( X ) = E( ) -
> E_X_SQ:=int((x^2)*f(x),x=alpha..beta);
> VarX:=simplify(E_X_SQ-EX^2);
Notice that Var( X ) simplifies to .