# P(Z<z), Z=X if X<=1, Z=Y+1 if X>1

#### ogry

##### New Member
So here is the question

X∼exp(1)X
Y∼exp(2)Y (exponentialy distributed)
X and y are independent.

Z=Xif x≤1. Otherwise Z=Y+1. What is the cumulative distribution function of Z?

So what i thought.
Fz(z)=P(Z<z)=P(Z<z∣X<1)×P(X<1)+P(Z<z∣X>1)×P(X>1)=(1−e−z)(1−e−1)+(1−e−2(z−1))

But i am realy not sure. Should z maybe be devided in to tow cases wher z<1 and z>1 maybe? So F(z) is not continouse?

Last edited:

#### ogry

##### New Member
can anyone tell me if this is possible? please I've been breaking my head over this for 2 days. and I am actualy pretty sure its not suppose to be that hard.

F(z) = (1-e^-z)(1-e^-1) if Z<=1
F(z)=(1-e^-2(z-1))e^-1 if z>1

or
maybe it would be
F(z)=(1-e^-z)(1-e^-1)+(1-e^-2(z-1))e^-1
both of them I derive from the total probability rule but one is divided into 2 parts and on is not.
but both don't feel right and I have no idea how else to approach it.

Last edited:

#### BGM

##### TS Contributor
The given question is $X \sim \text{Exp}(1), Y \sim \text{Exp}(2), X, Y$ are independent. Assuming the parametrization means the pdf of $Y$ is $f_Y(y) = 2e^{-2y}, y > 0$. Define

$Z = \begin{cases} X &\text{if } X \leq 1 \\ Y + 1 & \text{if } X > 1 \end{cases}$

It is trivial that $\Pr\{Z \leq 0\} = 0$. By law of total probability, for $z > 0$, the CDF $F_Z(z)$

$= \Pr\{Z \leq z\}$

$= \Pr\{Z \leq z, X \leq 1\} + \Pr\{Z \leq z, X > 1\}$

$= \Pr\{X \leq z, X \leq 1\} + \Pr\{Y + 1 \leq z, X > 1\}$

$= \Pr\{X \leq \min\{z, 1\}\} + \Pr\{Y \leq \max\{z - 1, 0\}\}\Pr\{X > 1\}$

$= 1 - e^{-\min\{z, 1\}} + \left(1 - e^{-2(z - 1)}\right)e^{-1}\mathbf{1}\{z > 1\}$

$= \begin{cases} 1 - e^{-z} & \text{if } 0 < z \leq 1 \\ 1 - e^{-1} + e^{-1} - e^{-2z + 1} = 1 - e^{-2z + 1} & \text{if } z > 1 \end{cases}$