Sample Probability Calculations
The cumulative distribution function (CDF) is used to compute probabilities for normal distributions. The CDF for the N(0,1) distribution is shown below.
> plot(NormalCDF(0,1,x),x=-4..4);
> a:=plot(f1, z=-3.5..3.5, color=black):
> b:=plot(f1, z=-3.5..-1, color=yellow, filled=true):
> display([a, b]);
Find the value of the yellow shaded area, the area under the standard normal density curve to the left of -1.
> NormalCDF(0, 1, -1);
Areas under normal curves can also be found by using the integration command.
> evalf(int(NormalPDF(0,1,z), z=-infinity..-1));
> a:=plot(f1, z=-3.5..3.5, color=black):
> b:=plot(f1, z=.6..1.4, color=yellow, filled=true):
> display([a, b]);
Find the value of the yellow shaded area, the area under the standard normal density curve between .6 and 1.4.
Using the CDF, we find the area to the left of 1.4 and then subtract the area to the left of .6.
> area1:=NormalCDF(0,1,1.4);
> area2:=NormalCDF(0,1,.6);
> area_between:=area1-area2;
Using the integration comand we simply integrate the N(0,1) PDF from .6 to 1.4.
> evalf(int(NormalPDF(0,1,z), z=.6..1.4));
> a:=plot(f1, z=-3.5..3.5, color=black, axes=NONE):
> b:=plot(f1, z=.6745..3.5, color=yellow, filled=true, axes=NONE):
> c:=plot(x*0, x=-3.5..3.5, color=black, axes=NONE):
> d:=textplot( [.68, -.02, "z"]):
> e:=textplot( [1.04, .07, ".25"]):
> display([a, b, c, d, e]);
Find the value of z. z is known as the third quartile for the standard normal distribution.
Now, we know the area under the N(0,1) curve to the left of z is .75 and we want to solve for z.
> fsolve(NormalCDF(0,1,z)=.75,z);