Chapter 31: Continuous Uniform Random Variables

Meike Niederhausen and Nicky Wakim

2023-11-27

Learning Objectives

  1. Identify the variable and the parameters in a story, and state in English what the variable and its parameters mean.

Properties of continuous uniform RVs

  • Scenario: Events are equally likely to happen anywhere or anytime in an interval of values

  • Shorthand: \(X \sim \text{U}[a,b]\)

\[ f_X(x) = \dfrac{1}{b-a}, \text{ for }a \leq x \leq b \]

\[ F_X(x) = \left\{ \begin{array}{ll} 0 & \quad x<a \quad \\ \dfrac{x-a}{b-a} & \quad a \leq x \leq b\quad \\ 1 & \quad x>b \quad \end{array} \right. \]

\[\text{E}(X) = \dfrac{a+b}{2} \text{, } \text{ Var}(X) = \dfrac{(b-a)^2}{12}\]

Identifying continuous uniform RV from word problems

  • Look for some indication that all events are equally likely

    • Could also say “uniformly distributed”
  • Look for an interval

    • Time example: Costumer in your store will approach the cash register in next 30 minutes. Approaching the register throughout the 30 minutes is equally likely.

    • Length example: You have a 12 inch string that you need to cut. You are equally likely to cut anywhere on the string.

  • Different than the discrete uniform

    • Discrete usually includes a countable number of events that are equally likely

    • Continuous is not countable

      • Exact time and length can be measured with infinite decimal places

Helpful R code

Let’s say we’re looking at equally likely arrival times between 10 am and 11 am.

  • If we want to know the probability that someone arrives at 10:30am or earlier:

    punif(q = 30, min = 0, max = 60)
    [1] 0.5
  • If we want to know the time, say \(t\), where the probability of arriving at \(t\) or earlier is 0.35:

    qunif(p = 0.35, min = 0, max = 60)
    [1] 21
  • If we want to know the probability that someone arrives between 10:14 and 10:16 am:

    punif(q = 16, min = 0, max = 60) - punif(q = 14, min = 0, max = 60)
    [1] 0.03333333
  • If we want to sample 20 arrival times from the distribution:

    runif(n = 20, min = 0, max = 60)
     [1] 59.2697340  9.1981803  9.7837455 45.2417801 43.3332988  7.3852063
     [7] 22.7173952 31.1353885 18.9825468 18.8161741  7.4355761  8.2701780
    [13] 56.8901648 24.3524825 35.3608501  0.6928508 37.8993119 12.7624237
    [19] 33.7504978 27.8553889

Bird on a wire (TB 31.5)

Example 1

A bird lands at a location that is Uniformly distributed along an electrical wire of length 150 feet. The wire is stretched tightly between two poles. What is the probability that the bird is 20 feet or less from one or the other of the poles?