# Two problems with random variables transformations

## Homework Statement

[1] A random variable X is distributed as fX(x) = 1/9*(1+x)^2 1{-1<= x<= 2}.

a) Find the density function of Y = -X^2 + X + 2.
b) Find the cummulative distribution function of Y = X1{-1<=X<=1} + 1{X>=1}

[2] Find the function that transforms a variable X with fX(x) = e^(-x) 1{x>0} into a variable Y with fY(y) = 31{0<=y<=1/4} + 1/31{1/4<y<1}.

## The Attempt at a Solution

The problem with exercise 1 is that the functions aren't injective in the domain of X. My first guess with a) was to use equivalent events:

FY(y) = P(Y<=y) = P(-X^2 + X + 2 <= y)
FY(y) = P(-X^2 + X + 2 - y<=0) = P($$X \le \frac{1}{2} - \frac{{\sqrt {9 - 4y} }}{2}$$) + P($$X \ge \frac{1}{2} + \frac{{\sqrt {9 - 4y} }}{2}$$)

Then, taking into account that X is absolutely continuous:

FY(y) = P($$X \le \frac{1}{2} - \frac{{\sqrt {9 - 4y} }}{2}$$) + (1 - P($$X \le \frac{1}{2} + \frac{{\sqrt {9 - 4y} }}{2}$$))

FY(y) = FX($$\frac{1}{2} - \frac{{\sqrt {9 - 4y} }}{2}$$) + (1 - FX($$\frac{1}{2} + \frac{{\sqrt {9 - 4y} }}{2}$$)).

Then I could derive term to term and find fY(y). Is this OK? I'm mainly worried about the unicity of all this, due to g(x) not being injective.

For point b), on the other hand, I don't know how to interprete it. Should I consider this a problem of conditional probabilities? I mean, FY(y) = FX|-1<=X<=1(x) + ????

For exercise 2, I need a hint. Best thing I could think was that, since fY(y) = fX(g-1(y))/(g'(g-1(y))), that in both cases g(x) must some sort of logarithmic function.

Any recomendations? Thanks.

## Answers and Replies

lanedance
Homework Helper
first thought, have you tired completing the square, may help make it an easier transformation, though will have a look thourgh the rest

Anybody else?

lanedance
Homework Helper
notation is alittle difficult to read what are the bold 1s?

## Homework Statement

[1] A random variable X is distributed as fX(x) = 1/9*(1+x)^2 1{-1<= x<= 2}.

a) Find the density function of Y = -X^2 + X + 2.

The problem with exercise 1 is that the functions aren't injective in the domain of X. My first guess with a) was to use equivalent events:

FY(y) = P(Y<=y) = P(-X^2 + X + 2 <= y)
FY(y) = P(-X^2 + X + 2 - y<=0) = P($$X \le \frac{1}{2} - \frac{{\sqrt {9 - 4y} }}{2}$$) + P($$X \ge \frac{1}{2} + \frac{{\sqrt {9 - 4y} }}{2}$$)

Then, taking into account that X is absolutely continuous:

FY(y) = P($$X \le \frac{1}{2} - \frac{{\sqrt {9 - 4y} }}{2}$$) + (1 - P($$X \le \frac{1}{2} + \frac{{\sqrt {9 - 4y} }}{2}$$))

FY(y) = FX($$\frac{1}{2} - \frac{{\sqrt {9 - 4y} }}{2}$$) + (1 - FX($$\frac{1}{2} + \frac{{\sqrt {9 - 4y} }}{2}$$)).

Then I could derive term to term and find fY(y). Is this OK? I'm mainly worried about the unicity of all this, due to g(x) not being injective.

This looks reasonable to me as you are splitting the function into 1:1 parts,

Another equaivalent way, not necessarily easier but maybe clearer, is as follows

First note range of Y is [0,1] and the function is 1:1 on the intervals [-1,1/2) & (1/2,2]

so treat the contribution from each section seperately, first X<1/2, solve for X
$$Y = -(X-\frac{1}{2})^2 + \frac{9}{4}$$
$$X = \sqrt{\frac{9}{4} -Y}+\frac{1}{2})$$
then find the derivative
$$|\frac{dx}{dy}| = ...$$

the contribution to the density function of Y, from the region X<1/2
$$f_{Y, (X<1/2)}(y) = f_X(x(y)) |\frac{dx}{dy}|$$

do the same for X>1/2 and sum the contributions to get the total distribution for Y
$$f_{Y}(y) = f_{Y, (X<1/2)}(y)+f_{Y, (X>1/2)}(y)$$

Last edited:
lanedance
Homework Helper

## Homework Statement

[1] A random variable X is distributed as fX(x) = 1/9*(1+x)^2 1{-1<= x<= 2}.

b) Find the cummulative distribution function of Y = X1{-1<=X<=1} + 1{X>=1}

For point b), on the other hand, I don't know how to interprete it. Should I consider this a problem of conditional probabilities? I mean, FY(y) = FX|-1<=X<=1(x) + ????
For b) i would read it as Y = X for -1<X<1 and one otherwise. What is the probabilty of X>1?
this the probabilty Y should have for being 1 (check its not one anywhere else on the X domain).

In effect the distribution for Y will be a combination of continuous & discrete - do you know about dirac delta functions?

that said its pretty hard to read similar for 2, can you explain the notation?

For b) i would read it as Y = X for -1<X<1 and one otherwise. What is the probabilty of X>1?

It's $$\int\limits_1^2 {{f_X}(x)dx}$$

this the probabilty Y should have for being 1 (check its not one anywhere else on the X domain).

It can't, because Y is X for -1<=X<1.

In effect the distribution for Y will be a combination of continuous & discrete - do you know about dirac delta functions?

I don't think it's necessary, since they ask me for the cummulative distribution function, not the density function.

that said its pretty hard to read similar for 2, can you explain the notation?

OK, here it goes again:

[2] Find the function that transforms a variable X with $${f_X}(x) = {e^{ - x}}*1\left\{ {x > 0} \right\}$$ into a variable Y with $${f_Y}(y) = 3*1\left\{ {0 < y < 1/4} \right\} + 1/3*1\left\{ {1/4 < y < 1} \right\}$$, where 1{X $$\in$$A} is the indicator function.

Thanks.

lanedance
Homework Helper
ok so for 1b) as it cumulative distribrution function can you write it in terms of a step function?

lanedance
Homework Helper
for 2) i haven't tried yet but would start from
$$f_Y(y) = f_X(x)|\frac{dx}{dy}|$$

also examine the cumulative probability at the change in $f_Y(x)$ at the point y = 1/4.

as another idea you could look at how to make $f_Z(z) = 1$, on [0,1] as a simpler first pass