# Calculate the sum of Identical uniformly distributed random variables, can't understand a specific step from the textbook

I am trying to study from a textbook and encountered the following example:

No matter what I tried, I didn't understand the last step. How did the author change the limits of the integral in such way?

He than continues:

Which is even more odd to me. Where did these ranges come from?

I'd really appreciate your help. I am a probability newbie (obvious ha?) and really wish to learn.

Thanks!

No matter what I tried, I didn't understand the last step. How did the author change the limits of the integral in such way?

We have $$f_{X+Y}(a) = \int_0^1 f_X(a-y)\,dy$$, where $$f_X(t) = \begin{cases}1&0< t< 1\\ 0&\text{otherwise}\end{cases}$$. With a piecewise defined function like this or anything with an absolute value, the way to handle an integral is to split the interval everywhere we change formulas. So then, we look for $$y\in (0,1)$$ such that $$a-y=0$$ or $$a-y=1$$. That means either $$y=a$$ or $$y=a-1$$, and at most one of these will be in the interval. So then, four relevant regions:

• $$a \le 0$$. Then, for all $$y\in [0,1]$$, $$f_X(a-y)=0$$.The integral becomes $$\int_0^1 0\,dy = 0$$.
• $$0. We have a point in the interval with $$y=a$$, so we split there: $$\int_0^1 f_X(a-y)\,dy = \int_0^a f_X(a-y)\,dy + \int_a^1 f_X(a-y)\,dy = \int_0^a 1\,dy + \int_a^1 0\,dy$$ and the integral becomes $$\int_0^a \,dy = a$$
• $$1. We have a point in the interval with $$y=a-1$$, so we split there: $$\int_0^1 f_X(a-y)\,dy = \int_0^{a-1} f_X(a-y)\,dy + \int_{a-1}^1 f_X(a-y)\,dy = \int_0^{a-1} 0\,dy + \int_{a-1}^1 1\,dy$$ and the integral becomes $$\int_{a-1}^1 \,dy = 2-a$$
• $$2\le a$$. For all $$y\in [0,1]$$, $$a-y\ge 1$$, so $$f_X(a-y)=0$$ and the integral becomes $$\int_0^1 0\,dy =0$$

Nothing particular to do with probability; that's just how we work with integrals of piecewise defined functions.

• Thanks for your detailed answer - Iv'e got two questions regarding it: 1. What do you mean by absolute value? 2. Still couldn't understand how you deduced the four regions, where did the 2 come from? – superuser123 Jan 23 at 7:06
• The bit about absolute value? I'm saying that a formula with an absolute value is really two formulas, and that's something we'll split the interval for too. As for the relevance of $2$ - we're looking for points where $y=a$ or $y=a-1$. The latter is relevant until we reach $2$. – jmerry Jan 23 at 7:13

We want to compute $$\int_{0}^{1} f_{X}(a-y) dy$$ Well, $$f_{X}(a-y) = \begin{cases}1 & 0 < a-y < 1 \\ 0 & \text{otherwise}\end{cases}$$ If $$0 \le a \le 1$$, then $$a-y<1$$ for all $$y$$ in the region. And $$a-y > 0$$ when $$y < a$$. So, we have $$f_{X}(a-y) = \begin{cases}1 & 0 < y < a\\ 0 & a < y < 1\end{cases}$$ So that $$\int_{0}^{1} f_{X}(a-y) dy = \int_{0}^{a} 1 \,dy + \int_{a}^{1} 0 \,dy = a.$$ The case for $$1 \le a \le 2$$ is similar.