Sample Probability Calculations

The cumulative distribution function (CDF) may be used to compute probabilities for binomial distributions. The CDF of the Binomial(10,0.5) is shown below.

> restart: with(plots):

> n:=10: p:=0.5:

> PlotDiscCDF(BinomialPDF(n,p,x),0..10);

[Maple Plot]

We can calculate probabilities for the Binomial( n,p ) 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 . We will consider these functions for a variable X having the Binomial(10,0.5) distribution.

> n:=10;

[Maple Math]

> p:=0.5;

[Maple Math]

> f:=x->BinomialPDF(n,p,x);

[Maple Math]

> F:=x->BinomialCDF(n,p,x);

[Maple Math]

Below you will find three different ways to calculate P( [Maple Math] ) .

> evalf(f(0)+f(1)+f(2)+f(3));

[Maple Math]

> evalf(sum(f(x),x=0..3));

[Maple Math]

> evalf(F(3));

[Maple Math]