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.

1 B+C<1/2

n = 10000

B = runif(n, min = 0, max = 1)
C = runif(n, min = 0, max = 1)

sum((B+C) <0.5)/n
## [1] 0.124
hist((B+C), main = "Histogram of B + C")

2 BC<1/2

hist((B*C), main = "Histogram of B * C")

sum((B*C)<0.5)/n
## [1] 0.846

3 |B-C|<0.5

hist(abs(B-C), main = "Histogram of |B ??? C|")

sum(abs(B-C)<0.5)/n
## [1] 0.7536

4 max(B,C)<0.5

hist(pmax(B,C), main = "Histogram of max{B,C}")

index <- 0

for (x in 1:n){
  if(max(c(B[x],C[x])) < 0.5 ){
    index = index + 1
  }
}

index/n
## [1] 0.2481

5 min(B,C)<0.5

hist(pmin(B,C), main = "Histogram of min{B,C}")

index <- 0

for (x in 1:n){
  if(min(c(B[x],C[x])) < 0.5 ){
    index = index + 1
  }
}

index/n
## [1] 0.7507