# Math Help - Simulating continuos RVs - Inverse Distribution Method

1. ## Simulating continuos RVs - Inverse Distribution Method

I know that if I want to simulate a value X it's X=F^-1(U). Just need some help as to what the limits are when I integrate f(x) to get F(X). Would they be 0 to 6 for x/36 and 6 to 12 for (12-x)/36? Because I thought one of the limits had to be x so that I would be able to substitute my U value to get X.

Thanks.

2. Originally Posted by ZTM1989

I know that if I want to simulate a value X it's X=F^-1(U). Just need some help as to what the limits are when I integrate f(x) to get F(X). Would they be 0 to 6 for x/36 and 6 to 12 for (12-x)/36? Because I thought one of the limits had to be x so that I would be able to substitute my U value to get X.

Thanks.
As $f(x)=0$ when $x\le 0$:

$F(x)=0$ for $x \le 0$

Then:

$F(x)=\int_0^x f(\xi)\;d\xi$ for $x>0$

but you may as well note that $F(x)=1$ for $x \ge 12$ (at least if the density is set up correctly)

CB

3. So you're saying I use 0 and x as the limits? Well that's what all the questions I've encountered have done too but I've never encountered this sort of a question with split density functions, do I just do both of them with 0 to x or what?

4. (*) $\int_0^x \frac{t}{36} dt$
(**) $\int_0^6 \frac{t}{36} dt + \int_6^x \frac{12-t}{36}dt$

I hope it helps

5. Originally Posted by temp
(*) $\int_0^x \frac{t}{36} dt$
(**) $\int_0^6 \frac{t}{36} dt + \int_6^x \frac{12-t}{36}dt$

I hope it helps
With a bit more detail:

(*) $\int_0^x \frac{t}{36} dt$ for $0,
(**) $\int_0^6 \frac{t}{36} dt + \int_6^x \frac{12-t}{36}dt$ for $6.

CB

6. Thank you very much, both of you.

7. Just another issue. Since i've not got any similar worked examples to look at, I'm finding hard to figure out where I go since I have two different F^-1(u) equations (36u and 12-36u) for the two separate ranges. How do I present these in the final answer with regards to the ranges?

8. Like this ... ?

$F^{-1}(u)=\begin{cases} \dots \quad \text{if } ?

9. U is simulated from Uniform[0,1]. So would I have 0 < u < 0.5 and 0.5 < u < 1 for the two of them respectively?