Problem set

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.

# Populate B and C with 10,000 uniformly distributed values
B <- runif(n = 10000, min = 0, max = 1)
C <- runif(n = 10000, min = 0, max = 1)

Find the probability that:

(a) B + C < 1/2.

p <- sum((B+C) < (1/2)) / 10000
p <- paste0((p*100), "%")
p
## [1] "12.33%"

(b) BC < 1/2.

p <- sum((B*C) < (1/2)) / 10000
p <- paste0((p*100), "%")
p
## [1] "84.75%"

(c) |B-C| < 1/2.

p <- sum((abs(B-C)) < (1/2)) / 10000
p <- paste0((p*100), "%")
p
## [1] "75.25%"

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

cnt <- 0
for(i in 1:length(B)){
  if(max(B[i], C[i]) < (1/2)){
    cnt = cnt + 1
  }
}
p <- cnt / 10000
p <- paste0((p*100), "%")
p
## [1] "25.1%"

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

cnt <- 0
for(i in 1:length(B)){
  if(min(B[i], C[i]) < (1/2)){
    cnt = cnt + 1
  }
}
p <- cnt / 10000
p <- paste0((p*100), "%")
p
## [1] "74.84%"