**Example 1:** Continuous Logistic distribution

Let random variable *X* have a Logistic distribution with pdf :

In[1]:=

Let denote a sample of size *n* drawn on *X*, and let denote the ordered sample, so that . The pdf of the *r*^{ th } order statistic, , is given by the **mathStatica** function:

In[2]:=

Out[2]=

The following diagram plots the pdf of the *r*^{ th } order statistic, as *r* increases from 1 to 10, given a sample of size *n* = 10:

The joint pdf of and , for , is given by:

In[3]:=

Out[3]:=

**Example 2: **Discrete Negative Binomial distribution

A new feature in **mathStatica** 1.2 is that the OrderStat function now also supports discrete random variables. To illustrate, let random variable with pmf :

In[1]:=

Let denote a random sample of size *n* drawn on *X*, and let denote the order statistics.

Then, the pmf of the *r* ^{th} order statistic, , denoted , is given immediately by:

In[2]:=

Out[2]:=

with domain of support:

In[3]:=

Out[3]:=

The following diagram plots the pmf of the *r* ^{ th } order statistic that we have just derived, when , and *r* = 1 and the sample size is *n* = 10:

In[4]:=