# How to find distribution function of sum of 2 random variables that are uniformly distributed? [duplicate]

I am stuck with this tutorial question in one of my stats module and I would greatly appreciate some help:

Let $$X1$$ and $$X2$$ be independent random variables with $$a = 0$$ and $$b = 1$$ i.e. $$X1$$ and $$X2$$ are uniformly distributed over 0 to 1.

How do you find the distribution function of $$Y = X1 + X2$$ for $$1 i.e. what is $$F(y)$$?

• Convolution approaches with examples here and at Math.SE Sep 25, 2018 at 13:12
• In an answer at stats.stackexchange.com/a/43075/919 I describe four different ways to find the distribution of $Y.$
– whuber
Sep 25, 2018 at 17:17
• Are $X_1$ and $X_2$ independent? Uncorrelated? Sep 25, 2018 at 18:12

## PDF

We can first derive the PDF using convolution of two PDFs:

Case 1: If $$0 \leq y \leq 1$$, then $$f_{X_1}(y - x_2) = 1$$ if $$0\leq x_2 \leq y$$, and $$f_{X_1}(y-x_2) = 0$$ if $$x_2 > y$$. This means that $$$$\int_0^1 f_{X_1}(y-x_2) dx_2 = \int_0^y 1 dx_2 = y$$$$

Case 2: If $$1 < y < 2$$, then $$f_{X_1}(y-x_2) = 1$$ if $$y-1\leq x_2 \leq 1$$, and $$f_{X_1}(y-x_2) = 0$$ otherwise. So $$$$\int_0^1 f_{X_1}(y-x_2) d x_2 = \int_{y-1}^1 1 dx_2 = 2-y$$$$

Conclusion: $$f_Y(y) = y$$ if $$0 \leq y \leq 1$$ and $$2-y$$ if $$1 \leq y \leq 2$$. Otherwise, it is zero.

## CDF

This means the CDF, which is defined as follows $$$$F_Y(y) = \int_{-\infty}^y f_Y(y) dy$$$$

Case 1: If $$y < 0$$: Clearly $$F_Y(y) = 0$$

Case 2: If $$0 , then $$$$F_Y(y) = \int_{0}^y f_Y(t) dt = \int_0^y t dt = \frac{y^2}{2}$$$$

Case 3: If $$1, then $$$$F_Y(y) = \int_{0}^y f_Y(t) dt = \int_0^1 t dt + \int_1^y 2-t dt =\frac{1}{2} -\dfrac{y^2-4y+3}{2}$$$$

Case 4: If $$y > 2$$, then $$F_Y(y) = 1$$.

We need this probability: $$F_Y(y)=P(Y\leq y)=P(X_1+X_2 \leq y)$$ Consider a unit square in $$[0,1]\ \text{x} \ [0,1]$$. The Joint PDF .is distributed uniformly on this square, with value $$1$$. We draw $$x_1+x_2=y$$ line and integrate the Joint PDF below the line, which is equivalent to finding the area of the square below the line.

There are two cases: $$0 and $$2>y>1$$. I guess you need only $$y>1$$ part, which is "For you to find :)" I believe. You just need to draw the square, draw the line, find the area of the square above the line and subtract from $$1$$.

Note: There is also a solution with convolution if you're interested in.

• Thank you for the guide! I could find 0 < y < 1 which is 0.5(y^2), but I seem to get stuck moving to 1 < y < 2. Do you mind sharing the integrals for the area of the square above the line and i try to figure out the reasoning myself? @gunes Sep 25, 2018 at 13:18
• Writing the integral is harder here, since the joint PDF is uniform, it is much easier to find the area of the triangle above the line and then subtract it . But, the integral of $P(Y\geq y)$ is $$\int_{y-1}^{1}{\int_{x_1}^{1}{1 \ dx_2dx_1}}$$. Sep 25, 2018 at 13:55