---
title: "Section 4.5 Practice: Uniform and Exponential random variables"
author: "put your name here"
output: pdf_document
---

# 1. Plot the pdf and cdf of a uniform random variable on the interval [0,1]. 
_Hint: You may need to refer to ch1 notes to create these plots_



\newpage

# 2. For each of the following descriptions of a random variable, indicate whether it can best be modeled by binomial, geometric, uniform, exponential or normal. Also, answer the associated question.

## a. Suppose a stop light has a red light that lasts for 60 seconds a green light that lasts for 30 seconds and a yellow light that lasts for 5 seconds. When you first observe the stop light, it is red. Let $X$ denote the time until the light turns green. What type of rv would be used to model $X$? What is the mean?



## b. Customers arrive at a teller's window at a uniform rate 5 per hour. Let $X$ be the length in minutes of time that the teller has to wait until they see their first customer after starting their shift. What type of rv is $X$? What is its mean? Find the probability that the teller waits less than 10 minutes for their first customer.



## c. Let $X$ be the recorded body temperature of a healthy adult in degrees Fahrenheit. What type of rv is $X$? Estimate its mean and standard deviation, based on your knowledge of body temperatures.



\newpage

# 3. Let $X$ be an exponential rv with $\lambda=1/4$. Answer the following questions using both theoretical and simulation methods. 

## a. What is the mean of $X$.

## b. Find the probability of $P(.25 \leq X \leq 1)$ using both formulas and simulation. 

* Theoretical via Integration

* Theoretical via R commands

* Simulation


# 4. The minimum of two independent exponential random variables with mean 2 is an exponential random variable. Use simulation to determine what the mean value is for the distribution (of the minimum of two independent exponential r.v. with mean 2).



\newpage
# 5. Let $X$ be an exponential random variable with rate $\lambda$. If $a$ and $b$ are positive numbers, then $P(X>a+b|X>b) = P(X > a)$. Explain how this equation demonstrates the *memoryless property* of the exponential.



\newpage
# 6. The number of days ahead travelers purchase their airline tickets can be modeled by an exponential distribution with the _average amount of time_ equal to 15 days. 

## a. Define the random variable in a sentence, and distributional notation. 


## b. Find the probability that a traveler will purchase a ticket fewer than ten days in advance. 



## c. How many days do half of all travelers wait? 



