Problems for Cumulative Distribution Function


Earlier we discussed the introduction of a continuous random variable and cumulative distribution function. Please see this article if you haven’t read it about already.

Now we will give some problems related to Cumulative distribution function so you can have a deeper understanding of this topic. These problems are adapted from the following textbook:

“Probability and Random Processes by Scott Miller 2nd Edition.”

Problem-1: Which of the following mathematical functions could be the CDF of some random variable?

Remember: To be a CDF of some random variable, the function \(F_{X}(x)\) must start at zero when \(x = -\infty\), end at one when \(x = \infty\), and be monotonic increasing in between

\( 1-  \begin{eqnarray*} F_X(x) &=& 1-|x|, & |x| \leq 1,\\ & & 0 , & |x| <1 \end{eqnarray*} \)

Answer: This cannot be the CDF of a random variable since the function is not monotonic increasing

\( 2-  \begin{eqnarray*} F_X(x) &=& \frac{1}{2} e^x, & x < 0,\\ & & 1 – \frac{1}{2} e^{-x} , & x \geq 0 \end{eqnarray*} \)

Answer: \(F_{X}(x)\) satisfies the necessary conditions, and thus could be the CDF of some random variable.

\( 3-   \begin{eqnarray*} F_X(x) &=& 0, & x \leq 0,\\ & & x^2 , & 0 < x \leq 1 \\ & & 1 , &  x > 1 \end{eqnarray*} \)

Answer: \(F_{X}(x)\) satisfies the necessary conditions, and thus could be the CDF of some random variable

\( 4- F_X(x) = log(x)u(x)\)

Answer: This function cannot be the CDF of some random function. Taking the limit as \(x \rightarrow \infty\) we see the function will grow without bound, so it will not end at one as required.

Problem-2: Suppose a random variable has a CDF given by:

\(\begin{equation*} F_X(x) = \frac{x^2}{1+x^2} u(x) \end{equation*}\)

Find the following quantities:

(a) \(Pr(X<2)\)
(b) \(Pr(X>4)\)
(c) \(Pr(1 < X < 3)\)
(d) \(Pr(X>2 | X < 4)\)

Solution: (a) \(Pr(X<2) = F_{x}(2) = \frac{2^{2}}{1+2^{2}} = 4/5\)
(b) \(Pr(X>4) = 1-Pr(X\leq4) = 1 – F_{x}(4) = 1 – \frac{4^{2}}{1+4^{2}} = 1/17\)
(c) \(Pr(1<X<3) = Pr(X<3) – Pr(X<1) = Pr(X<3) – Pr(X<1) = F_{x}(3) – F_{x}(1) \\
=  \frac{3^{2}}{1+3^{2}} – \frac{1^{2}}{1+1^{2}} = 2/5\)

(d)  \(Pr(X>2 | X<4) = {\displaystyle \frac{\text{Pr}\bigg((X>2)\cap(X<4)\bigg)}{\text{Pr}(X<4)} \\
=\frac{\text{Pr}(2<X<4)}{\text{Pr}(X<4)}=\frac{F_{x}(4)-F_{x}(2)}{F_{x}(4)}} \\
= {\displaystyle {\frac{\frac{4^{2}}{1+4^{2}}-\frac{2^{2}}{1+2^{2}}}{\frac{4^{2}}{1+4^{2}}}}} \\
= 3/20 = 0.15\)

Problem-3: Now Suppose a random variable has a CDF given by:

\(\begin{equation*} F_X(x) = \left( \frac{1}{2} + \frac{1}{\pi} tan^{-1}(x) \right) u(x)\end{equation*}\)

Find the following quantities:

(a) \(Pr(X<2)\)
(b) \(Pr(X>4)\)
(c) \(Pr(1 < X < 3)\)
(d) \(Pr(X>2 | X < 4)\)

Solution: (a) \(Pr(X<2) = F_{x}(2) = \big(\frac{1}{2} + \frac{1}{\pi} tan^{-1}(2) \big). \\\)
(b) \(Pr(X>4) = 1-Pr(X \leq 4) = 1 – F_{x}(4)  \\
= 1 – \big(\frac{1}{2} + \frac{1}{\pi} tan^{-1}(4) \big) \\
= \big(\frac{1}{2} – \frac{1}{\pi} tan$^{-1}(4) \big). \\\)
(c) \(Pr(1<X<3) = Pr(X<3) – Pr(X<1) = F_{x}(3) – F_{x}(1) \\
= \big(\frac{1}{2} + \frac{1}{\pi} tan^{-1}(3) \big) -\big(\frac{1}{2} + \frac{1}{\pi} tan^{-1}(1) \big) \\
= \frac{1}{\pi} tan^{-1}(3) – \frac{1}{\pi} tan^{-1}(1) \\\)
Since \(tan^{-1}(1) = \frac{\pi}{4}\), we have
\(Pr(1<X<3)=-\frac{1}{4}+\frac{1}{\pi}\tan^{-1}(3). \\\)
(d) \(Pr(X>2 | X<4)\)
\(\begin{align*}
{\displaystyle } & =\frac{\text{Pr}\bigg((X>2)\cap(X<4)\bigg)}{\text{Pr}(X<4)}=\frac{\text{Pr}(2<X<4)}{\text{Pr}(X<4)}=\frac{F_{x}(4)-F_{x}(2)}{F_{x}(4)}\\
& =\frac{\big(\frac{1}{2}+\frac{1}{\pi}\tan^{-1}(4)\big)-\big(\frac{1}{2}+\frac{1}{\pi}\tan^{-1}(2)\big)}{\big(\frac{1}{2}+\frac{1}{\pi}\tan^{-1}(4)\big)}=\frac{\tan^{-1}(4)-\tan^{-1}(2)}{\frac{\pi}{2}+\tan^{-1}(4)}.
\end{align*}\)

Problem-3: Suppose we flip a balanced coin five times and let the random variable \(X\) represent the
number of times heads occurs.

(a) Sketch the CDF of \(X, F_X(x)\)
(b) Write \(F_X(x)\) analytically in terms of unit step functions.

Solution: (a) Let X be the number of heads in five coin tosses, so X can be 0, 1, 2, 3, 4, or 5.
\(Pr(X=0) = (\frac{1}{2})^{5} = \frac{1}{32}. \\
Pr(X=1) = {5 \choose 1}\big(\frac{1}{2}\big)^{4}\big(\frac{1}{2}\big)^{1} = \frac{5}{32}. \\
Pr(X=2) = {5 \choose 2}\big(\frac{1}{2}\big)^{3}\big(\frac{1}{2}\big)^{2} = \frac{10}{32}. \\
Pr(X=3) = {5 \choose 3}\big(\frac{1}{2}\big)^{2}\big(\frac{1}{2}\big)^{3} = \frac{10}{32}. \\
Pr(X=4) = {5 \choose 4}\big(\frac{1}{2}\big)^{4}\big(\frac{1}{2}\big)^{1} = \frac{5}{32}. \\
Pr(X=5) = {5 \choose 5}\big(\frac{1}{2}\big)^{5} = \frac{1}{32}. \\\)

Now \(F_{x}(x) = {\displaystyle {\sum_{i=1}^{k}}} P_{x}(x_{i}), for x_{k}\leq x \leq x_{k+1} \\\)

\(
F_{x}(x)=\left\{ \begin{array}{ll}
0 & \quad\text{for x < 0}\\
1/32 & \quad\text{for 0 \leq x < 1}\\
6/32 & \quad\text{for 1 \leq x < 2}\\
1/2 & \quad\text{for 2 \leq x < 3}\\
26/32 & \quad\text{for 3 \leq x < 4}\\
31/32 & \quad\text{for 4 \leq x < 5}\\
1 & \quad\text{for 5 \leq x}
\end{array}\right.
\)

CDF_Problems_im_1

(b) \(F_{x}(x) = \frac{1}{32}u(t) + \frac{5}{32}u(t-1) + \frac{10}{32}u(t-2) + \frac{10}{32}u(t-3) + \frac{5}{32}u(t-4) + \frac{1}{32}u(t-5)\)