Say we have the following "triangle" probability density function:
$ p_{S}(s) = \left\{ \begin{array}{lr} s & : s \in[0,1]\\ 2-s & : s \in [1,2]\\ 0 & o.w. \end{array} \right. $
I want to sketch or write down a piece-wise probability density function of a new random variable $g(S) = S/2$. i.e. I am trying to find $p_{S/2}(k)$.
I know this is suppose to be a very easy question but I am having some difficulties doing it.
This is what I have so far:
$p_{S/2}(k) = P[\frac{S}{2} = k]= P[S = 2k] = p_S(2k)$
Thus, the answer I have is:
$ p_{\frac{S}{2}}(k) = \left\{ \begin{array}{lr} 2k & : k \in[0,0.5]\\ 2-2k & : k \in [0.5,1] \\ 0 & o.w. \end{array} \right. $
Which is obviously wrong because it doesn't integrate to 1.
My reasoning is the following. Whatever value of k we put to $p_{S/2}(k)$ it will be the same as $P_{S}(2k)$. For example, say that we had $k = 0.1$. Then $p_{S/2}(0.1) = p_{S}(0.2) = 0.2$. Which means $P_{S/2}(k) = 2k$ for k \in 0.5. But at $0.5+\epsilon$ (small $\epsilon$) we have for the first time a "switch" to the other side of $p_S(k)$. So any value in that range maps to $2-2k$. For other values the pdf is zero. I know this reasoning must be wrong because it gives me a pdf that doesn't integrate to 1.
Where did I go wrong? The ideal answer can explain what the answer is or why I am wrong, not only what the answer is, since I have solutions anyway.