[Math] Calculate the probability of a collision between these two functions

probabilityprobability theory

$f(x) =$ Choose a random number between $1$ and $100$ (inclusive)

$g(x) =$ Choose a random number between $1$ and $200$ (inclusive)

What is the probability that $f(x) = g(x)$?

Here is my working:

$$P(f_1(x) = f_2(x)) = \frac1{100}$$

$$P(g(x) = f(x)) = \frac{100}{200} \cdot \frac1{200} = \frac1{400}$$

Is my working correct?

Best Answer

I think this is a slightly more intuitive way of looking at the question:

Suppose $f (x)=k$. Once we have chosen $k$, there are $200$ possible values for $g (x)$, one of which is $k$, hence we get an answer of $\frac{1}{200}$.

Related Question