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.

Using the uniform ditribution function - runif to allocate random numbers

set.seed(123)
B <- runif(10000, min = 0, max = 1)
set.seed(234)
C <- runif(10000, min = 0, max = 1)

Find the probability that

  1. B + C < 1/2.
sum((B + C) < 0.5) / 10000
## [1] 0.1266
  1. BC < 1/2
sum((B*C) < 0.5) / 10000
## [1] 0.8466
  1. |B - C| < 1/2
sum(abs(B-C) < 0.5) / 10000
## [1] 0.7527
  1. max{B,C} < 1/2
sum(pmax(B,C) < 0.5) / 10000
## [1] 0.2535
  1. min{B,C} < 1/2
sum(pmin(B,C) < 0.5) / 10000
## [1] 0.7499