# Twist on classic interview question. $P(X > 3Y)$ where $X,Y$ are uniform random variables

So there's this very classic probability question that says:

Given$$X, Y$$ two INDEPENDENT uniform random variables in $$[-1,1]$$, what is $$P(X > 3Y)$$?

Of course, there are alterations where the ranges of X & Y are different, or Y is multiplied by something different. The answer is always the same.

Visually: It's just the area under the line (X - 3Y = 0) for a rectangle that goes from [-3,3] in the Y-axis and [-1,1] in the x-axis.

Mathematically: It's just the integral over that same range:

$$\int_{-1}^{1} (\int_{-3}^{x} 1\ g(y)\ dy) f(x) dx$$

See here for a similar problem's solution

But what if the two RV's are dependent? I can't picture it graphically or understand it intuitively. What information would we need to be able to modify this formula?

Can someone give me an example where they are dependent, (you can make up how dependent they are), and then explain how we would figure out this probability?

• You would need to know in what way they are dependent, e.g. by specifying their joint density. – Minus One-Twelfth Sep 11 at 21:23
• That would basically be P(X=x, Y=y) across their supports, right? – QuantumHoneybees Sep 11 at 21:26
• For the cited classic problem, (1) the integral as written is incorrect for two reasons, though the basic idea is correct, and (2) you don't even need calculus to compute the probability: The bijective negation map $(X, Y) \mapsto (-X, -Y)$ maps $[-1, 1] \times [-1, 1]$ preserves the uniform probability measure and maps the set $\{X > 3 Y\}$ onto its complement less the set $\{X = 3 Y\}$ of measure zero, so $P(X > 3 Y) = \frac{1}{2}$. – Travis Willse Sep 11 at 22:19

While "independent" specifies a precise distribution of the pair $$(X,Y)$$, the word "dependent" does not - that is, merely knowing that $$X$$ and $$Y$$ are both individually uniform is not actually that helpful.

You can still get the answer of $$1/2$$ in a fairly wide range of cases - if $$(X,Y)$$ and $$(-X,-Y)$$ follow the same distribution (i.e. there's a negation symmetry) and the probability that $$X=3Y$$ is $$0$$, then it follows that $$X<3Y$$ and $$X>3Y$$ are equally likely, so happen with probability $$1/2$$. However, in general, this cannot be said.

You can be sure of some things: if $$Y\geq 1/3$$, then $$3Y\geq X$$ because $$X\leq 1$$. Similarly, if $$Y<-1/3$$, then $$3Y. Thus, the probability that $$X>3Y$$ is at least $$1/3$$ and no more than $$2/3$$ in any case. Any probability between those is fair game, however. For instance, you could set up a distribution as follows:

Choose $$Y$$ uniformly at random from $$[-1,1]$$. If $$|Y|<1/3$$, then set $$X=3Y$$. Otherwise, choose $$X$$ uniformly at random from $$[-1,1]$$.

You can verify that $$X$$ is uniformly distributed on $$[-1,1]$$ but $$P(X>3Y)=1/3$$. At the other extreme, you can do the following:

Choose $$Y$$ uniformly at random from $$[-1,1]$$. If $$|Y|<1/3$$, then set $$X=Y+2/3$$. Otherwise, choose $$X$$ uniformly at random from $$[-1,1/3]$$.

It's a little harder to see that $$X$$ is still uniform - basically, you split into cases - given that $$|Y|$$ was less than $$1/3$$, then $$X$$ is uniform random on $$[1/3,1]$$ and otherwise it is uniform on $$[-1,1/3]$$. The probabilities of these cases work out to give a uniform distribution across the whole interval. Once you verify that, you find that $$P(X>3Y)=2/3$$ under this distribution - and modifying the translation of $$X$$ from $$Y$$ between $$+2/3$$ and $$-2/3$$ actually gives every feasible probability.

Basically, there are a lot of ways to make distributions that are not independent, so only the "obvious" constraints remain when you say merely "not independent"