I have five distinct pairs of socks in my drawer, none of which is actually paired up. The room is pitch black, so I can’t see the color of any sock I’m pulling out. I reach into my drawer and randomly pull out one of the 10 socks. Then I reach in again and pull out one of the remaining nine. I can keep pulling out one sock at a time, at random, until I decide to stop at some point.
My goal is to stop removing socks as soon as I have a matching pair among those I have drawn. How many socks should I draw to maximize the chances that the last sock I draw results in the first such pair?
There are $10$ pullings. The first pair of socks can occur on pulls $2$ to $6$. After $6$, a pair is guaranteed to already exist because $5$ is the largest value with no pairs.
You should draw $\boxed{\text{four}}$ socks to maximize the probabilty, which is
$$ \dfrac{1,036,800}{10!} = \boxed{\dfrac{2}{9}}$$Instead of five pairs of socks, I now have N pairs of socks, where N is a very large number. In terms of N, how many socks should I draw to maximize the chances that the last sock I draw results in the first pair?
There are $2N$ pullings. The first pair of socks can occur on pulls $2$ to $N+1$. After $N+1$, a pair is guaranteed to already exist because $N$ is the largest value with no pairs.
The $k^\text{th}$ draw is the maximum if the $(k+1)^\text{st}$ draw has fewer possibilities than the $k^\text{th}$ draw, as this follows a Poisson distribution.
Dividing the $(k+1)^\text{st}$ draw count by the $k^\text{th}$ draw count,
\begin{align*} 2\cdot\dfrac{k}{k-1}\cdot\dfrac{N-k+1}{2N-k} &< 1 \\ \\ 2k(N-k+1) &< (k-1)(2N-k) \\ \\ -2k^2+2kN+2k &< -k^2+2kN+k-2N \\ \\ 0 &< k^2-k-2N \\ \end{align*}Using the quadratic formula to solve the final step,
\begin{align*} k &= \dfrac{1 \pm \sqrt{1+8N}}{2} \\ \end{align*}Note that $0 < k^2-k-2N$ can expressed as $N < \frac{1}{2}k(k-1)$.
In other words, $k$ is the number of rows in the smallest triangular number greater than or equal to $N$.