Uniform Distribution

In the continuous uniform distribution, all intervals of the same length are equally probable. The distribution is defined by two parameters, a and b, which are the minimum and maximum values of the interval. For example, U[3,6] is the uniform distribution from 3 to 6. In the discrete uniform distribution, there are n equally spaced values, each of which have the same \(\tfrac{1}{n}\) probability of being observed.

Applications

Generation of random numbers. Random numbers are often generated from a uniform distribution U[0,1]

In R, to generate 5 random integers from [1:10] with replacement:

> sample(1:10, 5, replace = TRUE)

Example (Continuous)

It is known that the time to complete an oil change at a certain dealership is random and takes between 35 to 45 minutes. If you take your car to this dealership to get an oil change, what is the probability that it will take between 40 to 42 minutes?

Answer\[P(40 \leq x \leq 42) = \tfrac{(42-40)}{(45-35)} = 0.2\]

Example (Discrete)

If you throw a fair six sided die, what is the probability that you get a number greater than 2?