# Probability density function of a random variable.

## Homework Statement

Let X be a posative random variable with probability density function f(x). Define the random variable Y by Y = X^2. What is the probability density function of Y? Also, find the density function of the random variable W = V^2 if V is a number chosen at random from the interval (-a,a) with a>0.

## The Attempt at a Solution

I know the answer to the first part is f(sqrt(y))/2sqrt(y) and the answer to the second part is 1/(2a*sqrt(w)) but i have no idea how to get to these answers. I have looked through my book and notes many times and i'm still lost. Any help would be very much appreciated

What is the probability density function? To solve think change of variables and integration.

What do I integrate? The only way i could see how to do it was to derive but i still didn't know what to derive and how to plug it in.

Can you define what a probability density function is in general terms?

A probability density function of a continuous random variable is a function that describes the relative likelihood for this random variable to occur at a given point in the observation space.

You do not use integration. I did Google search and the formula is in many places. Basically the probability contained in a differential area must be equal in each of the cases.

$$|f(x)dx| = |f(y)dy|$$

ok but how does that get me to my answer?

Ok thanks, how does it apply to the second part of the question then? I figured out the first part though.

## Homework Statement

Let X be a posative random variable with probability density function f(x). Define the random variable Y by Y = X^2. What is the probability density function of Y? Also, find the density function of the random variable W = V^2 if V is a number chosen at random from the interval (-a,a) with a>0.

## The Attempt at a Solution

I know the answer to the first part is f(sqrt(y))/2sqrt(y) and the answer to the second part is 1/(2a*sqrt(w)) but i have no idea how to get to these answers. I have looked through my book and notes many times and i'm still lost. Any help would be very much appreciated

My course teaches us to derive from basic definitions. Not sure if its the best way but its the only way I know. :p

(Cumulative) Distribution Function of Y
= F(y)
= P(Y < or = y)
= P(X^2 < or = y)
= P( -sqrt y < or = X < or = sqrt y)
= [ 1 - P(x < -sqrt y) ] + P(x < or = sqrt y)
= 1 - G(-sqrt Y) + G(sqrt Y)

Where G is the Distribution Function of X.

To get to the Density of Y, we need to differentiate F(y). Remember that G contains a function of Y so you need the chain rule.

For W = V^2, V has a uniform distribution on (-a,a). Everything is the same except "Y" becomes "W" and "X" becomes "V". Use the density of V accordingly.

P.S.
your answer to the first part appears to be wrong. which implies the 2nd part is wrong too.

Last edited:
Answers to the first and second part aren't wrong, those are the answers in the back of my book.

Answers to the first and second part aren't wrong, those are the answers in the back of my book.

Have you looked at my suggested method? After you differentiate the cumulative distribution function F(y) to get the probability density f(y), the answer is different from yours. Maybe there is a printing error. (happens all the time with textbooks)

I did look at your method Legendre, and i think i just do the integral of f'(sqrt(y)), which by the chain rule gives me f(y)/(2sqrt(y)) which is the answer i need.

Cumulative Dist. = F(y) = 1 - G(-sqrt Y) + G(sqrt Y)

Density = f(y) = d/dy [F(y)] = (1/2sqrt(y))[ g(-sqrt Y) + g(sqrt Y)]
where g is the density of X.

g(-sqrt Y) = 0 since X is a positive random variable.

So, f(y) = (1/2sqrt(y))(g(sqrt Y)).

P.S.
I apologize for mixing up the notation! I know f is supposed to be the density of X in your question but for the sake of being consistent with my previous post, I let f be the density of Y and g be the density of X instead. Sorry!

Cool thanks. Do you know how I would get the second part though. I know its got to be similar but in what step do i plug in the a. And why is it 1 over the answer rather than f(sqrt(W))? Thanks for the help

You're welcomed man! Getting stuck at maths sucks! I got stuck for days recently and this forum helped me out, so I know how valuable maths help can be!

W = V^2

1) V has a continuous uniform density function over (-a,a) for a>0. Let g(v) be the density function for V. g(v) = 1/2a. The formula for density of continuous uniform distributions on interval (a,b) is "1/(b-a)".

2) V is not a positive random variable because V is a number chosen from (-a,a). V < 0 for some outcomes.

3) Considering the previous point, we need to re-derive the equation f(y) from our previous part. I am sticking to my notation for consistency. Apologies if its confusing.

F(y) = 1 - G(-sqrtY) + G(sqrtY)

Then f(y) = (1/2sqrt(y))[ g(-sqrt Y) + g(sqrt Y)

4) We know g(v) = 1/2a for all v, so we plug it in and replace all y with w.

f(y) = (1/2sqrt(w))(1/2a + 1/2a) = (1/2sqrt(w))(1/a) = 1/(2a*sqrt(w)) as required.