TITLE: What's the probability of choosing two numbers from $[0,1]$ and having the difference at least one half?
QUESTION [25 upvotes]: 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.

REPLY [12 votes]: 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.$$