Here is one way to think about a mixed random variable. Suppose that we have a discrete random variable
Xd with (generalized) PDF and CDF fd(x) and Fd(x), and a continuous random variable Xc with
PDF and CDF fc(x) and Fc(x). Now we create a new random variable X in the following way. We
have a coin with P(H)=p. We toss the coin once. If it lands heads, then the value of X is determined
according to the probability distribution of Xd. If the coin lands tails, the value of X is determined
according to the probability distribution of Xc.
Find the CDF of X,FX(x).
Find the PDF of X,fX(x).
Find EX.
Find Var(X).
Solution
Find the CDF of X,FX(x): We can write
FX(x)
=P(X≤x)
=P(X≤x∣H)P(H)+P(X≤x∣T)P(T)(law of total probability)
=pP(Xd≤x)+(1−p)P(Xc≤x)
=pFd(x)+(1−p)Fc(x).
Find the PDF of X,fX(x): By differentiating FX(x), we obtain
Let X be a random variable with CDF
\begin{equation}
\nonumber F_X(x) = \left{
\begin{array}{l l}
1 & \quad x \geq 1 \
\frac{1}{2}+\frac{x}{2} & \quad 0 \leq x < 1 \
0 & \quad x < 0
\end{array} \right.
\end{equation}
What kind of random variable is X: discrete, continuous, or mixed?
Find the PDF of X, fX(x).
Find E(eX).
Find P(X=0∣X≤0.5).
Solution
What kind of random variable is X: discrete, continuous, or mixed? We note that the CDF has a
discontinuity at x=0, and it is continuous at other points. Since FX(x) is not flat in
other locations, we conclude X is a mixed random variable. Indeed, we can write
FX(x)=21u(x)+21FY(x),
where Y is a Uniform(0,1) random variable. If we use the interpretation of Problem 1, we can
say the following. We toss a fair coin. If it lands heads then X=0, otherwise X is obtained
according the a Uniform(0,1) distribution.
Find the PDF of X, fX(x): By differentiating the CDF, we obtain
fX(x)=21δ(x)+21fY(x),
where fY(x) is the PDF of Uniform(0,1), i.e.,
\begin{equation}
\nonumber f_Y(x) = \left{
\begin{array}{l l}
1 & \quad 0 < x < 1 \
0 & \quad \text{otherwise}
\end{array} \right.
\end{equation}
Find E(eX): We can use LOTUS to write
E(eX)
=∫−∞∞exfX(x)dx
=21∫−∞∞exδ(x)dx+21∫−∞∞exfY(x)dx
=21e0+21∫01exdx
=21+21(e−1)
=21e.
Here is another way to think about this part: similar to part (c) of Problem 1, we can write
E(eX)
=21×e0+21E[eY]
=21+21∫01eydy
=21e.
Find P(X=0∣X≤0.5): We have
P(X=0∣X≤0.5)
=P(X≤0.5)P(X=0,X≤0.5)
=P(X≤0.5)P(X=0)
=∫00.5fX(x)dx0.5
=0.750.5=32.
Problem
Let X be a Uniform(−2,2) continuous random variable. We define Y=g(X), where the
function g(x) is defined as
\begin{equation}
\nonumber g(x)=\left{
\begin{array}{l l}
1 & \quad x > 1 \
x & \quad 0 \leq x \leq 1\
0 & \quad \text{otherwise}
\end{array} \right.
\end{equation}
Find the CDF and PDF of Y.
Solution
Note that RY=[0,1]. Therefore,
FY(y)=0,fory<0,
FY(y)=1,fory≥1.
We also note that
P(Y=0)=P(X<0)=21,
P(Y=1)=P(X>1)=41.
Also for $0 < y < 1$,
FY(y)=P(Y≤y)=P(X≤y)=FX(y)=4y+2.
Thus, the CDF of Y is given by
\begin{equation}
\nonumber F_Y(y)=\left{
\begin{array}{l l}
1 & \quad y \geq 1 \
\frac{y+2}{4} & \quad 0 \leq y < 1\
0 & \quad \text{otherwise}
\end{array} \right.
\end{equation}
In particular, we note that there are two jumps in the CDF, one at y=0 and another at y=1. We can find the generalized PDF of Y by differentiating FY(y):