Problem1 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:
(a) B + C < 1/2 If we think about this function using X & Y and rearrange the equation we see: X + Y < 1/2 Y < 1/2 - X
This creates a triangle with the Y-intercept of 1/2 and X-intercept of 1/2. The three vertices of the triangle are (0,0), (1/2,0), and (0,1/2). To get the probability we can simply calculate the area under this line:
base = 1/2
height = 1/2
area = 1/2*base*height
area
## [1] 0.125
(b) BC < 1/2
XY < 1/2
Y < 0.5/X
By graphing Y = 1 / 2x, we see that the x-value approaches 0 but doesn’t cross it. It’s going to be easier to think about the probability of XY > 1/2. To get XY < 1.2, we can also calculate 1 - P(XY > 1/2).
x <- seq(0,1,0.0005)
plot(x,1/(2*x),xlim=c(0,1),ylim=c(0,1))
To calculate this we can solve the following integral:
\[\int_{0.5}^{1}\int_{1/2x}^{1} 1~dy~dx\] \[\int_{0.5}^{1}(1-1/2x)~dx\] \[x - 1/2 ln x ---- (evaluate from 1 minus 0.5)\] \[(1 - 0.5ln1) - (0.5 + 0.5ln0.5 )\] \[(1 - 0) - (0.5 + 0.5ln0.5 )\] \[0.5 -0.3465\] \[ P(XY > 1/2) = 0.153\] \[P(XY < 1/2) = 1 - P(XY > 1/2)\]
\[P(XY < 1/2) = 1 - 0.153\] \[P(XY < 1/2) = 0.8465\]
(c) |B − C| < 1/2.
-1/2 < B - C and B - C < 1/2
We can think of this as two equations: -1/2 < Y - X and Y - X < 1/2 -1/2 + X < Y and Y < 1/2 + X X - 1/2 < Y and Y < X + 1/2 or
Y > X - 1/2 and Y < X + 1/2
x <- seq(0,1,0.0005)
y <- seq(0,1,0.0005)
plot(y,x - 1/2,xlim=c(0,1),ylim=c(0,1))
plot(y,x + 1/2,xlim=c(0,1),ylim=c(0,1))
\[\int_{0}^{1/2}\int_{0}^{x + 1/2}1~dy dx + \int_{1/2}^{1}\int_{x - 1/2}^{1}1~dx dy\] \[\int_{0}^{1/2}(x + 1/2) ~dx + \int_{1/2}^{1}(1 -x + 1/2) dx\] \[\int_{0}^{1/2}(x + 1/2) ~dx + \int_{1/2}^{1}(3/2 - x) dx\] \[(1/8 + 1/4) + ((3/2 - 1/2) - (3/4 - 1/8))\] \[(3/8 + (1 - 5/8))\] \[6/8\] \[3/4\]
(d) max{B,C} < 1/2. We can think about this like B < 1/2 intersection C < 1/2 It’s easiest to picture this as area within the [0,1] rectangle.
area = 1/2*1/2
total_area = 1*1
max_prob = area /total_area
max_prob
## [1] 0.25
(e) min{B,C} < 1/2. This is the exact opposite of **(d)
area = 1/2*1/2
print(1 - area)
## [1] 0.75