Discrete Random Variables

mathStatica automatically handles discrete random variables in the standard way. The only difference is that, when we define the density, we add a flag to tell Mathematica that the random variable is {Discrete}. To illustrate, let the discrete random variable [Graphics:Images/index_gr_1.gif] have probability mass function (pmf)

[Graphics:Images/index_gr_2.gif],       for [Graphics:Images/index_gr_3.gif].

Here, parameter [Graphics:Images/index_gr_4.gif] is the probability of success, while parameter [Graphics:Images/index_gr_5.gif] is a positive integer. In Mathematica, we enter this as:


This is known as the Pascal distribution. Here is a plot of [Graphics:Images/index_gr_7.gif]:



Fig. 1: The pmf of a Pascal discrete random variable

Here is the cdf, equal to [Graphics:Images/index_gr_10.gif]:


The mean [Graphics:Images/index_gr_13.gif] and variance of [Graphics:Images/index_gr_14.gif] are given by:


The probability generating function (pgf) is [Graphics:Images/index_gr_19.gif]: