Sample Probability Calculations
The cumulative distribution function (CDF) may be used to compute probabilities for the ( ) distribution. The CDF for ( ) is shown below, but you are encouraged to try other values of .
> restart: with(plots):
> nu:=5;
> plot(ChisquareCDF(nu,x),x=0..20);
> 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.
> ChisquareCDF(nu,6);
The area under the curve can also be found using the integration command.
> evalf(int(ChisquarePDF(nu,x),x=0..6));
Find the value of the yellow shaded area, the area under the ( ) 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]);
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);
> area2:=ChisquareCDF(nu,10);
> area_between:=area1-area2;
Using the integration command, we may also integrate the ( ) PDF from 10 to 12.
> evalf(int(ChisquarePDF(nu,x),x=10..12));
> 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 ( ) distribution.
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);
>