Let $B$ be the indicator of what type of jump occurs, if any; $B=-1$ when there's a negative jump, $B=1$ when there's a positive jump and $B=0$ if there is no jump. Then to determine the jump, you just need to generate $B$. According to your formulation,
$$ P(B=-1) = p_{down} $$
$$P(B=1) = p_{up} $$
$$P(B=0) = 1-p_{up}-p_{down} $$
You can generate $B$ by generating a Uniform(0,1) variable $U$ and letting
$$B=-1 \ \ \ {\rm if} \ \ \ U \leq p_{down}, $$
$$B=1 \ \ \ {\rm if} \ \ \ p_{down} \leq U \leq p_{down}+p_{up} $$
and
$$B=0 \ \ \ {\rm if} \ \ \ U \geq p_{down}+p_{up}$$
Examining the Uniform(0,1) CDF will make it clear why the probabilities work out correctly.
You could integrate out $Y$ if the question were to determine the distribution of $S(T)$ analytically but I think the point is to determine its distribution by simulation.
Note: Assuming you don't have a function to generate normally distributed variables, you will also have to generate more uniforms to simulate $X$. If you use the Box-Muller transform method of generating normals, you can simulate two normals for every two uniformly distributed variables.
The distribution function (CDF) of the minimum order statistic from an i.i.d. sample of $X$'s is
$$F_Z(z) = 1- [1- F_X(z)]^n$$
In our case $F_X(x) = 1-e^{-\lambda x}$ so
$$F_Z(z) = 1- [1- (1-e^{-\lambda z})]^n = 1-e^{-n\lambda z}$$
We are interested in the distribution of the random variable $Y\equiv n\lambda Z$.
A) The "CDF method" goes as follows:
$$P(Y \leq y) = P(n\lambda Z \leq y) = P\left( Z \leq \frac 1{n\lambda}y\right) = F_Z\left( \frac 1{n\lambda}y\right) = 1-e^{-n\lambda \frac 1{n\lambda}y}$$
$$\implies F_Y(y) = 1-e^{-y}$$
which is the CDF of an $\text{Exp}(1)$ random variable. In general, when the cumulative distribution function of the "source" random variable is closed formed/simple, this method is less prone to mistakes than the
B) "Change of Variable" method
The density function of $Z$ is
$$ f_Z(z) = n\lambda e^{-n\lambda z}$$
For the random variable $Y\equiv n\lambda Z$ we have $Z = \frac 1{n\lambda}Y$ and so
$$f_Y(y) = \left|\frac {\partial Z}{\partial Y}\right|\cdot f_Z\left(\frac 1{n\lambda}y\right) = \frac 1{n\lambda}\cdot n\lambda e^{-n\lambda \frac 1{n\lambda}y} = e^{-y}$$
which is the probability density function of an $\text{Exp}(1)$ random variable.
Best Answer
Sample from a Pareto distribution. If $Y\sim\mathsf{Exp}(\mathrm{rate}=\lambda),$ then $X = x_m\exp(Y)$ has a Pareto distribution with density function $f_X(x) = \frac{\lambda x_m^\lambda}{x^{\lambda+1}}$ and CDF $F_X(x) = 1-\left(\frac{x_m}{x}\right)^\lambda,$ for $x\ge x_m > 0.$ The minimum value $x_m > 0$ is necessary for the integral of the density to exist.
Consider the random sample
y
of $n = 1000$ observations from $\mathsf{Exp}(\mathrm{rate}=\lambda=5)$ along with the Pareto sampley
resulting from the transformation above.Below is the empirical CDF (ECDF) of Pareto sample
x
along with the CDF (dotted orange) of the distribution from which it was sampled. Tick marks along the horizontal axis show individual values ofx
.Ref: See the Wikipedia page on Pareto distributions, under the heading for relationship to exponential.