Equation: Given a random variable $Z$, let $Z ~ Geometric(\theta)$, Find $P(5 \leq Z \leq 9)$.
Attempt 1:
Try something like $P(5 \leq Z \leq 9) = P(Z = 9) - P(Z = 5) = \theta[(1-\theta)^9-(1-\theta)^5]$
I know this is a valid method for continuous distributions, but I wasn't sure if it would work the same way for a discrete function, like geometric. So I tried to compute it manually in attempt #2.
Attempt 2:
$P(5 \leq Z \leq 9) = P(Z = 5) + P(Z = 6) + P(Z = 7) + P(Z = 8) + P(Z= 9) = $Some answer
I know this one works, but I feel it's a bit too much in terms of computation. Like, if I was given an equation that asked for an interval from $3$ to $1000$, then there's no way I could manually compute that by hand.
Which is why I was wondering if there was a more efficient method to calculate the geometric distribution over a given interval? I tried to put everything into a summation and derive an equation, but I get stuck after pulling the theta out of the equation such that it's
$\sum\limits_{i=0}^n (1- \theta)^i\theta = $ $\theta \sum\limits_{i=0}^n (1- \theta)^i $
Anybody have a better solution?
Answer
Your original solution (first attempt) is not quite correct as written. Instead, you should be calculating $P(Z \geq 5) - P(Z > 9)$. Intuitively, this is "the chance that $Z$ is at least $5$, but not more than $9$." For a geometric distribution, you could write this as $P(Z > 4) - P(Z > 9)$. But it is actually not too difficult to compute $P(Z > x)$ for any geometric distribution; this holds iff the first $x$ trials are failures, so it happens with probability $P(Z > x) = (1 - \theta)^x$ (assuming $\theta$ is the probability of success in a single trial). In general, this means that, for geometric $Z$, we have:
$$
\begin{align*}
P(a \leq Z \leq b) &= P(Z \geq a) - P(Z > b) \\
&= P(Z > a-1) - P(Z > b) \\
&= (1-\theta)^{a-1} - (1 - \theta)^b
\end{align*}
$$
Also note that your summation (from the second attempt) works as well, once simplified. To find $P(a \leq Z \leq b)$, we note that, from the geometric distribution, this is exactly equal to
$$\sum_{k=a}^b \theta (1 - \theta)^{k-1}$$
But this is a geometric series with initial term $\theta(1 - \theta)^{a-1}$ and common ratio $1 - \theta$. The sum of such a finite geometric series with $b-a + 1$ terms is:
$$
\begin{align*}
\frac{\theta(1-\theta)^{a-1} \cdot \left( 1 - (1 - \theta)^{b-a + 1}\right)}{1 - (1 - \theta)} &= (1-\theta)^{a-1} \cdot \left( 1 - (1 - \theta)^{b-a + 1}\right) \\
&= (1-\theta)^{a-1} - (1 - \theta)^b
\end{align*}
$$
So the two methods agree.
No comments:
Post a Comment