Random Ratio

Medium
Integration

Problem

and are two points chosen at random between 0 and 1. What is the probability that the ratio lies between 1 and 2?

Original Problem Link: Click here

Solution

We have 2 random variables (RVs) and here. Let's try to fix one for simplicity, and then use that result to develop a general solution where both are RVs.

Step 1: Fixing q

Say we fix at some value between 0 and 1. Now, the given problem reduces to:

"q is a fixed value between 0 and 1. p ~ Uniform(0,1). What is the probability that 1 < p/q < 2?"

This question is fairly straightforward.

Step 2: Rearranging the Inequality

Let's rearrange the inequality:

Also, note that since p is restricted in (0,1), we must say:

But since q is also restricted in (0,1), we have

Thus, the final expression is:

Step 3: Computing the Probability

Now, let's compute the probability that p will lie within this range.

As

the required probability:

(Note: The probability is simply the length of the required range divided by the length of the total range. This is also visible by intuition)

Step 4: Considering q as a Random Variable

Now, note that this is the case when q is fixed. But q itself will vary from 0 to 1.

We can write the above probability as "conditioned on" a particular q:

(Where E is our required event of

)

Step 5: Using the Law of Total Probability

Using fundamental laws, we have:

What is P(q)? Essentially the probability of choosing a particular value from 0 to 1, an infinite set! Clearly very small! Let's use calculus to denote this.

Thus,

Step 6: Solving the Integral

To solve this integral, we need to split it into two parts:

  1. From 0 to 1/2, where
  2. From 1/2 to 1, where

Now,

Therefore, the probability that the ratio lies between 1 and 2 is or or .


PS - A similar integration is involved in the problem Random-Angle-II. Check it out for a more detailed explaination incase of any confusions!.