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

  1. B + C < 1/2.
n = 10000

b <- runif(n,min = 0, max = 1)

c <- runif(n,min = 0, max = 1)

a <- sum((b + c)<0.5)/n

a
## [1] 0.124
  1. BC < 1/2.
sum((b*c)< 0.5)/n
## [1] 0.8464
  1. |B − C| < 1/2.
sum(abs(b-c)<0.5)/n
## [1] 0.7496
  1. max{B,C} < 1/2.
index <- 0

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

}
}

index/n
## [1] 0.2438
  1. min{B,C} < 1/2.
index <- 0

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

}
}

index/n
## [1] 0.7475