If we take two numbers, B and C, and assume they are randomly and uniformly distributed on the interval [0,1], we must prove that P(B)< 0 or P(B)> 1 is null. However, this is easy as it is given in the definition. Likewise, we can use R to generate a random integer B or C.
B <- runif(1)
C <- runif(1)
B
## [1] 0.4267966
C
## [1] 0.07936053
help(runif)
Additionally, we must show that \(f(x) \geq 0\), which is true by inspection. Another condition is that \(\int_{a}^{b} f(x) = 1\) on the interval specified. The help(runif) command (or other documentation) gives us our f(x) such that \[ f(x) = \frac{1}{max-min}= \frac{1}{1-0} = 1\] or \[ \int_{a}^{b}1\space dx = b - a = 1-0 = 1\] ## B + C < 1/2
B <- runif(1000000)
C <- runif(1000000)
Z <- B+C
hist(Z, breaks=100)
Since we know that these variables are independent, their sum can be modelled as standard, symmetrical triangular distribution with peak = 1. Therefore \[ P(B+C<\frac{1}{2}) \]
\[ P(x) \begin{cases} \frac{2(x-a)}{(b-a)(b-c)} & \text{for } a < x < c \\ \frac{2(b-x)}{(b-a)(b-c)} & \text{for } c < x < b \end{cases} \]
where (if a = 0, b =2, and c = midpont(a,b)
\[ P(x) \begin{cases} \frac{2(x-0)}{(2-0)(2-1)} & \text{for } a < x < c \\ \frac{2(b-x)}{(2-0)(2-1)} & \text{for } c < x < b \end{cases} \]
or
\[ P(x) \begin{cases} \frac{2x}{2} & \text{for } a < x < c \\ \frac{4-2x}{2} & \text{for } c < x < b \end{cases} \] or \[ P(x) \begin{cases} x & \text{for } a < x < c \\ 2-x & \text{for } c < x < b \end{cases} \] and the cumulative distribution function for the piece [c,b] \[ D(x) = \frac{(x-a)^2}{(b-a)(c-a)} = \frac{\frac{1}{2}^2-0^2}{(2-0)(2-1)} = \frac{1}{8} \] where x is B + C. ## BC < 1/2
The cumulative distribution function is
\[ F(x)= \begin{cases} 0 & \text{for }x < a \\[8pt] \frac{x-a}{b-a} & \text{for }a \le x \le b \\[8pt] 1 & \text{for }x > b \end{cases} \] Therefore, the \[ P(x<\frac{1}{2}) = \int_{0}^{1} \frac{x-a}{b-a} dx = \int_{0}^{1} \frac{1/2-0}{1-0}dx = \int_{0}^{1}\frac{1}{2} dx = 1/2 \] Since this is true for both B and C, we can multiply this final number to obtain \[ \frac{1}{2} \cdot \frac{1}{2} = \frac {1}{4} \]
If \(Z= B-C\) then \(W = Z + 1\) has the form $W = X + (1-Y) = X + Y’ where X and Y’ = 1-Y are independent, random variables on [0,1], which has a well known triangular density such that \[ F_y(Y) = P(Y\le y) = P(B-C < y) = \begin{cases} \int_0^{1+y}\int_{x_1-y}^11dx_2dx_1 & -1 <y < 0 \\ 1 - \int_y^1\int_0^{x_1-y}1dx_2dx_1 & 0<y<1 \end{cases} \] or
\[ F_y(Y) \begin{cases} \frac{y^2}{2}+y+\frac{1}{2} & -1 <y < 0 \\ -\frac{y^2}{2}+y+\frac{1}{2} & 0<y<1 \end{cases} \] or
$$ -(1/2)^2+1/2+1/2 = 1-
\[ or \] F_y(1/2) = $$ ## max{B,C} <1/2
The cumulative distribution function for one variable is
\[ F(x)= \begin{cases} 0 & \text{for }x < a \\[8pt] \frac{x-a}{b-a} & \text{for }a \le x \le b \\[8pt] 1 & \text{for }x > b \end{cases} \] Therefore, the \[ P(x<\frac{1}{2}) = \int_{0}^{1} \frac{x-a}{b-a} dx = \int_{0}^{1} \frac{1/2-0}{1-0}dx = \int_{0}^{1}\frac{1}{2} dx =\frac{1}{2}\] Since this is true for both B and C, we can multiply this final number to obtain \[ \frac{1}{2} \cdot \frac{1}{2} = \frac {1}{4} \]
This is logically equivalent to
\[
P(B < \frac{1}{2} \cup C < \frac{1}{2})
\] or \[
P(B < \frac{1}{2}) + P(C < \frac{1}{2}) - P(B\cap C) = \frac{1}{2} + \frac{1}{2} - \frac{1}{4} = \frac{3}{4}
\]