# Probablity: What's the p.d.f. of the random variable Z = X|X|

• sanctifier
I do not believe that you were "required" to compute the covariance of X and |X|. You were only asked for the PDF of Z, and in fact you did compute it (although you made some errors). I gave you a solution method, but you chose to ignore it and to do things your own way. That is OK, because doing it your way worked out fine, but continuing to use your own methods is going to make it difficult for you to learn from other people's ideas.You might have noticed that the covariance of X and |X| is a two-dimensional integral, over both x and y, of the product x|y| f(x,y). You can compute it directly from the definition, but it is
sanctifier

## Homework Statement

If the probability density function(p.d.f.) of a random variable X is f(x) = 1/6 * e-|x|/3 where x is lying in (-∞,∞) and |-x| = x if x≥0, then what is the p.d.f. of the random variable Z = XY = X*|X| where Y = |X| ?

Nothing special.

## The Attempt at a Solution

Answer: h(z) = f(x) * g(y) where g(y) = 2 * 1/6 * e-y/3 = 1/3 * e-y/3
Comment: Because for y=|x|, its range shrinks to half of x, i.e., (0,∞) instead of the oringinal (-∞,∞), consequently, its p.d.f. should be 2*f(x). It seems like if h(z) = f(x) * g(y) then X and Y are independent? I think this answer is wrong, anyone can help?

Last edited:
sanctifier said:

## Homework Statement

If the probability density function(p.d.f.) of a random variable X is f(x) = 1/6 * e-|x|/3 where x is lying in (-∞,∞) and |-x| = x if x≥0, then what is the p.d.f. of the random variable Z = XY = X*|X| where Y = |X| ?

Nothing special.

## The Attempt at a Solution

Answer: h(z) = f(x) * g(y) where g(y) = 2 * 1/6 * e-y/3 = 1/3 * e-y/3
Comment: Because for y=|x|, its range shrinks to half of x, i.e., (0,∞) instead of the oringinal (-∞,∞), consequently, its p.d.f. should be 2*f(x). It seems like if h(z) = f(x) * g(y) then X and Y are independent? I think this answer is wrong, anyone can help?

X and Y = |X| are not independent; they are about as dependent as you can get.

In problems of this type, do not try to "guess"; proceed carefully, step-by-step from first principles. In this case it is easiest to first figure out what is ##F(z) = \text{P}(Z \leq z )##, where ##Z = X |X|##. Look separately at the two cases z < 0 and z > 0. I will help you get started on the case when z < 0.

So, if z < 0 we can write it as z = -|z|. In order to have Z = X|X| ≤ z = -|z| we need X < 0; do you see why? So, in this case we have ##Z = -X^2##, hence we need ##- X^2 \leq - |z|##, or ##\{ |X| \geq \sqrt{|z|}\; \& \; X < 0\}##. This event has the same probability as ##\{X \geq \sqrt{|z|} \}##, because the distribution of X is symmetric about x = 0.

So, for ##z < 0## we have
$$F(z) \equiv \text{P}(X|X| \leq z) = \text{P} (X \geq \sqrt{|z|}).$$
You can complete the calculation, and also do it in the other case of z > 0. Then you get the density function ##f(z)## of ##Z## by differentiation of ##F(z)##.

I would not classify this as a precalculus problem.

Last edited:
If z > 0, then

$F(z) = p(Z \leq z) = p(x \mid x \mid \leq z) = p(x^{2} \leq z \; and \; x > 0) = p(0 < x \leq \sqrt{z}) = \int_ 0 ^ \sqrt{z} \frac{1}{6} e^{- \frac{x}{3} } dx$

$f(z) = \frac{dF(z)}{dz} = \frac{d\int_ 0 ^ \sqrt{z} \frac{1}{6} e^{- \frac{x}{3} } dx}{dz} = \frac{1}{12 \sqrt{z}} e^{- \frac{\sqrt{z}}{3}}$

If z < 0, then

$F(z) = p(Z \leq z) = p(x \mid x \mid \leq z) = p(-x^{2} \leq z \; and \; x < 0) = p(x \leq - \sqrt{-z}) = \int_ {-\infty} ^ {-\sqrt{-z}} \frac{1}{6} e^{ \frac{x}{3} } dx$

$f(z) = \frac{dF(z)}{dz} = \frac{d \int_ {-\infty} ^ {-\sqrt{-z}} \frac{1}{6} e^{ \frac{x}{3} } dx}{dz} = \frac{1}{12 \sqrt{-z}} e^{- \frac{\sqrt{-z}}{3}}$

If it is, then
$h(x) = \frac{1}{6} e^{-\frac{|x|}{3}}$
$g(|x|) = \frac{1}{3} e^{-\frac{|x|}{3}}$
$f(x|x|) \neq h(x) * g(|x|)$

Hence, x and |x| are not independent.

Is this correct?

Thank you very much, Ray Vickson.

sanctifier said:
If z > 0, then

$F(z) = p(Z \leq z) = p(x \mid x \mid \leq z) = p(x^{2} \leq z \; and \; x > 0) = p(0 < x \leq \sqrt{z}) = \int_ 0 ^ \sqrt{z} \frac{1}{6} e^{- \frac{x}{3} } dx$

$f(z) = \frac{dF(z)}{dz} = \frac{d\int_ 0 ^ \sqrt{z} \frac{1}{6} e^{- \frac{x}{3} } dx}{dz} = \frac{1}{12 \sqrt{z}} e^{- \frac{\sqrt{z}}{3}}$

If z < 0, then

$F(z) = p(Z \leq z) = p(x \mid x \mid \leq z) = p(-x^{2} \leq z \; and \; x < 0) = p(x \leq - \sqrt{-z}) = \int_ {-\infty} ^ {-\sqrt{-z}} \frac{1}{6} e^{ \frac{x}{3} } dx$

$f(z) = \frac{dF(z)}{dz} = \frac{d \int_ {-\infty} ^ {-\sqrt{-z}} \frac{1}{6} e^{ \frac{x}{3} } dx}{dz} = \frac{1}{12 \sqrt{-z}} e^{- \frac{\sqrt{-z}}{3}}$

If it is, then
$h(x) = \frac{1}{6} e^{-\frac{|x|}{3}}$
$g(|x|) = \frac{1}{3} e^{-\frac{|x|}{3}}$
$f(x|x|) \neq h(x) * g(|x|)$

Hence, x and |x| are not independent.

Is this correct?

Thank you very much, Ray Vickson.

You are correct that
$$f(z) = \frac{1}{12} \frac{e^{-\frac{\sqrt{|z|}}{3}}}{\sqrt{|z|}},$$
which form holds for both z > 0 and z < 0.

I don't know what you are doing after that, or why you bother. Of course, X and |X| are not independent; no calculations are needed to see this, because for any function k(x) the random variables X and k(X) are dependent. After all, if I tell you a value of X you know exactly what is the value of k(X) with no uncertainty whatsoever.

Because I was required to compute the covariance of x and |x|, hence I have to figure out z=x|x| for computing E[x|x|], now I have the formula of z, hence

$E[x|x|] = E[Z] = \int_0^\infty \frac{\sqrt{z}}{12} e^{ -\frac{ \sqrt{z}}{3} } dz + \int_{-\infty}^0 \frac{-\sqrt{z}}{12} e^{ -\frac{ \sqrt{z}}{3} } dz = \int_0^\infty \frac{ u^{2} }{6} e^{ -\frac{u}{3} } du - \int_0^\infty \frac{ v^{2} }{6} e^{ -\frac{v}{3} } dv = 0$

Then E[x] = 0 since f(x) is symmetric, finally

$Cov(x, |x|) = E[x|x|] - E[x]E[|x|] = 0$

sanctifier said:
Because I was required to compute the covariance of x and |x|, hence I have to figure out z=x|x| for computing E[x|x|], now I have the formula of z, hence

$E[x|x|] = E[Z] = \int_0^\infty \frac{\sqrt{z}}{12} e^{ -\frac{ \sqrt{z}}{3} } dz + \int_{-\infty}^0 \frac{-\sqrt{z}}{12} e^{ -\frac{ \sqrt{z}}{3} } dz = \int_0^\infty \frac{ u^{2} }{6} e^{ -\frac{u}{3} } du - \int_0^\infty \frac{ v^{2} }{6} e^{ -\frac{v}{3} } dv = 0$

Then E[x] = 0 since f(x) is symmetric, finally

$Cov(x, |x|) = E[x|x|] - E[x]E[|x|] = 0$

Strictly speaking, to compute expectations of functions Z = G(X) you do not need the distribution of Z (although having it does not hurt). Instead, you can use the so-called "Theorem of the Unconscious Statistician", which asserts that
$$E Z = \int f_X(x) G(x) \, dx$$
Here, ##f_X(x)## is the original density function of the original random variable ##X##. What the theorem is really saying is that
$$\int f_Z(z) z \, dz = \int f_X(x) G(x) \, dx,$$
where ##f_Z## is the density function of the random variable ##Z = G(X)##. See, eg, http://en.wikipedia.org/wiki/Law_of_the_unconscious_statistician .

So, in your case, ##EZ \equiv E(X |X|) = \int f_X(x) x |x| \, dx.##

Yes, the theorem is correct.

$E(x|x|)= \int_{- \infty }^{ \infty } \frac{1}{6} e^{ -\frac{|x|}{3} }x|x| dx = \int_{- \infty }^0 \frac{1}{6} e^{ \frac{x}{3} }(- x^{2} )dx + \int_0^{ \infty } \frac{1}{6} e^{ -\frac{x}{3} }x^{2} dx = - \int_0^{ \infty }\frac{1}{6} e^{ -\frac{u}{3} }u^{2} du + \int_0^{ \infty } \frac{1}{6} e^{ -\frac{x}{3} }x^{2} dx = 0$

Thank you again! Ray Vickson

## 1. What is the definition of a p.d.f.?

A p.d.f. (probability density function) is a mathematical function that describes the likelihood of a continuous random variable taking on a specific value. It is used to represent the probability distribution of a continuous random variable.

## 2. How is the p.d.f. of a random variable calculated?

The p.d.f. of a random variable is calculated by taking the derivative of the cumulative distribution function (c.d.f.). The c.d.f. is the integral of the p.d.f. and represents the probability that the random variable is less than or equal to a specific value.

## 3. What is the relationship between the p.d.f. and the c.d.f.?

The p.d.f. and the c.d.f. are inversely related. The p.d.f. gives the rate of change of the c.d.f. at a specific value, while the c.d.f. gives the cumulative probability up to that value. The area under the p.d.f. curve between two values represents the probability of the random variable falling within that range.

## 4. How does the p.d.f. of a random variable Z = X|X| differ from a regular p.d.f.?

The p.d.f. of a random variable Z = X|X| is a special type of p.d.f. that represents the probability distribution of a function of a random variable. In this case, the function is Z = X|X|, which means that the absolute value of X is taken twice. This changes the shape of the p.d.f. and can result in a more complex distribution.

## 5. What is the significance of the p.d.f. in probability theory?

The p.d.f. is a fundamental concept in probability theory as it allows us to calculate the probability of a continuous random variable taking on specific values. It is used in a variety of applications, such as in statistical modeling, risk analysis, and machine learning. Understanding the p.d.f. is essential for accurately describing and predicting the behavior of random variables.

• Precalculus Mathematics Homework Help
Replies
3
Views
3K
• Precalculus Mathematics Homework Help
Replies
2
Views
1K
• Precalculus Mathematics Homework Help
Replies
4
Views
668
• Precalculus Mathematics Homework Help
Replies
8
Views
360
• Precalculus Mathematics Homework Help
Replies
29
Views
1K
• Set Theory, Logic, Probability, Statistics
Replies
7
Views
843
• Precalculus Mathematics Homework Help
Replies
2
Views
615
• Precalculus Mathematics Homework Help
Replies
17
Views
545
• Set Theory, Logic, Probability, Statistics
Replies
10
Views
2K
• Precalculus Mathematics Homework Help
Replies
23
Views
993