 Student[Statistics] - Maple Programming Help

Home : Support : Online Help : Education : Student Packages : Statistics : Random Variable Distributions : Student/Statistics/DiscreteUniformRandomVariable

Student[Statistics]

 DiscreteUniformRandomVariable
 discrete uniform random variable

 Calling Sequence DiscreteUniformRandomVariable(a, b)

Parameters

 a - lower bound parameter b - upper bound parameter

Description

 • The discrete uniform random variable is a discrete probability random variable with probability function given by:

$f\left(t\right)=\left\{\begin{array}{cc}0& t

 subject to the following conditions:

$a

Examples

 > $\mathrm{with}\left(\mathrm{Student}\left[\mathrm{Statistics}\right]\right):$
 > $X≔\mathrm{DiscreteUniformRandomVariable}\left(a,b\right):$
 > $\mathrm{ProbabilityFunction}\left(X,u\right)$
 $\left\{\begin{array}{cc}{0}& {u}{<}{a}\\ \frac{{1}}{⌊{b}⌋{-}⌈{a}⌉{+}{1}}& {u}{\le }{b}\\ {0}& {\mathrm{otherwise}}\end{array}\right\$ (1)
 > $\mathrm{ProbabilityFunction}\left(X,4\right)$
 $\left\{\begin{array}{cc}{0}& {4}{<}{a}\\ \frac{{1}}{⌊{b}⌋{-}⌈{a}⌉{+}{1}}& {4}{\le }{b}\\ {0}& {\mathrm{otherwise}}\end{array}\right\$ (2)
 > $\mathrm{Mean}\left(X\right)$
 $\frac{⌈{a}⌉}{{2}}{+}\frac{⌊{b}⌋}{{2}}$ (3)
 > $\mathrm{Variance}\left(X\right)$
 $\frac{{⌈{a}⌉}^{{2}}}{{12}}{+}\frac{{⌊{b}⌋}^{{2}}}{{12}}{+}\frac{⌊{b}⌋}{{6}}{-}\frac{⌈{a}⌉{}⌊{b}⌋}{{6}}{-}\frac{⌈{a}⌉}{{6}}$ (4)
 > $Y≔\mathrm{DiscreteUniformRandomVariable}\left(1,20\right):$
 > $\mathrm{ProbabilityFunction}\left(Y,x,\mathrm{output}=\mathrm{plot}\right)$ > $\mathrm{CDF}\left(Y,x\right)$
 $\left\{\begin{array}{cc}{0}& {x}{<}{1}\\ \frac{⌊{x}⌋}{{20}}& {x}{\le }{20}\\ {1}& {\mathrm{otherwise}}\end{array}\right\$ (5)
 > $\mathrm{CDF}\left(Y,12,\mathrm{output}=\mathrm{plot}\right)$ References

 Evans, Merran; Hastings, Nicholas; and Peacock, Brian. Statistical Distributions. 3rd ed. Hoboken: Wiley, 2000.
 Johnson, Norman L.; Kotz, Samuel; and Balakrishnan, N. Continuous Univariate Distributions. 2nd ed. 2 vols. Hoboken: Wiley, 1995.
 Stuart, Alan, and Ord, Keith. Kendall's Advanced Theory of Statistics. 6th ed. London: Edward Arnold, 1998. Vol. 1: Distribution Theory.

Compatibility

 • The Student[Statistics][DiscreteUniformRandomVariable] command was introduced in Maple 18.