I am trying to solve the following problem, but I do not know how to go about it.
Let $X \sim \mathcal{U}(0;1)$ and $Y \sim \mathcal{Exp}(1)$ be independent. Simulate in MATLAB how you can find the probability $\mathbb{P}[X + Y < 1]$.
Thank you.
I am trying to solve the following problem, but I do not know how to go about it.
Let $X \sim \mathcal{U}(0;1)$ and $Y \sim \mathcal{Exp}(1)$ be independent. Simulate in MATLAB how you can find the probability $\mathbb{P}[X + Y < 1]$.
Thank you.
Copyright © 2021 JogjaFile Inc.
I think you have learned that $-\ln(U)$ where $U$ is uniform on $(0;1)$ follows an $\mathcal{Exp}(1)$ law. Therefore, it will be a privilegized way to simulate such a distribution.
Here is a Matlab program that gives the result :
($Z$ is a boolean array with entries $0$ (resp. $1$) if the condition is not fulfilled (resp. fulfilled) ; the number of "ones" is the number of successes).
... that can be computed using the underlying density of Random Variable $Z=X+Y$ which is the convolution of the densities of $X$ and $Y$, i.e. :
$$(\text{for} \ x>0) : \ \ f_Z(x)=e^{-x}(e^{-min(x,1)}-1)$$
Here is a histogram of the simulation of $Z$ :