Expected Value of Cost Given Geometric Distribution

290 Views Asked by At

I do probability theory as a hobby and came across a question like this...wonder if somebody could shed some light.

Consider a spell which has a $\frac 18$ chance of successfully casting a "stun" on the opponent. If the opponent does not get "stunned", you will continuously use it until you successfully "stun" the opponent. Every time you use the stun, you pay the price of $\begin{pmatrix}\frac 13\end{pmatrix}^r$ magic points for the $r$-th attempt of using the stun. That means if the character has $k$ magic points at the beginning, he will pay:

  • $\begin{pmatrix}\frac 13\end{pmatrix}k$ points in total for casting it once
  • $\begin{pmatrix}\frac 13\end{pmatrix}k+\begin{pmatrix}\frac 13\end{pmatrix}^2k $ points in total for casting it twice
  • $\begin{pmatrix}\frac 13\end{pmatrix}k+\begin{pmatrix}\frac 13\end{pmatrix}^2k+\begin{pmatrix}\frac 13\end{pmatrix}^3k $ points in total for casting it three times
  • $\vdots$ and so on
  • He stops casting the spell once the opponent has been successfully "stunned". What is the mean and variance of the number of points this character will use?

    For once, I know that this is a geometric random variable with parameter or probability of success $\theta =\frac 18$ and so its mean is $\frac{1-\theta}{\theta}=7$.

    So does that mean that the expected value of points used is simply $\sum_{r=1}^7 \begin{pmatrix}\frac 13\end{pmatrix}^r=\frac{1-\begin{pmatrix}\frac 13\end{pmatrix}^7}{1-\frac13}$?

    1

    There are 1 best solutions below

    0
    On BEST ANSWER

    It is clearer to work with the cost random variable. Let $X$ be the total number of points spent, and let $a=E(X)$. Condition on the first stun attempt. If the attempt is successful (probability $\frac{1}{8}$), then the cost, and therefore the expected cost, is $\frac{1}{3}$. If the attempt is a failure, then the cost is $\frac{1}{3}$ plus the expected cost of the further attempts. This expected cost is $\frac{a}{3}$, because of the diminishing cost of attempts. It follows that $$a=\frac{1}{8}\cdot \frac{1}{3}+\frac{7}{8}\left(\frac{1}{3}+\frac{a}{3}\right).$$ Solve this linear equation for $a$. We get $a=\frac{8}{17}$.

    Alternately, we could find the distribution function of $X$, and find $E(X)$ by summing an infinite series.