On a drying rack, $n$ socks are hanging in a random order (as taken out of the washing machine). Among them are two favorite socks of the Absent-Minded Scholar. The socks are hidden by a drying sheet, so the Scholar cannot see them and takes one sock at a time by feel. Find the expected number of socks removed by the Scholar by the time he has both of his favorite socks.
It is convenient to form a triangular table. The shaded cells correspond to pairs of favorite socks. For example, the pair (2, 4), marked with an "X," corresponds to the case where the first favorite sock was the second one, and the second favorite sock was the fourth one in sequence. All pairs are equally likely, and their total number is $C_{n}^{2}$.

![](https://cdn.mathpix.com/cropped/2024_05_08_293b4772a418c01a5915g-05.jpg?height=503&width=514&top_left_y=1526&top_left_x=772)

The table shows the distribution of the random variable $\xi$ "Number of socks removed." Essentially, the table represents an inverted diagram of this distribution: the values of $\xi$ are taken from the first row, and the corresponding probabilities are depicted below them as shaded columns. Thus, $\mathrm{P}(\xi=k)=\frac{k-1}{C_{n}^{2}}(k=1, \ldots, n)$. Therefore, $\frac{1}{C_{n}^{2}} \sum_{k=2}^{n} k(k-1)=\frac{1}{C_{n}^{2}}\left(\sum_{k=1}^{n} k^{2}-\sum_{k=1}^{n} k\right)=\frac{1}{C_{n}^{2}}\left(\frac{n(n+1)(n+2)}{6}-\frac{n(n+1)}{2}\right)=$ $\frac{1}{C_{n}^{2}} \cdot \frac{n(n+1)(2 n-2)}{6}=\frac{2(n+1)}{3}$

## Answer

$2 / 3(n+1)$.