Sample Probability Calculations

The following code will draw a graph of the cumulative distribution function (CDF) for the

Geometric( p ) distribution for p= 0.5, but you are encouraged to try other values of p .

> p:=0.5;

[Maple Math]

> PlotDiscCDF(GeometricPDF(p,x),1..15);

[Maple Plot]

>

We can calculate probabilities for the Geometric( 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 Geometric(0.5) distribution.

> p:=0.5;

[Maple Math]

> f:=x->GeometricPDF(p,x);

[Maple Math]

> F:=x->GeometricCDF(p,x);

[Maple Math]

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

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

[Maple Math]

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

[Maple Math]

> evalf(F(3));

[Maple Math]