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 have probability mass function (pmf)
Here, parameter is the probability of success, while parameter is a positive integer. In Mathematica, we enter this as:
This is known as the Pascal distribution. Here is a plot of :
Fig. 1: The pmf of a Pascal discrete random variable
Here is the cdf, equal to :
The mean and variance of are given by:
The probability generating function (pgf) is :