Discrete Uniform Distribution#

PMF and CDF of Discrete Uniform Distribution#

Definition 26 (Discrete Uniform Distribution (PMF))

Let \(X\) be a discrete random variable that follows a Uniform distribution over the set \(\S\). This means that \(X=x\) has an equally likely chance of being drawn.

Then the probability mass function (PMF) of \(X\) is given by

\[ \P(X=x) = \dfrac{1}{\lvert \S \rvert} \]

More specifically, if \(X\) is a discrete random variable that follows a Uniform distribution over the ordered set \(\S\) where the lower bound is \(a\) and the upper bound is \(b\), then the PMF of \(X\) is given by

\[ \P(X=x) = \dfrac{1}{b-a+1} \qquad \text{for } x = a, a+1, \ldots, b \]

Note:

  1. It is non-parametric because there are no parameters associated.

Definition 27 (Discrete Uniform Distribution (CDF))

The cumulative distribution function (CDF) of a discrete random variable \(X\) that follows a Uniform distribution is given by

\[\begin{split} \cdf(x) = \P(X \leq x) = \begin{cases} 0 & \text{if } x < a \\ \dfrac{x-a+1}{b-a+1} & \text{if } a \leq x \leq b \\ 1 & \text{if } x > b \end{cases} \end{split}\]

where \(a\) and \(b\) are the lower and upper bounds of the set \(\S\).

Plotting PMF and CDF of Poisson Distribution#

The below plot shows the PMF and its Empirical Histogram distribution for an Uniform distribution with \(a=1\) and \(b=6\), essentially a dice roll.

1from plot import plot_discrete_uniform_pmf, plot_empirical_discrete_uniform
2
3fig, axes = plt.subplots(1, 2, figsize=(12, 6), dpi=125)
4low, high = 1, 6  # [1, 6] for dice roll
5plot_discrete_uniform_pmf(low, high, fig=fig, ax=axes[0])
6plot_empirical_discrete_uniform(low, high, fig=fig, ax=axes[1])
7plt.show()
Using Seed Number 42
../_images/54631d77629b3dbdfeaf082ef463ee76585d761bd6141bfd0084206c23a60967.svg