I am working on an assignment for a Stochastic Modeling class and am stuck on the following question:
Let $X$ have probability mass function $p_j = P \lbrace X = j \rbrace $ for $j \geq 1$. Let
$\lambda_n = P \lbrace X = n|X > n − 1 \rbrace = \frac{p_n}{1-\sum^{n-1}_{j=1} p_j}$.
The quantities $\lambda_n$, $n \geq 1$ are called the discrete hazard rates. The following is called the discrete hazard rate method of generating samples of $X$:
- Step 1: Set $X = 1$
- Step 2: Generate a uniform random number $U$ on $[0, 1)$
- Step 3: If $U < \lambda_X$ stop and output $X$.
- Step 4: Else, set $X = X + 1$ and go to step 2.
(a) Show that the output of the above algorithm has the desired probability mass function.
(b) Assume X is a geometric random variable with parameter p. Determine λ n and explain how the above algorithm operates in this case.
I am trying to follow the method for generating samples of $X$ but get stuck when trying to evaluate the discrete hazard rates $\lambda_n$. For $X = 1$, I get
$\lambda_1 = P \lbrace X = 1|X > 0 \rbrace = \frac{p_1}{1-\sum^{0}_{j=1} p_j}$
Given that the summation has poorly defined limits, I increment to $X = X + 1 = 2$, which gives:
$\lambda_2 = P \lbrace X = 2|X > 1 \rbrace = \frac{p_2}{1-\sum^{1}_{j=1} p_j}$
now I am not sure how to calculate $p_2$. The assigment gives the pmf as $p_j = P \lbrace X = j \rbrace $ for $j \geq 1$, which means $p_2 = P \lbrace X = 2 \rbrace $, but I feel like there is information missing; am I supposed to assume a distribution for $P \lbrace X = 2 \rbrace $?