# How to write down a cumulative distribution function that consists of two distributions

I am being asked to write a CDF of a random variable $$X$$. I know that there is $$0.5$$ probability that $$X=5$$ and $$0.5$$ probability that $$X$$ follows the exponential distribution with parameter $$7$$.

I know that a CDF of the exponential distribution is given by: $$F(X) = 1-e^{-7x}$$.

Yet, I am not sure how it is affected by the probability of $$0.5$$?

Is the CDF in this example equal to: $$F(X)=\begin{cases} 0, & \text{if x<5} \\ 0.5, & \text{if x=5} \\ 0.5(1-e^{-7x}), & \text{if x>5}\end{cases}$$

Or am I missing something? And is there a way to write it down as a one-liner?

EDIT.

Extra bit of information: I am being asked to write a CDF of a random variable $$X$$. I know that there is $$0.5$$ probability that $$X=5$$ and $$0.5$$ probability that $$X>5$$ follows the exponential distribution with parameter $$7$$.

Perhaps if you treat it as a mixture of two distributions. 1: $$F1(x)=1(x>=5)$$ F(x) =1 if X>=5 but zero otherwise. 2: $$F2(x)=1-e^{-7x}$$

The mixture: $$F(X) = 0.5 * F1 + 0.5* F2$$ $$F(X) = 0.5 * 1(x>=5) + 0.5*(1-e^{-7x})$$

HTH

UPDATE. So the answer above corresponds to the original question. However, given the latest information, the answer needs to be updated. Question: Assume that X is the amount of time needed to solve a question. There is 50% chance that the question is easy, and will only need 5 mins to answer. However, there is a 50% chance that additional z minutes will be needed, where Z follows an exponential distribution. What is the CDF of the total time needed for a random question? Answer: if it is an easy question $$F1(X)=1(X>5)$$ If it is a hard question: $$F2(X)=0 \quad if \quad X<5$$ $$F2(X)=1-e^{-7(x-5)} \quad if \quad X>=5$$

Combining both: $$F(X) = 0.5*(1(X>5) + 1-e^{-7(x-5)}) \quad if \quad X>=5$$ $$F(X) = 0 \quad if \quad X<5$$

• The only thing, I believe there should be $F_1(x) = 1(x=5)$? Cause for $x<5$ we get $0$ and for $x>5$ it follows the exponential distribution? – bajun65537 Feb 17 at 16:09
• Not quite. What you need to think is terms of cumulative distributions. If you know that for certain x = 5. It means that the probability of X<5 is zero. When X=5 the cumulative Jumps to 1, and then it remains at 1. That is why $F(X)=1(X>=5)$ is the correct distribution for the first part of the distribution. The second part is just combining both CDFs. – Fcold Feb 17 at 18:11
• Fair, I get it now. There is however one more detail I am not quite happy about. So basically, the exponential distribution comes in when $x>5$. Shouldn't it be highlighted in CDF as well? $F_2(x) = 1 - e^{-7x} (x > 5)$? – bajun65537 Feb 17 at 18:20
• I believe the corrected (long) version would be: $$F(X)=\begin{cases} 0, & \text{if x<5} \\ 0.5, & \text{if x=5} \\ 0.5 + 0.5(1-e^{-7x}), & \text{if x>5}\end{cases}$$. But the way you answered the question $F(X) = 0.5\cdot 1(x \geq 5) + 0.5 (1-e^{-7x})$ implies that for $x<5$ the first term is $0$ - correct, but the second term is also present which shouldn't be a case. I think. – bajun65537 Feb 17 at 18:23
• Ok that is additional information. And I have updated the answer accordingly. (different assumptions different answer) – Fcold Feb 17 at 18:43