Probability that sum of $3$ real numbers less than $2$, where each of them lies in $\left( 0,2 \right)$ .

Edited : I have no problem in my solution at all, so please don't extend it further, all I want is explanation of another solution whose screenshot and URL I have mentioned.

Suppose we select three real numbers X,Y and Z $\in \left( 0,2 \right)$.

What's the probability that :

$X+Y+Z\le 2$.

I tried to proceed in this way,

Let us assume 3-D coordinate axes $x,y$ and $z$. Now, the region bounded by

$0< x <2$,

$0< y <2$ and

$0 < z< 2$ is nothing else but a cube of side length $2$, let it's volume be $V (=8)$.The region bounded by $X+Y+Z\le 2$ is a tetrahedron with $2$ as intercept on each $x,y$ and $z$ axis.Now, volume of this tetrahedron is $\frac { 1 }{ 6 } \begin{bmatrix} 2 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 2 \end{bmatrix}$ i.e. $\frac { V }{ 6 }$. Thus, the probability will be ratio of volume of these two i.e. $\frac{1}{6}$.

But, I found another solution too for this same question asked on this website, whose solution I am unable to understand.Can someone please explain me that solution : Click here for that previously asked question and it's solution.

Or, take a look at the following screenshot :

Any help will be Appreciated!

P.S. - I am a high school student so please avoid use of higher Mathematics which is beyond my scope.

Let $X, Y, Z$ be i.i.d. as $\text{Uniform}(0, 1)$. Note that $T = X + Y$ has a triangular distribution with pdf

$$f_T(t) = \begin{cases} t & \text{if} ~~~~ 0 < t \leq 1 \\ 2 - t & \text{if} ~~~~ 1 < t < 2 \\ 0 &\text{elsewhere} \end{cases}$$

Therefore by law of total probability, \begin{align} \Pr\{T + Z < 2\} & = \int_0^2 \Pr\{Z < 2 - T|T = t\}f_T(t)dt \\ & = \int_0^1 \Pr\{Z < 2 - t\}tdt + \int_1^2 \Pr\{Z < 2 - t\}(2 - t)dt \\ & = \int_0^1 tdt + \int_1^2 (2 - t)^2dt \\ & = \frac {1} {2} + \frac {1} {3} \\ & = \frac {5} {6} \end{align}

What Did write down is note that $$\Pr\{Z > 2 - t\} = 1 - \Pr\{Z < 2 - t\} = \begin{cases} 0 & \text{if} ~~~~ 0 < t \leq 2 \\ t - 1 & \text{if} ~~~~ 1 < t < 2 \end{cases} = (t - 1)^+$$

Therefore $$\Pr\{T + Z < 2\} = 1 - \Pr\{T + Z > 2\} = 1 - E[\Pr\{T+Z>2|T\}] = 1 - E[(T-1)^+]$$ and the result follows.

In your question, it is equivalent to ask \begin{align} \Pr\{T + Z < 1\} & = \int_0^2 \Pr\{Z < 1 - T|T = t\}f_T(t)dt \\ & = \int_0^1 \Pr\{Z < 1 - t\}tdt + \int_1^2 \Pr\{Z < 1 - t\}(2 - t)dt \\ & = \int_0^1 (1 - t)tdt + 0\\ & = \frac {1} {2} - \frac {1} {3} \\ & = \frac {1} {6} \end{align}

The approach you linked to is based on a general result that says that the distribution of the sum of two independent continuous random variables $X$ and $Y$ is given by the convolution of the distributions of $X$ and $Y$. This is written

$$f_{X+Y} = f_X * f_Y \enspace,$$

where $*$ denotes convolution, not product. Convolution is not considered by most a high-school topic, but in the discrete case, it's not so difficult to get an idea of how it works. If you roll two dice, the probability mass function of the sum $S$ of the two values,

$$P(S=2) = \frac{1}{36}, P(S=3) = \frac{2}{36}, P(S=4) = \frac{3}{36}, \ldots, P(S=12) = \frac{1}{36},$$

is the (discrete) convolution of the probability mass function of one die (uniformly distributed between $1$ and $6$) with itself.

\begin{align} P(X+Y \!= n)~ &= \!\sum_{-\infty < i < \infty} \!P(X\!=i) \cdot P(Y\!=n-i) \\ &= \sum_{1 \leq i \leq 6} \,\frac{1}{6} \cdot P(Y\!=n-i) \\ &= \frac{1}{36} \sum_{1 \leq i \leq 6} [1 \leq n-i \leq 6] \enspace, \end{align} where $[1 \leq n-i \leq 6]$ equals $1$ if $1 \leq n-i \leq 6$ and $0$ otherwise. Convolution counts the different ways in which the values of the two dice produce a certain sum.

The convolution of two uniform continuous distributions with support $[0,2]$ turns out to be

$$f_{X+Y}(z) = \int_{-\infty}^{+\infty} \!f_X(z-x) f_Y(x) \,dx = \begin{cases} 0 & \text{ for } z < 0 \\ \frac{z}{4} & \text{ for } 0 \leq z < 2 \\ \frac{4-z}{4} & \text { for } 2 \leq z < 4 \\ 0 & \text{ for } 4 \leq z \end{cases}$$ When you throw in the third variable, the formula gets more complicated,

$$f_{X+Y+Z}(z) = \int_{-\infty}^{+\infty} \!f_Z(z-x) f_{X+Y}(x) \,dx = \begin{cases} 0 & \text{ for } z < 0 \\ \frac{z^2}{16} & \text{ for } 0 \leq z < 2 \\ \frac{-z^2 +6z -6}{8} & \text { for } 2 \leq z < 4 \\ \frac{z^2 - 12z + 36}{16} & \text{ for } 4 \leq z < 6 \\ 0 & \text{ for } 6 \leq z \end{cases}$$

but the essential piece of information for us is that between $0$ and $2$, we have $$f_{X+Y+Z}(z) = \frac{z^2}{16} \enspace.$$ If we measure the area under this curve, which we do by computing

$$\int_0^2 \frac{z^2}{16} dz = \left. \frac{z^3}{48} \right|_0^2 \enspace,$$

we get $\frac{1}{6}$ amidst the general merriment. Clearly in this case the geometric approach is easier and more intuitive, but it's nice to see that it is confirmed by the convolution approach. The other cool thing to observe is that the more random variables we add, the more the distribution looks bell-shaped.

• Thanks, for your wonderful answer, by combined contribution of yours and BGM's answer I have now finally understood Did's solution.Sorry, I couldn't approve your answer as I wanted to approve yours and BGM's answer but this website doesn't allow me to do that.Thus I had to choose any one.By the way, thanks again! Mar 6, 2017 at 13:07
• No worries. BGM's answer is an excellent one and addresses more directly your question. Mar 6, 2017 at 15:58

In two dimensions the problem becomes:

$X,Y ∈(0,2)$. What's the probability that: $X+Y≤2$

On a two dimensional graph the area under the line $y=-x+2$ from 0 to 2 divided by the area of the 2 unit square is the probability. Namely $2/4 = .5$.

To extend to 3 dimensions the corner of the 2 unit cube is divided by the volume of the cube. The volume of a corner of a cube is $x^3/6-x^2+2x$, where x is length of edge.

For $x=2$, volume is $4/3$, hence probability is $(4/3)/8 = 1/6$

• I think you didn't understand my query, I have no problem in Geometrical solution at all , all I want is explanation of another solution whose screenshot I have mentioned. Mar 4, 2017 at 19:07
• As a suggestion, mention that you want an explanation of someone else's solution near the top of your post. Probably also a good idea to provide URL to other solution. Frankly I don't understand the other solution at this point.
– Χpẘ
Mar 4, 2017 at 19:12
• Fine, No problem.Thanks for suggestion. Mar 4, 2017 at 19:15
• See my comment to peterh's answer. The > gets reversed in the other solution.
– Χpẘ
Mar 4, 2017 at 19:17

Your solution is okay, and the remote isn't.

You could have calculated the volume of the tetrahedron more easily, too, simply using the formula $\frac{A \cdot h}{3}$, where $A$ is the base area, and $h$ is its height. The base area is a triangle with area trivially $2$, its height is also $2$, thus its volume is $\frac{4}{3}$. Dividing it with the volume of the cube ($8$), we get the correct $\frac{1}{6}$.

• Are you saying that the solution whose screenshot I have mentioned is wrong !! Mar 4, 2017 at 19:04
• @JaideepKhare Exactly. I didn't checked his calculation very well, but I think he may have calculated the opposite probabilty. Mar 4, 2017 at 19:09
• Why so ? Because his answer wrong ?? Mar 4, 2017 at 19:11
• @JaideepKhare Because the probability can't be $\frac{1}{6}$ and also $\frac{5}{6}$, and as I explained, it is $\frac{1}{6}$. Mar 4, 2017 at 19:12
• The other solution reverses the > sign between the first equation and the second. The second equation should have z < 2 - x - y.
– Χpẘ
Mar 4, 2017 at 19:15