Probability That a Uniform Quotient Lies in an Interval
Let $a$ and $b$ be independent uniform random variables on $[0, 1]$. What is the probability that $a/b$ falls in the interval $[1, 3]$?
Hints
- Rewrite the condition on the ratio $a/b$ as a pair of inequalities on $b$ in terms of $a$.
- Condition on $a$ and compute the length of the interval of valid $b$ values. Since $b$ is uniform on $[0,1]$, this length gives you the conditional probability.
- The conditional probability is $\frac{2a}{3}$. Use the law of total probability by integrating over $a \in [0,1]$.
Worked Solution
How to Think About It: You have two independent draws from $[0,1]$ and you want the ratio $a/b$ to land between 1 and 3. The condition $1 \le a/b \le 3$ is equivalent to $b \le a \le 3b$ (assuming $b > 0$, which happens with probability 1). So this is a geometric probability problem -- you are computing the area of a region inside the unit square. Quick gut check: the region is a wedge-shaped slice, so the answer should be a clean fraction, probably somewhere around $1/4$ to $1/3$.
Quick Estimate: The condition $a/b \in [1,3]$ means $a \ge b$ (so we are in the upper triangle of the unit square) and $a \le 3b$ (which cuts off a small corner near $b = 0$). The upper triangle has area $1/2$. The constraint $a \le 3b$ removes the sliver where $b < a/3$, which is a small triangle. So the answer is somewhat less than $1/2$. A rough guess: about $1/3$.
Approach: Condition on $a$ and integrate over the feasible range of $b$.
Formal Solution:
The condition $1 \le a/b \le 3$ is equivalent to $a/3 \le b \le a$. Since $b \in [0,1]$ and $a \in [0,1]$, we need $a/3 \le b \le a$, and both bounds are automatically in $[0,1]$ when $a \in [0,1]$.
Condition on $a$:
$$P\left(\frac{a}{3} \le b \le a \;\middle|\; a\right) = a - \frac{a}{3} = \frac{2a}{3}$$
Now integrate over $a$:
$$P\left(1 \le \frac{a}{b} \le 3\right) = \int_0^1 \frac{2a}{3} \, da = \frac{2}{3} \cdot \frac{1}{2} = \frac{1}{3}$$
Verification (Monte Carlo):
```python import random
count = 0 N = 1_000_000 for _ in range(N): a = random.uniform(0, 1) b = random.uniform(0, 1) if 1 <= a / b <= 3: count += 1 print(count / N) # should be close to 0.333 ```
Answer: $P(1 \le a/b \le 3) = \dfrac{1}{3}$.
Intuition
This is a classic geometric probability problem where you translate a condition on a ratio into a region in the unit square. The key move is to flip the ratio constraint into linear inequalities: $1 \le a/b \le 3$ becomes $a/3 \le b \le a$. Once you see this, it is just computing the area of that wedge inside the unit square. This technique -- conditioning on one variable and integrating out the other -- is the bread and butter of joint-distribution problems in quant interviews. The answer $1/3$ is clean because the feasible region happens to be a nice triangular wedge.
In practice, this type of reasoning appears whenever you need to price a contract whose payoff depends on the ratio of two random quantities (e.g., relative performance of two assets). The conditioning trick generalizes easily: any time you have a joint density and want the probability of an event defined by a function of the variables, condition on one variable and integrate.