2
$\begingroup$

I have two random number generators, 1 giving me a number between 1 and 5000 (call it x) and the other giving me a number between 1000 and 1500 (call it y). Both including the min and max numbers.

I'm trying to work out the chances of x=y

I'm not sure if it's just (1/5000 * 1/501) - (1/5000 + 1/501) or if there's more to it, any help would be much appreciated.

$\endgroup$
4
  • 2
    $\begingroup$ Always think about your answer and and ask yourself "does this make sense?" (1/5000 * 1/501) - (1/5000 + 1/501) is a negative number and hence cannot be the correct probability. $\endgroup$ Dec 24, 2014 at 19:41
  • $\begingroup$ I didn't even try work it out , I just wrote down theory of something we were being taught in school /: P(AnB) = P(A)*P(B) - P(AuB) thanks for the help though $\endgroup$
    – Colum
    Dec 24, 2014 at 19:46
  • $\begingroup$ Be careful with that formula. You need to specify what the events A and B are precisely before going to that formula. I don't think this formula is the way to go though. $\endgroup$ Dec 24, 2014 at 19:52
  • $\begingroup$ Ok, thanks for the help :) $\endgroup$
    – Colum
    Dec 24, 2014 at 19:56

3 Answers 3

2
$\begingroup$

Let the probability that $X=Y=y$ for a fixed $y$ between $1000$ and $1500$ be $p=\frac{1}{(5000)(501)}$. Then the probability of them being equal is $501p=\frac{1}{5000}$, since the event $X=Y$ is the union of the events $X=Y=y$ for $y$ between $1000$ and $1500$, and each of these smaller events happens with probability $p$.

$\endgroup$
3
  • $\begingroup$ So 1/5000 ? Or do I need to divide it by the 501? $\endgroup$
    – Colum
    Dec 24, 2014 at 19:48
  • $\begingroup$ $p$ is the probability of them each being equal to a specific value. The probability of them being equal (which is what you asked for) is $\boxed{1/5000.}$ $\endgroup$ Dec 24, 2014 at 19:49
  • $\begingroup$ Ah thanks for clearing that up! My heads been frazzled trying work it out $\endgroup$
    – Colum
    Dec 24, 2014 at 19:55
2
$\begingroup$

You have $(5000-1)+1=5000$ options for $x$.

You have $(1500-1000)+1=501$ options for $y$.

Hence you have $5000\cdot501$ combinations of $x$ and $y$.

Out of those combinations, you have $501$ options with $x=y$.

Hence the probability of $x$ being equal to $y$ is $\frac{501}{5000\cdot501}=\frac{1}{5000}$.

$\endgroup$
1
  • $\begingroup$ @Colum: You're welcome :) $\endgroup$ Dec 24, 2014 at 20:04
2
$\begingroup$

Another way to think about it. Suppose the number from the generator that gives a number between 1000 to 1500 is fixed. Since all those numbers are contained in 1 - 5000, you have a 1/5000 chance of drawing that number in the second generator. This does not change depending on the number you draw in the first generator, hence P(x=y) = 1/5000.

$\endgroup$
1
  • $\begingroup$ Ah right that helps clear my head a bit, thanks for the help :) $\endgroup$
    – Colum
    Dec 24, 2014 at 19:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .