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
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.
g <- sum((B*C) < .5)/100000
g
## [1] 0.84526
This is very close to our estimated probability.
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.
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.
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.