Recently I was putting some socks on the clothing line after taking them from the laundry machine and I while I was doing that I came up with an interesting math problem.
I usually wash $30$ or so socks (amounting for $15$ or so pairs) and then I start putting them on clothing lines. On one clothing line I can put at most $8$ socks. Here's my method of ordering: I pick a random sock and I put it on the first line, in the same time "reserving" the place after it for it's partner. Next I pick another random sock and if it's partner is already on one of the lines I just put it in the already reserved place, otherwise I put it in the next free place. First I tend to use all the free space on the first line, then on the second and so on. For example if I have something like $x-x-x-x-$ on the first line (where $x$ is a slot filled with a sock and $-$ is an empty slot, reserved for the partner of the sock ahead of it) and I pick up a new sock from the basket then I will put it on the second line and so on.
Once while doing this I started wondering: what is the probability of filling the first line with $8$ socks before any other line is filled? What about the second line being filled first, and so on? Unfortunately I haven't been able to get anywhere close to a solution. In order to avoid inconvenience I assume I have $8n$ socks, where $n$ is the number of clothing line. My idea was to number the pairs and shuffle the $8n$ numbers, order them in a line and then look at the probability of the first four distinct numbers finding their partner before any other set of four doing it, as we go along the line of shuffled numbers. Unfortunately things start to get complicated and I can't achieve anything.
I even thought of calculating the probability of the first line NOT filling first. I set the position of the last sock from the first line to be $n$ and then I try to find all combinations of putting $4$ other pairs between the first and $n-$th place. But the calculation of this number isn't easy and I'm afraid of double counting.
Anyway I wrote a computer program and here's what I've got for which number will be filled first for $32$ socks and $4$ lines, running it three times for various amounts of tries:
$$ \begin{array}{c|lcr} Line & \text{#1} & \text{#2} & \text{#3} \\ \hline 1 & 4168 & 8388 & 21041 \\ 2 & 3281 & 6394 & 16634 \\ 3 & 2077 & 4243 & 10735 \\ 4 & 469 & 984 & 2632 \\ \hline Total & 9995 & 20009 & 51042 \end{array} $$
EDIT: As pointed out in the comments, this solution is flawed.
Let $l$ be the number of lines, and let $s$ be the number of pairs of socks allowed in a line (in the case of the question, 8), and let $p$ be the number of socks in a pair (in this case 2). So, we should have $lsp$ socks.
Let $P_l$ denote the probability that line 1 gets finished first (in theory this method can be generalized to find the probability that the $n$th line gets finished first, but it becomes messier). I will describe a way to calculate $P_l$ recursively (note that this is probably not the best way; see my comment to this answer. However, this method is feasible and I would calculate it in your case if I did not have to leave soon; I will come back to this.).
$P_1=1$.
For larger values of $l$, we may use the principle of inclusion exclusion as follows:
\begin{align*} &P(\textrm{first line finishes before at least one other line})\\ &=\sum_{S\subseteq\{2,3,\dots,n\}}(-1)^{\lvert S\rvert+1}P(\textrm{first line finishes before all lines in } S)\\ &=\sum_{S\subseteq\{2,3,\dots,n\}}(-1)^{\lvert S\rvert+1}P_{\lvert S\rvert+1}\\ &= \sum_{i=1}^{n-1}\binom{n-1}{i}(-1)^{i+1}P_{l+1}. \end{align*}
(To get from the second line to the third line, interpret $i$ as $\lvert S\rvert$, so while the second line sums overt all sets, the third line sums over all possible sizes of the sets. The factor of $\binom{n-1}{i}$ counts the number of sets of size $i$.)
If we rearrange, we can get $P_l$ in terms of lower values of $P_l$ and the probability that the first line finishes before at least one other line.
To calculate the probability that the first line finishes before at least one other line, take 1 minus the probability that the first line finishes last. This is the probability that the last sock comes from one of the first $s$ pairs. This is equal to the probability that the last sock comes from the first pair, plus the probability that it comes from the second pair, plus... plus the probability that it comes from the $s$th pair.
To calculate the probability that the last sock comes from the $k$th pair, this is equal to the probability that the last sock does not come from the first $k-1$ pairs multiplied by the probability that it comes from the $k$-th pair given that it does not come from the $k$-th pair.
To calculate this, it is enough to calculate the probability that the last sock comes from the first pair where there are an arbitrary number of pairs. This is easy, because there are $ps-1$ socks that could be the last and there are $p-1$ remaining socks from the first pair (after the first one), so this probability is $\frac{p-1}{ps-1}$.