Friday, January 05, 2007

How to generate X of geometric random variable

Geometric random variable X with parameter p:X can be thought of as representing the time of the first success when independent trials, each of which is a success with probability p, are performed. Since We can generate the value of X by generating a random number U and setting X equal to that value j for which
or, equivalently, for which
That is, we define X by

Hence, using the fact that logarithm is a monotone function, we obtain that X can be expressed as
Using Int( ) notation we can express X as

No comments: