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

B and C are independent random variables from the unit interval [0, 1] with the uniform density. Let x and y represent the independent random variables B and C respectively from the unit interval [0,1] with the uniform density.

(a) B + C < 1/2.

Let’s represent y in terms of x

\(x\)+\(y\) < 0.5

\(y = 0.5-x\) in the interval [0,1]

If we plot this line in the unit square, then the area under the line will be all values of \(B\) and \(C\) such that \(B+C<0.5\) and the area will equal the probability \(P(B+C<0.5)\)

library(ggplot2)
func1<-function(x) 0.5-x
p <- ggplot(data = data.frame(x = 0), mapping = aes(x = x))
p + stat_function(fun = func1) + xlim(0,1) + ylim(0,1)
## Warning: Removed 50 rows containing missing values (geom_path).

Now we need to find area under the line

= \(P(x+y<0.5)\)

= \(P\big(0<x<0.5,0<y<0.5-x)\)

= \(\int_{0}^{0.5}{(\frac{1}{2}-x)dx}\)

Calculating integral using R

integrate(func1,0,0.5)
## 0.125 with absolute error < 1.4e-15
b) \(BC < 1/2\)

\(x\)\(y\) < 0.5

\(y = 0.5 * x\)

set.seed(100)
library(ggplot2)
func2<-function(x) 0.5/x
p <- ggplot(data = data.frame(x = 0), mapping = aes(x = x)) + 
 stat_function(fun = func2) + xlim(0,1) + ylim(0,1)
L1 <- geom_segment(aes(x=0,xend=0,y=0,yend=1))
L2 <- geom_segment(aes(x=0,xend=0.5,y=1,yend=1))
L3 <- geom_segment(aes(x=0,xend=1,y=0,yend=0))
L4 <- geom_segment(aes(x=1,xend=1,y=0,yend=0.5))
p + L1 + L2 + L3 + L4

Now we need to find area under the curve + area of rectangle with dimensions x = 0.5 and y = 1

So total area = 1 * 0.5 + area under curve

Area under curve is

= \(P(xy<0.5)\)

= \(\int_{0}^{0.5}{(\frac{1}{2x})dx}\)

Calculating integral using R

integrate(func2,0.5,1)
## 0.3465736 with absolute error < 3.8e-15

So total area = 0.5 + 0.34 = 0.84

\(P(BC<0.5) = 0.84\)

(c): \(|B-C| < 1/2\)

Here need to find for 2 line

x - y < 0.5

x - y < - 0.5

set.seed(100)
library(ggplot2)

myplot <- ggplot(data.frame(x=c(0,1),y=c(0,1)), aes(x=x)) +
stat_function(fun= function(x)x+0.5, geom="polygon", colour= "black",fill = "black") +
stat_function(fun= function(x)x-0.5, geom="polygon", colour= "black") + ylim(0,1) + xlim(0,1)

 L1 <- geom_segment(aes(x=0,xend=0,y=0,yend=0.5))
 L2 <-  geom_segment(aes(x=0,xend=0.5,y=0,yend=0))
 L3 <-  geom_segment(aes(x=0.5,xend=1,y=1,yend=1))
 L4 <-   geom_segment(aes(x=1,xend=1,y=0.5,yend=1))
myplot + L1 + L2 + L3 + L4

So here As B-C < 1/2 we need to find the area of the region polygon

Since total probablity is 1

And in part (A) we calaculated area of shaded triangle

Here we see 2 triangles so we need to subtract 1 - 2(Area of triangle(part a))

= 1 - 2(0.125)

= 0.75

\(P(|B ??? C|<0.5)=0.75\)

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

=\(P(max(B,C)<1/2)\)

=\(P(B<=1/2,C<=1/2)\)

=\(P(B<=1/2)P(C<=1/2)\)

=1/2 * 1/2

=\(1/4\)

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

We can calculate using below

=P(min(B,C)<1/2)

=1 - P(min(B,C)>1/2)

=1 - P(B>1/2,C>1/2)

=1 - [1 - P(B>1/2)][1 - P(C>1/2)]

=1 - [1 - 1/2][1 - 1/2]

=1 - [1/2][1/2]

=3/4 = 0.75

Hence \(P(min{B,C}<0.5)=0.75\)