Solve the following random variable comparison: what is the probability that X > 4Y if :
1. X, Y independent, standard normally distributed?
2. X, Y independent, uniformly distributed on [0,1]?
Question 1
So, this first part of the question is about two iid standard normal distributions.
Solution 1
We know that if has a normal distribution, has as well, with and
The above implies that .
Now, we have both parts of the comparison we want to make.
We can rewrite as . We also remember the rules pertaining to summing two independent normally distributed random variables and apply them to and .
So, we now know that is a normal distribution, with a mean of 0. Due to the symmetry around the mean of a normal distribution, we conclude that .
Solution 2
With the pair of random variables and (and Y, for that matter) centered around 0, we can split both at the 0 boundaries, marking four quadrants. We employ this partition to extend the probability of as a sum of conditional probabilities.
Given what we said before that X and Y are independent and symmetrical around 0, the probabilities used to weigh the sum are all equal to .
We can also easily see that:
- X is always greater than 4Y when X is positive, Y is negative
- X is never greater than 4Y when X is negative, Y is positive
Replacing all the values derived before, we get a new formula for the probability we are seeking.
The two probabilities involved on the right-hand side of the equation look very similar, conditioned on opposite quadrants. We can denote and as the opposites of and and know that they both have the same distribution and are independent, exactly like their counterparts.
We rewrite the second probability, replacing everywhere X with -X, and Y with -Y, and use the property deduced before to get that the initial value is equal to the probability that X is less than 4Y, conditioned on X and Y greater than 0. Given that they are continuous random variables, we can change the conditioning to X and Y at least 0.
We replace this equivalency in the initial result and use the fact that the two probabilities on the right-hand side are complementary to arrive at the same result as the first solution, 1/2.
Question 2
With two options for the first question under our belt, we can turn our attention to the one involving two independent uniform random variables.
You might jump the gun and say that you get the same result in this case, but it is a false equivalency. The sum of two uniform random variables is not uniform itself. It has an Irwin-Hall distribution. If you knew the probability density function of this, you could use it to find the correct answer to the question. I’d say that the majority doesn’t know this at the top of their heads, so we have to find another solution.
Solution 1
Wanting to visualize the pair of the two random variables uniformly distributed, we get the unit square.
We can draw the line of X=4Y, with the area of the triangle below it representing the space where X is more than 4Y.
Given the distributions and the independence of X and Y, the probability the pair (X, Y) is in this triangle is equal to the area of the triangle scaled by that of the square, which is 1/8.
Solution 2
We can also use convolutions for an analytical solution to this part of the question.
Since X and Y are uniform, .
CodingCheck
If the four solutions before were not convincing enough, you can simulate the results and get the same values as those obtained mathematically.
import numpy as np
s = 10**6
## Generate samples for A
x_a = np.random.normal(loc=0, scale=1, size=s)
y_a = 4*np.random.normal(loc=0, scale=1, size=s)
## Generate samples for B
x_b = np.random.uniform(low=0, high=1, size=s)
y_b = 4*np.random.uniform(low=0, high=1, size=s)
## Compute observed probabilities
p_a = '{:.2%}'.format(np.mean(x_a>y_a))
p_b = '{:.2%}'.format(np.mean(x_b>y_b))
## Print results
print(f'Probability (A): {p_a}')
print(f'Probability (B): {p_b}')