The data consists of a sample of *n* observations of a discrete variable, denoted by, for*i*=1,...,*n*. Then sort the data ascending, the ordered data is denoted by, for*i*=1,...,*n*. The corresponding count of the value is denoted by, , which is the frequency of the *i*th value. The relative frequency and cumulative frequency of are calculated as follows:

and , for *k*=1,...,*n*.