# PDF to CDF and Inverse CDF

## Homework Statement

I was hoping someone could just verify this solution is accurate.

p(x) =
0 , x < 0
4x, x < .5
-4x + 4 , .5 <= x < 1

Find CDF and Inverse of the CDF.

## The Attempt at a Solution

CDF =
0 , x < 0
2x^2 , 0 <= x < .5
-2x^2 + 4x - 1 , .5 <= x <= 1
1, x > 1

Inverse of the CDF

0 , x < 0
sqrt( x / 2) , 0 <= x < .5
1 + sqrt ( 1 - x) / sqrt ( 2 ) , .5 <= x <= 1
1, x > 1

Thanks[/B]

Related Calculus and Beyond Homework Help News on Phys.org
Ray Vickson
Homework Helper
Dearly Missed

## Homework Statement

I was hoping someone could just verify this solution is accurate.

p(x) =
0 , x < 0
4x, x < .5
-4x + 4 , .5 <= x < 1

Find CDF and Inverse of the CDF.

## The Attempt at a Solution

CDF =
0 , x < 0
2x^2 , 0 <= x < .5
-2x^2 + 4x - 1 , .5 <= x <= 1
1, x > 1

Inverse of the CDF

0 , x < 0
sqrt( x / 2) , 0 <= x < .5
1 + sqrt ( 1 - x) / sqrt ( 2 ) , .5 <= x <= 1
1, x > 1

Thanks[/B]
You chose the wrong root for ##.5 \leq x \leq 1##. Can you see why?

You chose the wrong root for ##.5 \leq x \leq 1##. Can you see why?
Thanks for pointing that out. The value for that should also be between .5 and 1, and with that root, it can be greater than 1?

Ray Vickson