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;
> PlotDiscCDF(GeometricPDF(p,x),1..15);
>
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;
> f:=x->GeometricPDF(p,x);
> F:=x->GeometricCDF(p,x);
Below you will find three different ways to calculate P( ) .
> evalf(f(1)+f(2)+f(3));
> evalf(sum(f(x),x=1..3));
> evalf(F(3));