# simulation variable

• Apr 15th 2007, 11:53 AM
simulation variable
HI please can someone cheeck this problem I tried to do?

Suppose X is the waiting time, in seconds, for a certain particle's emmission,
f(x)=0.1e^(-0.1x), x>0
0 elsewhere.

You are simualting a random sample of 2 values of X. You have simulated the following 2 values of Y, where Y has a (0,1) uniform pdf; y1=0.1942, y2=0.6209.
Find the 2 simulated values of X, x1 and x2.

Here what I did.
f(x)=0.1e^(-0.1x)

--> F(x)=1-e^(-0.1x)
let u =F(x)=1-e^(-0.1x)

x= -[ln(1-u)]/0.1 (1)
then for x1 take y1=0.1942=u , replace in the (1)
x1=2.1591

I do the same for x2. you get x2=9.6996

Is it the correct way to do it?
Thank you.
• Apr 15th 2007, 12:34 PM
CaptainBlack
Quote:

HI please can someone cheeck this problem I tried to do?

Suppose X is the waiting time, in seconds, for a certain particle's emmission,
f(x)=0.1e^(-0.1x), x>0
0 elsewhere.

You are simualting a random sample of 2 values of X. You have simulated the following 2 values of Y, where Y has a (0,1) uniform pdf; y1=0.1942, y2=0.6209.
Find the 2 simulated values of X, x1 and x2.
Here what I did.
f(x)=0.1e^(-0.1x)

--> F(x)=1-e^(-0.1x)
let u =F(x)=1-e^(-0.1x)

x= -[ln(1-u)]/0.1 (1)
then for x1 take y1=0.1942=u , replace in the (1)
x1=2.1591

I do the same for x2. you get x2=9.6996

Is it the correct way to do it?
Thank you.

Yes (though there is some ambiguity in this as you are using more operations
than necessary, as x=ln(u)/0.1 will also give a negative exponential random
number with the right rate constant, but different from what you have even
though it starts with the same u).

RonL