So the task says: There are 2 variables that get random variables from 0 to 1. What is the distribution function for z that represents distance between the two variables.
Lets say first variable is x and second is y, z = |x - y|, we can draw a graph like this https://i.stack.imgur.com/xRUe1.jpg , however I really don't know how can i calculat this G area, can someone help me?
Edit: official solution to the problem is $2z - z^2$
OOh of course, i have found the solution it is the area of square which is 1 - area of two triangles with one side of the triangle equal to 1 - z. so the solution would be 1 - (1-z)(1-z) = 2z -z^2