25
$\begingroup$

We have the unit interval $[0,1]$ and we want to find the probability of picking two random numbers $a,b$ from that interval with $|a-b|>0.5$.

Must I investigate $[0,1]×[0,1]$?

I don't have the faintest idea of how to solve this. The problem is that $[0,1]$ has infinite numbers to pick from… so how to calculate a probability with infinitely many items in the sample space?

I would be really happy if somebody shed a light on this.

$\endgroup$
8
  • 2
    $\begingroup$ I think you're using the word "possibility" where you want to use "probability". $\endgroup$ Commented Feb 19, 2018 at 14:55
  • 3
    $\begingroup$ $a,b$ follows what distribution? They are iid uniformly distributed on $[0,1]$? $\endgroup$ Commented Feb 19, 2018 at 14:55
  • 1
    $\begingroup$ $|a-b|>0.5 \implies a > b+0.5$ or $a<b-0.5$. $\endgroup$
    – Math Lover
    Commented Feb 19, 2018 at 14:55
  • 12
    $\begingroup$ Occam's razor is not infallible, but it suggests that if someone talks about choosing numbers "randomly" from an interval, without specifying a distribution, then they are probably thinking of the uniform distribution. Before I knew about different distributions, that's what I would have meant. $\endgroup$ Commented Feb 19, 2018 at 15:05
  • 1
    $\begingroup$ @KwnstantinosNikoloutsos it might help you to check the "Line Line Picking problem": I could be wrong but it seems to handle exactly that type of problem regarding the probability of the distance... mathworld.wolfram.com/LineLinePicking.html $\endgroup$
    – iadvd
    Commented Feb 20, 2018 at 5:01

3 Answers 3

77
$\begingroup$

Quick, draw a diagram!

Since the two random variables are independent and uniformly distributed, the answer is clearly $\frac14$.

$\endgroup$
5
  • 1
    $\begingroup$ Thanks for providing the illustration that was missing from my answer! :) $\endgroup$ Commented Feb 19, 2018 at 14:55
  • 1
    $\begingroup$ It's worth noting that it's not stated that $a,b$ are uniformly distributed, but as long as they are independent, your approach will work with a slight modification in the integral. $\endgroup$ Commented Feb 19, 2018 at 14:57
  • $\begingroup$ So if I have a problem with 3 random variables, then should I use a 3-dimensional cube? $\endgroup$ Commented Feb 19, 2018 at 15:22
  • 2
    $\begingroup$ @KwnstantinosNikoloutsos Yes (as long as the variables are iid uniform). And so on for higher dimensions, though you'd be resorting to integration by then. $\endgroup$ Commented Feb 19, 2018 at 15:23
  • $\begingroup$ @Parcly Taxel I love your "proof by picture". I always encourage picture drawing. What comes next is having the student draw the picture on the board and discussing why some points in [0, 1] x [0, 1] work and others don't. Vary the problem by making the "required distance" a parameter. Then discuss different "limiting behavior". Pictures like these open doors for a wide variety of topics from basic counting to calculus and the probability you'll land in between! $\endgroup$
    – David Dyer
    Commented Feb 26, 2018 at 19:31
16
$\begingroup$

The geometric approach works well here. If you choose two points uniformly from the interval $[0,1]$, that's the same as choosing a point uniformly from the square with vertices $(0,0), (0,1), (1,0)$ and $(1,1)$. Now, you can graph the lines corresponding to the conditions $y=x+\frac12$ and $y=x-\frac12$. Between those lines are points where the difference between $x$ and $y$ is less than $\frac12$, and outside of them, you find points where the difference is greater. Use geometry to calculate the area inside your square of interest, but not between those two lines. That's your answer, since the total area of the square is $1$.

$\endgroup$
2
  • 1
    $\begingroup$ I feel like this answer should be tacked onto the accepted one and you should both be considered as answerers. $\endgroup$ Commented Feb 19, 2018 at 17:43
  • 2
    $\begingroup$ It's funny: we answered nearly simultaneously. I understand the preference, though. Pictures are great when they can convey an idea so elegantly. The first time I saw such a demonstration, my mind was pleasantly blown. $\endgroup$ Commented Feb 19, 2018 at 17:44
13
$\begingroup$

Note: $$|a-b|>0.5 \Rightarrow a>b+0.5 \ \ \ \text{or} \ \ \ a<b-0.5.$$ Considering $0\le a,b\le 1$ we get: $$\begin{cases} b+0.5<a\le 1 \\ 0\le b<0.5 \end{cases} \ \ \ \text{or} \ \ \ \begin{cases} 0\le a <b-0.5 \\ 0.5<b\le 1\end{cases}.$$ We make up double integrals: $$P=\int_0^{0.5} \int_{b+0.5}^1 \mathrm{d}a \, \mathrm{d}b\color{red}{+}\int_{0.5}^1 \int_0^{b-0.5} \mathrm{d}a \, \mathrm{d}b=$$ $$\int_0^{0.5} (0.5-b)\, \mathrm{d}b \color{red}{+} \int_{0.5}^1 (b-0.5)\, \mathrm{d}b=$$ $$0.25-0.125 \color{red}{+} 0.5-0.125-0.5+0.25=0.25.$$

$\endgroup$
2
  • 1
    $\begingroup$ This generalises well to higher dimensions, but I think it's just simpler to draw a diagram when there are only $2$ variables, and the diagram is in 2D. $\endgroup$
    – Toby Mak
    Commented Feb 20, 2018 at 4:59
  • 1
    $\begingroup$ @TobyMak, agreed the graphical method is easier to imagine, yet the algebraic method is also important (especially, for publishing in journals and for making it more rigorous). $\endgroup$
    – farruhota
    Commented Feb 20, 2018 at 5:21

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