CSE 312 – Section 6


Spring 2026

Review of Main Concepts

Announcements & Plan for Section

Announcements

Plan for Section

Be sure to check out the remaining problems (especially 4, 10, and 14) before you do your homework.

Midterm Prep Resources

1  Content Review

a)
What is \(\Pr (X=4)\) if \(X\) is a continuous random variable?
  • \(1\)
  • \(0\)
  • not enough information
b)
The cumulative distribution function for a continuous random variable \(X\) is \(F_X(k) =\)
  • \(\int _{-\infty }^{k} f_X(x)dx\)
  • \(\int _{-\infty }^{\infty } f_X(x)dx\)
  • \(\int _{k}^{\infty } f_X(x) dx\)
  • \(\frac {d}{dk} f_X(k)\)
c)
The probability density function for a continuous random variable \(X\) is \(f_X(k) =\)
  • \(\int _{-\infty }^{k} f_X(x)dx\)
  • \(\frac {d}{dk} F_X(k)\)
d)
True or False. If \(X\) is a continuous random variable, \(\Exp [X] = \int _{-\infty }^{\infty } x f_X(x)dx\)
e)
True or False. If \(X\) is a continuous random variable, \(\Var (X) = \Exp [X^2] - (\Exp [X])^2\)
f)
Which of the following follow an \(\textsf {Exponential}(\lambda )\) distribution?
  • Number of minutes to the first success with \(\lambda \) as average number of successes per minute
  • Number of successes in the first 1 minute with \(\lambda \) as average number of successes per minute
  • Time (real number) to the first success with \(\lambda \) as average number of successes per minute
g)
True or False: For any random variable \(X\), \(\Pr (X = 5) = \Pr (X - 5 = 0)\).
h)
True or False: For some continuous random variable \(X\), \(\Pr (X \leq 5) \neq \Pr (X < 5)\).
i)
True or False: Let \(X \sim \mathcal {N}(\mu , \sigma ^2)\) and \(a,b \in \mathbb {R}\). Then \(aX + b \sim \mathcal {N}(a\mu + b, a^2\sigma ^2)\).

2  Uniform2

Robbie decided he wanted to create a “new” type of distribution that will be famous, but he needs some help. He knows he wants it to be continuous and have uniform density, but he needs help working out some of the details. We’ll denote a random variable \(X\) having the “Uniform-2” distribution as \(X\sim \textsf {Uniform2}(a,b,c,d)\), where \(a < b < c < d\). We want the density to be non-zero in \(\lbrack a,b\rbrack \) and \(\lbrack c,d\rbrack \), and zero everywhere else. Anywhere the density is non-zero, it must be equal to the same constant.

a)
Find the probability density function, \(f_{X}(x)\). Be sure to specify the values (in terms of \(a, b, c, d\)) it takes on for every point in \(( - \infty ,\infty )\). (Hint: use a piecewise definition).
b)
Find the cumulative distribution function, \(F_{X}(x)\). Be sure to specify the values it takes on for every point in \(( - \infty ,\infty )\). (Hint: use a piecewise definition).

3  Create the distribution

Suppose \(X\) is a continuous random variable that is uniform on \([0,1)\) and uniform on \([1,2]\), but \[\Pr (1\le X \le 2) = 2 \cdot \Pr (0 \le X < 1).\] Outside of \([0,2]\) the density is 0. What is the PDF and CDF of \(X\)?

4  The Spotlight

A spotlight is mounted on a wall at a height \(h\) above the ground. The light rotates and is equally likely to point at any angle \(\Theta \) between \(0\) and \(\pi /4\) (where \(0\) corresponds to pointing straight down at the ground). Let \(X\) be the distance along the ground from the point directly beneath the light to the spot where the light hits the ground. (Note that \(X = h \tan (\Theta )\)). For \(X\), find …

a)
the cumulative distribution function \(F_X\).
Hint: First, determine the range of possible values for \(X\) given the bounds on \(\Theta \). Then, use the definition \(F_X(x) = \Prob {X \leq x}\) and substitute for \(X\). Recall that if \(\tan (x) = y\), then \(x= \arctan (y)\).
b)
the probability density function \(f_X\).
Hint: Recall the chain rule for derivatives, and that \(\frac {\dif }{\dif u} \arctan (u) = \frac {1}{1+u^2}\).
c)
the expected value \(\expect {X}\).
Hint: To evaluate the integral \(\int \frac {x}{h^2 + x^2} \dif x\), try using the substitution \(u = h^2 + x^2\).
d)
the variance \(\Var {(X)}\).
Hint: To find \(\expect {X^2}\), you will need to integrate a fraction like \(\frac {x^2}{h^2 + x^2}\). Try adding and subtracting \(h^2\) in the numerator to split the fraction into two easier pieces: \(x^2 = x^2 + h^2 - h^2\).

5  Max of uniforms

Let \(U_1, U_2, \ldots , U_n\) be mutually independent Uniform random variables on \((0,1)\). As in the discrete case, independence of these random variables implies that \[\Pr (U_1 \leq x_1, \ldots , U_n \leq x_n) = \Pr (U_1 \leq x_1) \cdots \Pr (U_n \leq x_n)\] for any numbers \(x_1, \ldots , x_n\). Find the CDF and PDF for the random variable \(Z = \max (U_1, \ldots , U_n)\).

6  New PDF?

Alex came up with a function that he thinks could represent a probability density function. He defined the potential PDF for \(X\) as \(f(x)=\frac {1}{1+x^2}\) defined on \([0,\infty )\). Is this a valid PDF? If not, find a constant \(c\) such that the PDF \(f_X(x)=\frac {c}{1+x^2}\) is valid. Then find \(\Exp [X]\). (Hints: \(\frac {d}{dx}(\tan ^{-1}x) = \frac {1}{1+x^2}\), \(\tan \frac {\pi }{2} = \infty \), and \(\tan 0 = 0\).)

7  Throwing a dart

Consider the closed unit circle of radius \(r\), i.e., \(S=\{(x,y):x^2+y^2\le r^2\}\). Suppose we throw a dart onto this circle and are guaranteed to hit it, but the dart is equally likely to land anywhere in \(S\). Concretely this means that the probability that the dart lands in any particular area of size A (that is entirely inside the circle of radius \(R\)), is equal to \(\frac {\text {A}}{\text {Area of whole circle}}\). The density outside the circle of radius \(r\) is 0.

Let \(X\) be the distance the dart lands from the center. What is the CDF and pdf of \(X\)? What is \(\Exp [X]\) and \(\Var (X)\)?

8  A square dartboard?

You throw a dart at an \(s \times s\) square dartboard. The goal of this game is to get the dart to land as close to the lower left corner of the dartboard as possible. However, your aim is such that the dart is equally likely to land at any point on the dartboard. Let random variable \(X\) be the length of the side of the smallest square \(B\) in the lower left corner of the dartboard that contains the point where the dart lands. That is, the lower left corner of \(B\) must be the same point as the lower left corner of the dartboard, and the dart lands somewhere along the upper or right edge of \(B\). For \(X\), find the CDF, PDF, \(\Exp [X]\), and \(\Var (X)\).

9  Will the battery last?

Suppose that the number of miles that a car can run before its battery wears out is exponentially distributed with expectation 10,000 miles. If the owner wants to take a 5000 mile road trip, what is the probability that she will be able to complete the trip without replacing the battery, given that the car has already been used for 2000 miles on the road trip?

10  Batteries and exponential distributions

Let \(X_1, X_2\) be independent exponential random variables, where \(X_i\) has parameter \(\lambda _i\), for \(1 \le i \le 2\). Let \(Y= \min (X_1, X_2)\).

a)
Show that \(Y\) is an exponential random variable with parameter \(\lambda =\lambda _1 + \lambda _2\). Hint: Start by computing \(\Pr (Y > y)\). Two random variables with the same CDF have the same pdf. Why?
b)
What is \(\Pr ( X_1 < X_2)\)? Use the law of total probability. The law of total probability hasn’t been covered in class yet, but will be soon at which point it would be good to revisit this problem!
c)
You have a digital camera that requires two batteries to operate. You purchase \(n\) batteries, labelled \(1, 2, \ldots , n\), each of which has a lifetime that is exponentially distributed with parameter \(\lambda \), independently of all other batteries. Initially, you install batteries 1 and 2. Each time a battery fails, you replace it with the lowest-numbered unused battery. At the end of this process, you will be left with just one working battery. What is the expected total time until the end of the process? Justify your answer.
d)
In the scenario of the previous part, what is the probability that battery \(i\) is the last remaining battery as a function of \(i\)? (You might want to use the memoryless property of the exponential distribution that has been discussed.)

11  Grading on a curve

In some classes (not CSE classes) an examination is regarded as being good (in the sense of determining a valid spread for those taking it) if the test scores of those taking it are well approximated by a normal density function. The instructor often uses the test scores to estimate the normal parameters \(\mu \) and \(\sigma ^2\) and then assigns a letter grade of A to those whose test score is greater than \(\mu +\sigma \), B to those whose score is between \(\mu \) and \(\mu + \sigma \), C to those whose score is between \(\mu -\sigma \) and \(\mu \), D to those whose score is between \(\mu -2\sigma \) and \(\mu - \sigma \) and F to those getting a score below \(\mu - 2\sigma \). If the instructor does this and a student’s grade on the test really is normally distributed with mean \(\mu \) and variance \(\sigma ^2\), what is the probability that student will get each of the possible grades A,B,C,D and F?

12  Normal questions

a)
Let \(X\) be a normal random variable with parameters \(\mu =10\) and \(\sigma ^2 = 36\). Compute \(\Pr ( 4 < X < 16)\).
b)
Let \(X\) be a normal random variable with mean 5. If \(\Pr (X > 9) = 0.2\), approximately what is \(\Var (X)\)?
c)
Let \(X\) be a normal random variable with mean 12 and variance 4. Find the value of \(c\) such that \[\Pr (X > c) = 0.10.\]

13  Do it in Reverse

a)
Let \(X\) be a normal random variable with parameters \(\mu = 8\) and \(\sigma ^2 = 9\). Find \(x\) such that \(\Pr (X \leq x) = 0.6\).
b)
Lots of statistics (like standardized test scores or heights) use percentiles to give context to where outcomes fall in a distribution. The \(n\)th percentile marks the outcome at which \(n\%\) of the data points are less than the outcome. Let \(Y\) be a normal random variable with parameters \(\mu = 15\) and \(\sigma ^2 = 4\). What value \(y\) marks the \(85\)th percentile? What value \(b\) marks the \(15\)th percentile?

14  Bad Computer

Each day, the probability your computer crashes is 10%, independent of every other day. Suppose we want to evaluate the computer’s performance over the next \(100\) days.

a)
Let \(X\) be the number of crash-free days in the next \(100\) days. What distribution does \(X\) have? Identify \(\Exp [X]\) and \(\Var (X)\) as well. Write an exact (possibly unsimplified) expression for \(\Pr (X\ge 87)\).
b)
Approximate the probability of at least 87 crash-free days out of the next 100 days using the Central Limit Theorem. Use continuity correction.

Important: continuity correction says that if we are using the normal distribution to approximate \[\Pr \left (a \le \sum _{i=1}^n X_i \le b\right )\] where \(a \le b\) are integers and the \(X_i\)’s are i.i.d. discrete random variables taking all integer values, then, as our approximation, we should use \[ \Pr ( a-0.5 \le Y \le b+ 0.5)\] where \(Y\) is the appropriate normal distribution that \( \sum _{i=1}^n X_i \) converges to by the Central Limit Theorem. The intuition here is that, to avoid a mismatch between discrete distributions (whose range is a set of integers) and continuous distributions, we get a better approximation by imagining that a discrete random variable, say \(W\), is a continuous distribution with density function \[f_W(x) := p_W (i) \quad \text { when }i-0.5 \le x < i + 0.5 \text { and $i$ integer} \]

For more details see pages 209-210 in the Tsun book.

15  Another continuous r.v.

The density function of \(X\) is given by \[ f(x) = \begin {cases}a+bx^2 &\text { when } 0\le x \le 1\\ 0 & \text { otherwise.} \end {cases} \] If \(\expect {X}=\frac {3}{5}\), find \(a\) and \(b\).

16  Point on a line

A point is chosen at random on a line segment of length \(L\). Interpret this statement and find the probability that the ratio of the shorter to the longer segment is less than \(\frac {1}{4}\).

17  Transforming continuous random variables

The next few questions are designed to help you understand the issue with transforming continuous random variables.

Specifically let’s explore why we cannot simply adapt the discrete formula \(p_Y(y) = \sum _{x \mid g(x) = y} p_X(x)\) into an integral \(f_Y(y) = \int _{x \mid g(x) = y} f_X(x) \dif x\) for continuous random variables.

a)
Suppose \(X \sim \text {Unif}(-1, 1)\) and \(Y = X^2\). We want to find the density of \(Y\) at \(y = 0.25\). If we blindly apply the incorrect formula \(f_Y(0.25) = \int _{x \mid x^2 = 0.25} f_X(x) \dif x\), what is the mathematical result of this specific integral?
(a)
\(f_X(-0.5) + f_X(0.5) = 1\)
(b)
\(0\)
(c)
\(0.5\)
(d)
\(0.25\)
b)
Suppose \(X \sim \text {Unif}(0, 1)\) and we apply the transformation \(Y = 3X\). We know that \(Y\) is uniformly distributed over \((0, 3)\), so its true density should be \(f_Y(y) = 1/3\) for \(y \in (0,3)\).

If a student mistakenly assumes they can just “move" the density from \(X\) to \(Y\) by setting \(f_Y(y) = f_X(x)\) where \(3x = y\), what incorrect density would they get for \(Y\)?

(a)
\(f_Y(y) = 1\) for \(y \in (0, 3)\)
(b)
\(f_Y(y) = 3\) for \(y \in (0, 3)\)
(c)
\(f_Y(y) = 1/3\) for \(y \in (0, 1)\)
(d)
\(f_Y(y) = 0\) for \(y \in (0, 3)\)
c)
Based on the previous examples, why does using the CDF method (\(F_Y(y) = \Prob {Y \le y}\)) succeed where manipulating the PDF directly fails?
(a)
The CDF converts the continuous variable into a discrete variable before taking the derivative.
(b)
The CDF works over intervals (areas) rather than individual points, properly accounting for how the transformation stretches or squishes the probability mass.
(c)
The CDF method only works for linear functions, bypassing the need for integration.
(d)
Probability density functions cannot be evaluated at specific points; they are only defined at infinity.

18  Non-Monotonic Transformations

When a transformation is not strictly increasing or decreasing, we have to be extra careful when setting up the inequalities for the CDF. Let \(X \sim \text {Unif}(-2, 2)\) and let \(Y = X^2\).

(a)
What is the cumulative distribution function (CDF) of \(Y\)? Be sure to clearly state the range of possible values for \(Y\).
(b)
Derive the probability density function (pdf) of \(Y\) by taking the derivative of your answer from part (a).

19  Transformations

Suppose \(X\sim \textsf {Uniform}(0,1)\) has the continuous uniform distribution on \((0,1)\). Let \(Y=-\frac {1}{\lambda }\ln {X}\) for some \(\lambda >0\).

a)
What is \(\Omega _Y\)?
b)
First write down \(F_X(x)\) for \(x\in (0,1)\). Then, find \(F_Y(y)\) on \(\Omega _Y\).
c)
Now find \(f_Y(y)\) on \(\Omega _Y\) (by differentiating \(F_Y(y)\) with respect to \(y\)). What distribution does \(Y\) have?