Math Home

Continuous Uniform Distribution

A continuous random variable \(X\) has the uniform distribution over the interval \((a,b)\) if the pdf of \(X\) is \(f(x) = \frac{1}{b-a}\) if \(a < x < b\) and \(f(x) = 0\) otherwise.



Claim: If \(X\) is a continuous uniform random variable over \((a, b),\) the expected value of \(X\) is \(\frac{a+b}{2}.\)
Proof:
The result can be found by direct computation. \begin{align} E[X] & = \int_{-\infty}^\infty xf(x)dx \\ & = \int_a^b \frac{x}{b-a} dx \\ & = \left.\frac{x^2}{2(b-a)}\right|_a^b \\ & = \frac{b^2-a^2}{2(b-a)} \\ & = \frac{a+b}{2} \end{align}




Claim: If \(X\) is a continuous uniform random variable over \((a, b),\) the variance of \(X\) is \(\frac{(b-a)^2}{12}.\)

Proof:
First compute \(E[X^2].\) \begin{align} E[X^2] & = \int_{-\infty}^\infty x^2f(x)dx \\ & = \int_a^b \frac{x^2}{b-a} dx \\ & = \left.\frac{x^3}{3(b-a)}\right|_a^b \\ & = \frac{b^3-a^3}{3(b-a)} \\ & = \frac{a^2+ab+b^2}{3} \end{align} Next, use the formula for variance. \begin{align} \text{Var}(X) & = E[X^2] - E[X]^2 \\ & = \frac{a^2+ab+b^2}{3} - \left(\frac{a+b}{2}\right)^2 \\ & = \frac{4a^2+4ab+4b^2}{12} - \frac{3a^2+6ab+3b^2}{12} \\ & = \frac{a^2-2ab+b^2}{12} \\ & = \frac{(b-a)^2}{12} \end{align}




Example: Let \(X\) be a random variable with pdf \(f(x) = \frac{1}{2}\) if \(0.5 < x < 2.5.\) Then \[E[X] = \frac{0.5 + 2.5}{2} = 1.5\] \[\text{Var}(X) = \frac{(2.5-0.5)^2}{12} = \frac{1}{3}\]

Exponential Distribution

A random variable \(X\) has the exponential distribution with parameter \(\lambda > 0\) if the pdf of \(X\) is \(f(x) = \lambda e^{-\lambda x}\) for \(x > 0\) and \(f(x) = 0\) otherwise.



Claim: If \(X\) is an exponential random variable with parameter \(\lambda,\) the expected value of \(X\) is \(E[X]=\frac{1}{\lambda}.\)
Proof:
By definition of expectation, \begin{align} E[X] & = \int_{-\infty}^\infty xf(x)dx \\ & = \int_0^\infty x\lambda e^{-\lambda x} dx \\ \end{align} Using integration by parts, \begin{align} \int_0^\infty x\lambda e^{-\lambda x} dx & = \left.xe^{-\lambda x}\right|_0^{\infty} + \int_0^\infty e^{-\lambda x} dx \\ & = \left.\frac{e^{-\lambda x}}{-\lambda}\right|_0^\infty \\ & = \frac{1}{\lambda} \end{align}




Claim: If \(X\) is an exponential random variable with parameter \(\lambda,\) the variance of \(X\) is \(Var(X) = \frac{1}{\lambda^2}.\)

Proof:
First compute \(E[X^2].\) \begin{align} E[X^2] & = \int_{-\infty}^\infty x^2f(x)dx \\ & = \int_0^\infty \lambda x^2 e^{-\lambda x} dx \\ & = \left.x^2e^{-\lambda x}\right|_0^\infty + \int_0^\infty 2 x e^{-\lambda x} dx \\ & = \int_0^\infty 2 x e^{-\lambda x} dx \\ & = \left.\frac{-2xe^{-\lambda x}}{\lambda}\right|_0^\infty + 2\int_0^\infty \frac{e^{-\lambda x}}{\lambda} dx \\ & = \frac{2}{\lambda} \int_0^\infty e^{-\lambda x} dx \\ & = \left. \frac{-2e^{-\lambda x}}{\lambda^2} \right|_0^\infty \\ & = \frac{2}{\lambda^2} \end{align} Use \(\text{Var}(X) = E[X^2]-E[X]^2\) to find the variance. \[E[X^2]-E[X]^2 = \frac{2}{\lambda^2}-\frac{1}{\lambda^2} = \frac{1}{\lambda^2}\]

Claim: If \(X\) is an exponential random variable with parameter \(\lambda,\) then for any \(t > 0,\) \(P(X > t) = e^{-\lambda t}.\) In other words, the cdf of \(X\) is \(F(t) = 1-e^{-\lambda t}.\)

Proof:
This can be shown by direct computation. \begin{align} P(X > t) & = \int_t^\infty \lambda e^{-\lambda x} dx \\ & = \left. -e^{-\lambda x} \right|_t^\infty \\ & = e^{-\lambda t} \end{align}


The cdf is \[F(t) = P(X \leq t) = 1-P(X > t) = 1-e^{-\lambda t}\]




Example: Let \(X\) be a random variable with pdf \(f(x) = 4e^{-4x}\) for \(x > 0.\) Then \[E[X] = \frac{1}{4}\] \[\text{Var}(X) = \frac{1}{16}\]

Application

The exponential distribution is commonly used to model the time until an even occurs. For example, suppose a certain part of machinery is estimated to break down about every \(2\) years. Given a new machine, how likely is it that the machine will last more than \(3\) years without breaking?

Without any other information, we can make a best guess by modeling the time it takes for the machine to break with an exponential distribution. Let \(T\) be the random variable which represents the time it takes for the machine to break. Since the expected time to break is \(2\) years, the parameter for \(T\) is \(\frac{1}{2}.\) In other words, \[T \sim \text{Exponential}(\frac{1}{2})\] The probability that the machine will last more than \(3\) years is \begin{align} P(T > 3) & = e^{-3/2} \\ & \approx 0.223 \end{align} There is approximately a \(22\%\) chance that the machine will last at least \(3\) years.

Memoryless Property

Exponential random variables have what is called the "memoryless" property. Let \(T\) be an exponential random variable. The memoryless property is mathematically stated as \[P(T > t + s | T > t) = P(T > s)\] for any numbers \(t, s > 0.\) If we think of \(T\) as in the previous application, the memoryless property would say that if the machine has lasted "t" time units already, then the probability it will last "s" more time units is equal to the probability that it would have lasted "s" time units from when it was new.

Proof of the memoryless property:
Let \(T\) be Exponential\((\lambda)\). Then, \begin{align} P(T > t + s | T > t) & = \frac{P(\{T > t + s\} \cap \{T > s\})}{P(T > t)} \\ & = \frac{P(T > t + s)}{P(T > t)} \\ & = \frac{e^{-\lambda t-\lambda s}}{e^{-\lambda t}} \\ & = e^{-\lambda s} \\ & = P(T > s) \end{align}

Let \(X\) be uniformly distributed over \([-2, 4].\)

1. What is \(P(X > 0)?\)




Unanswered

2. What is \(\text{Var}(X)?\)




Unanswered

The random variable \(Y\) is exponential with mean \(4.5.\)

3. What is \(P(Y < 4.5)?\)




Unanswered

4. What is \(P(Y > 5 | Y > 2)?\)




Unanswered