Exponential Distribution

The exponential pdf:

Manipulate[Plot[PDF[ExponentialDistribution[λ],x],{x,0,10},PlotRange->{0,1}],{λ,0.001,4,Appearance-> "Labeled"}]

The exponential cdf:

Manipulate[Plot[CDF[ExponentialDistribution[λ],x],{x,0,10},PlotRange->{0,1}],{λ,0.001,4,Appearance-> "Labeled"}]

One way to find moments is by integrating: If X~Exp(1), then E((X^n))=(∫_0^∞)(x^n)(e^(-x))dx.

Here is a plot of (x^n)(e^(-x)) for n=1,2,3,4:

Plot[{x Exp[-x],(x^2)Exp[-x],(x^3)Exp[-x],(x^4)Exp[-x]},{x,0,20},PlotRange->Full,PlotLabels->Automatic]

Table[Integrate[(x^n)Exp[-x],{x,0,Infinity}],{n,1,5}]

Gamma Function

The moments of an exponential random variable are related to the gamma function.

The gamma function extends the factorial to positive real numbers:

gammaPlot = Plot[Gamma[x],{x,-3,5}];
factorialPlot=ListPlot[Table[{n, (n-1)!},{n,0,5}],PlotStyle->Red];
Show[gammaPlot,factorialPlot]

Gamma Distribution

The gamma pdf:

Manipulate[Plot[
PDF[GammaDistribution[α,β],x],{x,0,10},PlotRange->{0,1}
],{α,0.001,4,Appearance-> "Labeled"},{β,0.001,4,Appearance-> "Labeled"}]

The gamma cdf:

Manipulate[Plot[
{PDF[GammaDistribution[α,β],x],CDF[GammaDistribution[α,β],x]},{x,0,10},PlotRange->{0,1},PlotLabels->{"pdf","cdf"}
],{α,0.001,4,Appearance-> "Labeled"},{β,0.001,4,Appearance-> "Labeled"}]

Example

Plot[PDF[GammaDistribution[1.5,4],x],{x,0,20}]

CDF[GammaDistribution[1.5,4],1]

1-CDF[GammaDistribution[1.5,4],6]

InverseCDF[GammaDistribution[1.5,4],.5]

Probability[x>4,x\[Distributed]GammaDistribution[3,2]]//N

InverseCDF[GammaDistribution[3,2],.5]