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(100000, 0, 1)
head(B)
## [1] 0.4883834 0.4305485 0.5112475 0.3686271 0.3205169 0.3644924
C <- runif(100000, 0, 1)
head(C)
## [1] 0.7082588 0.4136576 0.3981120 0.7675786 0.2066777 0.9986505

B and C are proper probability distributions because the values of B and C always fall between 0 and 1 and the sum of the probability of each event (choosing a number between 0 and 1) adds up to 1.

Find the probability that

  1. B + C < 1/2

We want to find the probability that C < 1/2 and B < (1/2 - C). P(C < 1/2)=.5, P(B < (1/2 - C))=(.5)(.5)=.25 So P(B + C < 1/2) = .5(.25)=.125. We can check this with our randomly generated B and C datasets.

h <- sum((B+C) < .5)/100000
h
## [1] 0.12548

This is very close to our estimated probability.

  1. BC < 1/2 We want to find the probability that either BC < 1/2, so we find the probability that BC > 1/2, and subtract that from 1. The max value B and C can be at the same time is 1/√2. So we find the probability that they are both greater than 1/√2, and subtract that from 1. P(C < 1√2)=.7071, P(B < 1√2)=.7071, so the probabilty that both B and C are both less than 1√2 is (1√2)(1√2)=.5. The probability that B > 1/√2 is P(B > 1/√2)=1-1/√2 and P(C > 1/√2)=1-1/√2, so P(BC > 1/2)=(1-1/√2)/2 = 1464466094. So P(BC < 1/2)= 1- P(BC > 1/2)= 0.85355339059. We can check this with our randomly generated B and C datasets.
g <- sum((B*C) < .5)/100000
g
## [1] 0.84526

This is very close to our estimated probability.

  1. |B − C| < 1/2 We want to find the probabilty that the distance between B and C is less than 1/2. There are three cases. P(B<1/2)P(C <1/2)= .5.5= .25 P(B>1/2)*P(C > 1/2)= (.5)(.5)= .25 P(B < 1/2 and C < 1/2-B) or P(C < 1/2 and B < 1/2-C)= (.5)(.5)=.25

P(|B − C| < 1/2)=.25+.25+.25, which we can check with our with our randomly generated B and C datasets.

i <- sum(abs(B-C) < .5)/100000
i
## [1] 0.75282

This is very close to our estimated probability.

  1. max{B,C} < 1/2 The probability that the max value of B or C is less than 1/2 is P(B < 1/2 | C < 1/2)=(.5)(.5)=.25
j <- 0
for(i in 1:100000){
  if(max(c(B[i],C[i])) < .5){
    j = j+1
  }
}

j/100000
## [1] 0.25054

This result is similar to what we expected.

  1. min{B,C} < 1/2

The probability that the min value of either B or C is 1-P(B > 1/2 & C > 1/2)=1-(.5)(.5)=.75

k <- 0
for(i in 1:100000){
  if(min(c(B[i],C[i])) < .5){
    k = k+1
  }
}

k/100000
## [1] 0.74805

This result is similar to what we expected.