0

To find the variance for a variable I know you're supposed to use:

$$Var(X)=E(X^2)-E^2(X)$$

When looking at the solutions to one of my class's problems I see $E(X)=p/(1-p)$.

They then go on to say that $E^2(x)=p^2/(1-p^2)$.

I'm confused because I thought $E^2(X)$ just meant to square $E(X)$, which would be

$$p/(1-p) * p/(1-p) = p^2/(1-2p+p^2)$$

Am I mistaken or is there a typo in the solution?

**Edit: Here's the full problem's solution, which is to compute the variance in the number of users in an M/M/1 system: https://i.stack.imgur.com/hLEzD.jpg

A.Γ.
  • 29,518
MarksCode
  • 169
  • $E^2(X)$ is just bad notation. Who knows what it means? – Angina Seng Jun 08 '17 at 05:09
  • 3
    Are you sure they didn't really say $p^2/(1-p)^2$? At any rate, that's what it should be. – Arthur Jun 08 '17 at 05:09
  • @LordSharktheUnknown Blame trig conventions, with stuff like $\sin^2x$. – Arthur Jun 08 '17 at 05:10
  • Thanks for your answers. I've added the full problems solution as an edit. Maybe I'm reading the problem wrong? – MarksCode Jun 08 '17 at 05:12
  • As Arthur surmises, it's just a daft typo. They use "$E^2(X)=p^2/(1-p)^2$" later on! It's still evil notation. – Angina Seng Jun 08 '17 at 05:14
  • @LordSharktheUnknown Ah, ok that makes sense. Thanks for clarifying! – MarksCode Jun 08 '17 at 05:18
  • Hey @Arthur, I need your great math mind's advice. On line 4 of the proof, how am I supposed to know as a math noobie that the right step is to expand k^2 to (k-1+1)^2? How would I even know to take this approach? – MarksCode Jun 08 '17 at 05:54
  • Experience, and trial and error. When you read a proof, you don't see the hours, or even possibly in some cases days or months, that went into trying different things that didn't work. But I can promise you that it's there. – Arthur Jun 08 '17 at 06:04
  • Welp... thanks @Arthur – MarksCode Jun 08 '17 at 06:07
  • I don't think this specific proof took days to complete the first time it was done, but I'm pretty certain that whoever did it the first time was either really lucky, or they tried a few different things first, failed, and didn't give up. – Arthur Jun 08 '17 at 06:42
  • @LordSharktheUnknown Actually this notation often comes up in some statistics notes and texts: https://stats.stackexchange.com/questions/220452/is-it-okay-to-write-the-square-of-expectation-of-a-random-variable-x-as-math. – StubbornAtom Jun 08 '17 at 07:31

1 Answers1

1

The variance is indeed the expectation of the squared variable minus the square of the expectation of the variable (see below why). This is denoted as

$$E(X^2)-(E(X))^2$$ or simply $$E(X^2)-E^2(X).$$

For a geometric distribution, we have

$$(1-p)\sum_{k=0}^\infty p^k=1$$ and differentiating on $p$ gives

$$-\sum_{k=0}^\infty p^k+(1-p)\sum_{k=0}^\infty kp^{k-1}=0$$ and from this

$$E(X)=\sum_{k=0}k(1-p)p^k=p\sum_{k=0}^\infty p^k=\frac p{1-p}.$$

Now,

$$\sum_{k=0}^\infty kp^k=\frac p{(1-p)^2}$$ and differentiating again,

$$E(X^2)=(1-p)p\sum_{k=0}^\infty k^2p^{k-1}=(1-p)p\frac{(1-p)^2+2p(1-p)}{(1-p)^4}=p\frac{1+p}{(1-p)^2}.$$

Finally,

$$\text{Var}(X)=p\frac{p+1}{(1-p)^2}-\frac{p^2}{(1-p)^2}=\frac p{(1-p)^2}.$$


By definition,

$$\text{Var}(X)=E((X-E(X))^2)=E(X^2-2XE(X)+E^2(X)).$$

By linearity of the expectation operator and the fact that the expectation of a constant is that constant, this equals

$$E(X^2)-2E(X)E(X)+E(E^2(X))=E(X^2)-2E^2(X)+E^2(X)=E(X^2)-E^2(X).$$


Alternatively, we have (notice the starting indexes)

$$S_k:=\sum_{k=1}^\infty kp^k=\sum_{k=1}^\infty (k-1)p^{k-1}$$

so that, from $k-(k-1)=1$,

$$(1-p)S_k=S_k-pS_k=\sum_{k=1}^\infty kp^k+\sum_{k=1}^\infty (k-1)p^k=\sum_{k=1}^\infty p^k=\frac p{1-p}$$ and $$S_k=\frac p{(1-p)^2},\\E(X)=\frac p{1-p}.$$

Similarly

$$T_k:=\sum_{k=1}^\infty k^2p^k=\sum_{k=1}^\infty (k-1)^2p^{k-1}$$

so that, with $k^2-(k-1)^2=2k-1$,

$$(1-p)T_k=T_k-pT_k=\sum_{k=1}^\infty k^2p^k+\sum_{k=1}^\infty (k-1)^2p^k=2\sum_{k=1}^\infty kp^k-\sum_{k=1}^\infty p^k=\frac{2p}{(1-p)^2}-\frac p{1-p}$$ and $$T_k=\frac{p^2+p}{(1-p)^3},\\E(X^2)=p\frac{p+1}{(1-p)^2}.$$