Let A and B the randomly selected points on [0,1]. Assume B>A for beginning.

Triangular inequalities will reveal:

A<1/2 and

B>1/2 and

B-A<1/2

I am skipping several steps here but due to conditional probability that should be equivalent to:

We also have the symmetric case where A>B. So,

the answer = 2 * 1/8 = 1/4

-O believes.