1

I'm trying to understand an example on finding Variance of a random variable. See example here on StatLect. Here's the relevant excerpt where I'm stuck.

Let $X$ be a discrete random variable with support

$$R_X = \{0,1\}$$

and Probability Mass Function (PMF)

$$p_X(x) = \begin{cases} q & \text{if $x=1$}, \\1-q & \text{if $x=0$}, \\0 & \text{$otherwise$} \end{cases}$$

where $0\le q \le1$.

I'm trying to figure out the alternative approach mentioned in the example where in order to find Variance I have to find the expected value $E[(X-E[X])^2]$.

I was able to figure out $E[X]$ easily. I computed the support $R_Z$ of $Z = (X-E[X])^2$ by evaluating Z for each value X and corresponding $E[X]$ would take. That gave me the support $R_Z = \{(1-q)^2, q^2\}$. Is this approach correct BTW?

It is this next step where the author computed PMF for Z which I could not figure out. He computed the following PMF

$$ p_Z(z) = \begin{cases} q & \text{if $z=(1-q)^2$}, \\1-q & \text{if $z=q^2$}, \\0 & \text{$otherwise$} \end{cases}$$

I guess this is trivial but how do I find what would be the probability of Z at $z=(1-q)^2$ and $q^2$?

u243676
  • 115

1 Answers1

1

$\mathsf E(X)~{= 1\cdot p_{\small X}(1)+ 0\cdot p_{\small X}(0)\\=q}$

I guess this is trivial but how do I find what would be the probability of Z at z=(1−q)2 and q2?

By definition $Z=(X-q)^2$ so...

The event of $\{X\,{=}\,1\}$ is the event $\{Z\,{=}\,(1-q)^2\}~$ so therefore $~p_{\small Z}((1-q)^2)=p_{\small X}(1)$

Likewise : $\{X\,{=}\,0\}$ is $\{Z\,{=}\,(0-q)^2\}~$ and therefore $~p_{\small Z}(q^2)=p_{\small X}(0)$

So $$p_{\small Z}(z)=\begin{cases} q&:& z=(1-q)^2\\1-q&:& z=q^2\\0&:&\text{elsewhere}\end{cases}$$

Graham Kemp
  • 129,094