Continuous Random Variables &
Probability Density Functions

Applied Statistics

MTH-361A | Spring 2025 | University of Portland

February 17, 2025

Objectives

Previously… (1/2)

Random Variables

A random variable (r.v.) is a function that maps the sample space into real numbers.

Probability Functions

A probability function maps the r.v. into the the real numbers between 0 and 1.

There are two types of r.v.s –discrete and continuous– with corresponding probability functions –probability mass function (PMF) and probability density function (PDF) respectively.

Previously… (2/2)

Geometric R.V.

\[ \begin{aligned} \text{R.V. } & \longrightarrow X \sim \text{Geom}(p) \\ \text{PMF } & \longrightarrow P(X=k) = (1-p)^k p \\ \text{for } & k = 0,1,2, \cdots \\ \text{expected value} & \longrightarrow \text{E}(X) = \frac{1-p}{p} \end{aligned} \]

Binomial R.V.

\[ \begin{aligned} \text{R.V. } & \longrightarrow X \sim \text{Binom}(p) \\ \text{PMF } & \longrightarrow P(X=k) = \binom{n}{k} p^k (1-p)^{n-k} \\ \text{for } & k = 0,1,2,3, \cdots, n \\ \text{expected value} & \longrightarrow \text{E}(X) = np \end{aligned} \]

Rate to “Success” (Discrete)

Geometric R.V. (Revisited)

\(\star\) Key Idea: In a time-based interpretation, if events occur in discrete time steps, the geometric r.v. represents the number of time steps required until an event of interest happens.

Case Study 1

A professor allows students to take a short assessment quiz, and if they do not pass, they can revise their answers and retake the quiz in the next session. The probability that a student passes on any given attempt is \(p=0.40\), and attempts continue until the student passes.

Let \(X\) be the number of “fail” attempts before the student get a “pass”.

Information Given:

Computing Probabilities:

Using R:

p <- 0.40
pgeom(1,p)
## [1] 0.64

This means that, on average, the student would “fail” on their 1st attempt before they get a “pass”. The chances of a “pass” with 1 “fail” attempt is \(0.64\).

Rate to “Success” (Continuous)

Exponential R.V.

\(\star\) Key Idea: In a time-based interpretation, if events occur in continuous time, the exponential r.v. represents the length of time required until an event of interest happens.

The Exponential R.V.

The exponential r.v. is a continuous r.v. that models the time until an event occurs, given that the event happens at a constant rate over time called \(\lambda\): \[X \sim \text{Exp}(\lambda)\]

Sample Space:

Rate Parameter

The Exponential R.V.: PDF

The exponential r.v. \(X \sim \text{Exp}(\lambda)\) has infinite possible outcomes (or infinite sized sample space) where \(\lambda > 0\) is the rate of “success” with PDF given as \[f(x) = \lambda e^{-\lambda x}, \ x \ge 0\]

\(\star\) Key Idea: The exponential r.v. models the unit length until an event happens.

Probabilities of PDFs

A Probability Density Function (PDF) \(f(x)\) describes the likelihood of a continuous r.v. taking a specific value.

\(\star\) Key Idea:

Case Study 2

A class of students is taking a quiz, and the time it takes for students to finish the quiz follows an exponential r.v., assuming unlimited quiz time allocation. On average, a student takes 15 minutes to complete the quiz.

Let \(X\) represent the time to finish the quiz.

Information Given:

Computing Probabilities:

Using R:

lambda <- 1/15
pexp(15,lambda)
## [1] 0.6321206

Visualizing The Exponential Distribution

The Exponential R.V.

\[ \begin{aligned} \text{R.V. } & \longrightarrow X \sim \text{Exp}(\lambda) \\ \text{PDF } & \longrightarrow f(x) = \lambda e^{- \lambda x} \\ \text{for } & x \in [0,\infty) \end{aligned} \]

The Normal R.V.: A Preview

\(\star\) Key Idea: The Binomial distribution can be approximated by a Normal distribution using the Central Limit Theorem (CLT). We will discuss this topic soon.

Activity: Distinguish Between Geometric or Exponential R.V.

  1. Make sure you have a copy of the W 2/19 - Distinguish Between Geometric or Exponential R.V.. This will be handed out physically and it is also digitally available on Moodle.
  2. Work on your worksheet by yourself for 10 minutes. Please read the instructions carefully. Ask questions if anything need clarifications.
  3. Get together with another student.
  4. Discuss your results.
  5. Submit your worksheet on Moodle as a .pdf file.

References

Diez, D. M., Barr, C. D., & Çetinkaya-Rundel, M. (2012). OpenIntro statistics (4th ed.). OpenIntro. https://www.openintro.org/book/os/
Speegle, Darrin and Clair, Bryan. (2021). Probability, statistics, and data: A fresh approach using r. Chapman; Hall/CRC. https://probstatsdata.com/