The answer for 10 pairs is 5.675463855030418 socks
It's impossible to make a pair when you take one sock, so the smallest amount you have to take is 2 socks. What's the probability of making a pair at the second sock? It's 1/3 since after the first one there is only 3 left in the basket. Then, after having a second sock that doesn't match, the third draw will guarantee a match since the next sock will 100% pair with either sock A or sock B.
In other words, for the scenario with 2 pairs, you have 1/3 chance of drawing twice and 2/3 chance of drawing thrice. On average, that's drawing 2*(1/3) + 3*(2/3) = 2.67 socks before you make a pair.
After drawing the first one, the chance to make a pair on the second one is 1/5, and if not made, the chance to make a pair on the third one is 2/4, if still not made, the forth draw guarantees a pair since you already have three different socks in your lap.
When we aggregate the possibilities, you have 1/5 chance to draw only 2 socks, (4/5)(2/4) chance to draw only three, and then (4/5)(2/4)(1) to draw four socks. On average, that's 2(1/5) + 3(4/5)(2/4) + 4(4/5)(2/4)(1) = 3.2 socks you'll have to draw to get a match.
Again, the first sock cannot make a pair, so we start from the second. The chance to get a pair on the second draw is 1/7, the chance to get a pair on third draw is (6/7)(2/6), the chance to get a pair on the fourth draw is (6/7)(4/6)(3/5), then if we still don't have a pair, the fifth draw guarantees a pair.
On average, that will be 2(1/7) + 3(6/7)(2/6) + 4(6/7)(4/6)(3/5) + 5(6/7)(4/6)(2/5) = 3.66 socks to make a pair.
From the patterns above, we can know that with p pairs of socks, on average the number of draws needed can be expressed with the following function D(p) where D(p) is defined as D(p) = 2(1/2p-1) + 3(1 - 1/2p-1)(2/2p-2) + 4(1 - 1/2p-1)(1 - 2/2p-2)(3/2p-3) + ... + p(1 - 1/2p-1)(1 - 2/2p-2)(1 - 3/2p-3)... ((p-1)/(2p-(p-1))) + (p+1)p(1 - 1/2p-1)(1 - 2/2p-2)(1 - 3/2p-3)... (2/2p-(p-1)) We can also rewrite this using the sigma notation: $$D(p) = \sum_{i=2}^{p+1} i(1-\frac{2-1}{2p-(2-1)})(1-\frac{3-1}{2p-(3-1)})... (\frac{i-1}{2p-(i-1)}) $$ Plugging in p=10, we get roughly 5.675463855030418 socks
6.489 for 10 pairs of socks
three point five seven
three point five seven
9! or 362880.
5 is the 'maximum' maximum, since if there are 5 unpaired socks in your lap, every subsequent sock you pull from the basket will have a match in your lap.
46080 paths lead to a maximum of 5. 147456 paths lead to 4, 138240 paths lead to 3, 30720 paths lead to 2, 384 paths lead to 1.
46080 * 5 = 230400; 147456 * 4 = 589824; 138240 * 3 = 414720; 30720 * 2 = 61440; 384 * 1 = 384; Sum of the above = 1296768
Weighted Total / Total Paths = 1296768 / 362880 = 3.5735