Sample Probability Calculations

We can calculate probabilities for the Exp( [Maple Math] ) distribution using either the probability distribution function (PDF) or the cumulative distribution function (CDF). We will denote the PDF by f and the CDF by F . The CDF for the Exp(1) appears below, but feel free to plot it for different values of [Maple Math] .

> restart: with(plots):

> theta:=1;

[Maple Math]

> plot(ExponentialCDF(theta,x),x=0..4, title="CDF for Exp(1)");

[Maple Plot]

> f:=x->ExponentialPDF(theta,x);

[Maple Math]

> F:=x->ExponentialCDF(theta,x);

[Maple Math]

> a:=plot(f(x),x=0..4):

> b:=plot(f(x),x=0..1.5,color=yellow,filled=true):

> display([a,b]);

[Maple Plot]

Find the value of the yellow shaded area, the area under the Exponential(1) density curve to the left of 1.5.

> evalf(F(1.5));

[Maple Math]

The value of this area can also be found by using the integration command.

> evalf(int(f(x),x=0..1.5));

[Maple Math]

> a:=plot(f(x),x=0..4):

> b:=plot(f(x),x=2..3,color=yellow,filled=true):

> display([a,b]);

Find the value of the yellow shaded area, the area under the Exponential(1) density curve between 2 and 3.

[Maple Plot]

Using the CDF, we find the area to the left of 3 and then subtract the area to the left of 2.

> area1:=F(3);

[Maple Math]

> area2:=F(2);

[Maple Math]

> area_between:=area1-area2;

[Maple Math]

Using the integration command, we simply integrate the ExponentialPDF from 2 to 3.

> evalf(int(f(x),x=2..3));

[Maple Math]

> a:=plot(f(x),x=0..4,labels=[" "," "]):

> b:=plot(f(x),x=1.38..4,color=yellow,filled=true,labels=[" "," "]):

> c:=textplot([1.35,-.04,"x"],color=blue):

> d:=textplot([2,0.08,".25"],color=black):

> display([a,b,c,d]);

Find the value of x . x is known as the third quartile for the Exp(1) distribution.

[Maple Plot]

Find the value of x, which has .75 area to the left of it. We want to solve for x .

> fsolve(F(x)=.75,x);

[Maple Math]