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.
B <- runif(1000)
C <- runif(1000)
hist(B, probability = TRUE)
hist(C, probability = TRUE)
Both B and C are probability distributions and hence we can go further with the analysis.
Z <- B + C
probability <- length(Z[Z<= .5])/1000
probability
## [1] 0.142
Z <- B*C
probability <- length(Z[Z<= .5])/1000
probability
## [1] 0.849
Z <- abs(B-C)
probability <- length(Z[Z<= .5])/1000
probability
## [1] 0.741
maxx <- matrix(c(B,C),1000,2)
Z <- apply(maxx, 1, max)
probability <- length(Z[Z<= .5])/1000
probability
## [1] 0.27
minn <- matrix(c(B,C),1000,2)
Z <- apply(minn, 1, min)
probability <- length(Z[Z<= .5])/1000
probability
## [1] 0.759