It’s possible to pick a random point in the Cantor set in the following way: Start with the entire number line from 0 to 1. Then, every time you remove a middle third, you give yourself a 50 percent chance of being on the left remaining third and a 50 percent chance of being on the right remaining third. Then, when you remove the middle third of that segment, you again give yourself a 50 percent chance of being on the left vs. the right, and so on.
Suppose I independently pick two random points in the Cantor set. On average, how far apart can I expect them to be?
Let's define $\Delta$ as the average distance between two different randomly chosen points in the Cantor set, say $a$ and $b \in \mathcal{C}.$ Based on the self-similarity of the Cantor set $\mathcal{C},$ we see that $\mathcal{C} = \frac{1}{3} \mathcal{C} \cup \left( \frac{2}{3} + \frac{1}{3} \mathcal{C} \right).$ Then from the law of total expectation and the fact that the probability of being in either the left or right half of the Cantor set is independently $\frac{1}{2}$ for each of $a$ and $b$, we get \begin{align*} \Delta &= \mathbb{E} \left[ |a-b| \mid a, b \in \frac{1}{3} \mathcal{C} \right] \mathbb{P} \left\{ a, b \in \frac{1}{3} \mathcal{C} \right\} \\ &\quad + \mathbb{E} \left[ |a-b| \mid a, b \in \frac{2}{3} + \frac{1}{3} \mathcal{C} \right] \mathbb{P} \left\{ a, b \in \frac{2}{3} + \frac{1}{3} \mathcal{C} \right\} \\ & \quad\quad + \mathbb{E} \left[ |a-b| \mid a \in \frac{1}{3} \mathcal{C}, b \in \frac{2}{3} + \frac{1}{3} \mathcal{C} \right] \mathbb{P} \left\{ a \in \frac{1}{3} \mathcal{C}, b \in \frac{2}{3} + \frac{1}{3} \mathcal{C} \right\} \\ &\quad\quad\quad + \mathbb{E} \left[ |a-b| \mid a \in \frac{2}{3} + \frac{1}{3} \mathcal{C}, b \in \frac{1}{3} \mathcal{C} \right] \mathbb{P} \left\{ a \in \frac{2}{3} + \frac{1}{3} \mathcal{C}, b \in \frac{1}{3} \mathcal{C} \right\} \\ &= \frac{ \Delta_1 + \Delta_2 + \Delta_3 + \Delta_4}{4}.\end{align*}
Since they are simply scaled copies of the original problem, we see that $\Delta_1 = \Delta_2 = \frac{1}{3} \Delta.$ However, let's take a look at $\Delta_3$ and $\Delta_4.$ For any $a \in \frac{2}{3} + \frac{1}{3} \mathcal{C},$ there is some $a^\prime \in \mathcal{C}$ such that $a = \frac{2}{3} + \frac{1}{3} a^\prime.$ So if $b \in \frac{1}{3} \mathcal{C}$ then there is some $b^\prime \in \mathcal{C}$ with $b=\frac{1}{3} b^\prime$. Therefore, we then have $|a-b| = \frac{2}{3} + \frac{1}{3}(a^\prime - b^\prime) \geq \frac{1}{3} \geq 0.$ So taking the expectation over all values of $a^\prime, b^\prime \in \mathcal{C}$ we get $$\Delta_3 = \Delta_4 = \mathbb{E} \left[ |a-b| \mid a \in \frac{2}{3} + \frac{1}{3} \mathcal{C}, b \in \frac{1}{3} \mathcal{C} \right] = \frac{2}{3} + \frac{1}{3} \mathbb{E} \left[ a^\prime - b^\prime \right] = \frac{2}{3}.$$
Thus putting everything together we get $$\Delta = \frac{1}{4} \sum_{i=1}^4 \Delta_i = \frac{ \frac{2}{3} \Delta + \frac{4}{3} }{4} = \frac{1}{6} \Delta + \frac{1}{3},$$ which means that $\frac{5}{6} \Delta = \frac{1}{3}$ or finally that the average distance between two randomly chosen points in the Cantor set is $$\Delta = \frac{6}{5}\cdot \frac{1}{3} = \frac{2}{5}.$$

