Sample Probability Calculations

The cumulative distribution function (CDF) may be used to compute probabilities for the [Maple Math] ( [Maple Math] ) distribution. The CDF for [Maple Math] ( [Maple Math] ) is shown below, but you are encouraged to try other values of [Maple Math] .

> restart: with(plots):

> nu:=5;

[Maple Math]

> plot(ChisquareCDF(nu,x),x=0..20);

[Maple Plot]

> a:=plot(ChisquarePDF(nu,x),x=0..20,color=black):

> b:=plot(ChisquarePDF(nu,x),x=0..6,color=yellow,filled=true):

> display([a,b]);

Find the value of the yellow shaded area, the area under the PDF to the left of 6.

[Maple Plot]

> ChisquareCDF(nu,6);

[Maple Math]

The area under the curve can also be found using the integration command.

> evalf(int(ChisquarePDF(nu,x),x=0..6));

[Maple Math]

Find the value of the yellow shaded area, the area under the [Maple Math] ( [Maple Math] ) PDF between 10 and 12.

> a:=plot(ChisquarePDF(nu,x),x=0..20,color=black):

> b:=plot(ChisquarePDF(nu,x),x=10..12,color=yellow,filled=true):

> display([a,b]);

[Maple Plot]

Using the CDF, we find the area to the left of 12, and then subtract the area to the left of 10.

> area1:=ChisquareCDF(nu,12);

[Maple Math]

> area2:=ChisquareCDF(nu,10);

[Maple Math]

> area_between:=area1-area2;

[Maple Math]

Using the integration command, we may also integrate the [Maple Math] ( [Maple Math] ) PDF from 10 to 12.

> evalf(int(ChisquarePDF(nu,x),x=10..12));

[Maple Math]

> a:=plot(ChisquarePDF(nu,x),x=0..20,color=black,labels=[" "," "]):

> b:=plot(ChisquarePDF(nu,x),x=6.6..20,color=yellow,filled=true,labels=[" "," "]):

> c:=textplot([6.6,-0.003,"x"],color=blue):

> d:=textplot([10,0.015,".25"],color=black):

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

Find the value of x . x is known as the third quartile for the [Maple Math] ( [Maple Math] ) distribution.

[Maple Plot]

Now, we know the area under the curve to the left of x is 0.75 and we want to solve for x .

> fsolve(ChisquareCDF(nu,x)=.75,x);

[Maple Math]

>