HW

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

B <- runif(10000, min=0, max=1)
C <- runif(10000, min=0, max=1)
  1. B + C < 1/2
sum ((B+C) < 0.5) / length(B)
## [1] 0.1245
  1. BC < 1/2
sum ((B*C) < 0.5) / length(C)
## [1] 0.8405
  1. |B − C| < 1/2
sum (abs(B-C) < 0.5) / 10000
## [1] 0.7552
  1. max{B,C} < 1/2
bc_max <- pmax (B,C)
prob_max <- sum(bc_max < 0.5) / 10000
prob_max
## [1] 0.2494