1
$\begingroup$

$P(X = n) = pq^{n-1}$ where $p, q > 0$ and $p + q = 1$. Find ${\tt Var}(X)$ using generating function.

First I found $E(X)$:

$$\sum_{n=1}^\infty q^n = 1/(1-q) - 1 = q/(1-q)$$ then differentiate

$$\sum_{n=1}^\infty nq^{n-1} = 1/(1-q) + q/(1-q)^2 = 1/(1-q)^2$$

Then multiplying by p you have $p/(1-q)^2 = 1/p = E(X)$.

You can differentiate again to obtain

$$\sum_{n=1}^\infty n(n-1)q^{n-2} = 1/(1-q)^3$$

then $$\sum_{n=1}^\infty n^2q^{n-2} = 1/(1-q)^2 + 1/(1-q)^3$$

$pq$ times above sum = $q/p + q/p^2 = (1-p^2)/p^2$

I must have went wrong, because $Var(X) = E(X^2) - [E(X)]^2 = -1$.

Next, using the generating function, $$G(\alpha) = E(\alpha ^x)$$ $$G'(1) = E(X)$$ $$G''(1) = E(X(X-1))$$.

$$G(\alpha) = \sum_{n=1}^\infty \alpha^npq^{n-1} = p/q \sum_{n=1}^\infty (\alpha q)^n = p\alpha/(1-q\alpha)$$

$$G'(\alpha) = p/(1-q\alpha) + pq\alpha/(1-q\alpha)^2$$

$$G'(1) = 1/p = E(X)$$

So I'm fairly confident I have $E(X)$.

$$G''(\alpha) = 2pq/(1-q\alpha)^2 + pq^2\alpha/(1-q\alpha)^3$$

$$G''(1) = E(X(X-1)) = E(X^2) - E(X) = 2q/p + q^2/p^2$$

So add $E(X) = 1/p$ to get $E(X^2)$:

$$2q/p + 1/p + q^2/p^2 = (5p - p^2 + 1)/p^2$$

Then subtract $[E(X)]^2 = 1/p^2$ and you have

$$(5p - p^2)/p^2 = (5-p)/p = Var(X)$$

Not sure about this. Please let me know where the errors are in both methods, and provide the solutions.

EDIT: Tried again with generating function, think I got it this time:

$$G'(\alpha) = p/(1-q\alpha) + pq\alpha/(1-q\alpha)^2$$ $$G''(\alpha) = pq/(1-q\alpha)^2 + pq/(1-q\alpha)^2 + 2pq^2\alpha/(1-q\alpha)^3$$ $$G''(1) = 2q/p + 2q^2/p^2 = (2pq + 2q^2)/p^2 = 2q(p+q)/p^2 = 2(1-p)/p^2 = E(X(X-1))$$ For $Var(X)$, add $E(X)$ and subtract $[E(X)]^2$: $$(2(1-p) + p - 1)/p^2 = (1 - p)/p^2 = Var(X)$$ Please let me know if this is correct.

$\endgroup$
1
$\begingroup$

You have made several mistakes in the first method. The derivative of $\frac 1 {(1-q)^{2}}$ is $-\frac 2 {(1-q)^{3}}$. Also you have used the formula for $\sum\limits_{n=1}^{\infty} nq^{n-1}$ when you actually have $\sum\limits_{n=1}^{\infty} nq^{n-2}$. If you redo your calculations you should be able to get the same answer by both methods.

$\endgroup$
  • $\begingroup$ Please see my new attempt using the generating function. $\endgroup$ – Vahan Apr 20 at 1:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.