### 7.4.13 The uniform distribution

#### The probability density function for the uniform
distribution: uniform uniformd

Given two values a and b with a < b, the uniform distribution on
[a,b] has density function 1/(b−a) for x in [a,b]. The
uniform (or uniformd) command will compute this;
uniform(a,b,x) = 1/(b−a). If you enter

uniform(2.2,3.5,2.8)

you will get

0.769230769231

#### The cumulative distribution function for the uniform
distribution: uniform_cdf uniformd_cdf

Given two values a and b with a <b, the cumulative distribution
function for the uniform distribution on [a,b] is (for x in [a,b])
uniform_cdf(a,b,x) = Prob(X ≤ x) = (x−a)/(b−a).
If you enter

uniform_cdf(2,4,3.2)

you will get

0.6

With an extra argument y in [a,b], uniform_cdf will
compute uniform_cdf(a,b,x,y) = Prob(x ≤ X ≤ y)
= (y−x)/(b−a). If you enter

uniform_cdf(2,4,3,3.2)

you will get

0.1

#### The inverse distribution function for the
uniform distribution: uniform_icdf uniformd_icdf

Given a value h, the inverse distribution function for a uniform
distribution is the value of x with Prob(X ≤ x) =
uniform_cdf(a,b,x) = h. This value is computed with the
uniform_icdf command. If you enter

uniform_icdf(2,3,.6)

you will get

2.6