Choose independently two numbers B and C at random from the interval [0, 1] with uniform density. Prove that B and C are proper probability distributions. Note that the point (B,C) is then chosen at random in the unit square. Find the probability that

# Function to pick a random number from the interval [0,1] 100 times.
# runif(n) generates n uniform random numbers between 0 and 1.
B <- runif(100, min=0, max=1)
C <- runif(100, min=0, max=1)

a) B + C < 1/2

x <- B + C

sum((x)<0.5)/100
## [1] 0.14

b) BC < 1/2

x <- B * C

sum((x)<0.5)/100
## [1] 0.8

c) |B − C| < 1/2

x <- abs(B - C)

sum((x)<0.5)/100
## [1] 0.76

d) max{B,C} < 1/2

x<- pmax(B, C)

sum((x)<0.5)/100
## [1] 0.22

e) min{B,C} < 1/2

x<- pmin(B, C)

sum((x)<0.5)/100
## [1] 0.69