0

I see many people ask a lot of questions while they are pairing socks: Here, here, here, and here you can find some nice examples.

Some days ago I had a similar situation. I was pairing socks following the method "I take one random sock of the pile and I either put it in a row of distinct socks, or I pair it with an existing element of this row". Assuming I have $n$ distinct pairs of socks, I had the following situation: my first 7 random choices were all different. So, I had a line of 7 distinct socks before I could find a match. On the 8th choice, I found my first match. I thought that the probability to get this sequence had to be really small.

Some days later I was remembering that situation and I wondered how many socks I had. And I don't know it. Hence, I did some computations to figure it out, but they are not conclusive:

What is the probability that, given $n$ pairs of socks, you get 7 different in a row, and then one repeated? If I didn't make any mistake, this should be $ P(n) = \frac{56(n-5)(n-6)(n-7)}{(2n-1)(2n-3)(2n-5)(2n-7)} $

Probability

And the maximum is close to n=18. So, if I had to bet to a single number, I'd say I had 18 pairs of socks.

However...

This graph is clearly skewed to the right. If I had to bet to get "the best approximation", I'd compute the expected value. And here it comes my problem: which is the expected value of socks I have?

$ E(n) = \Sigma_{n\ge 8} n \frac{56(n-5)(n-6)(n-7)}{(2n-1)(2n-3)(2n-5)(2n-7)} = +\infty $

So, the expected value of pairs of socks I had is infinity, which clearly it is not, because I don't have enough space to store them.

Could you help me find how many socks do I have, please? Thank you! (please, don't tell me to go and count how many socks do I actually have in my house. Doing maths is by far much more fun :-) ).

P.S. How can it be nobody created the "socks" tag yet???

xavier
  • 101
  • You're mixing up your concepts. You're calculating the maximum likelihood indicator. $P(n) \approx \frac{7}{2n}$ for large $n$, and so $ \sum P(n) \rightarrow \infty$. Whereas you next seem to be using $P(n)$ as the probability that you have $n$ socks. – Calvin Lin Oct 30 '20 at 15:38
  • True! I see! But still, how could I have a good guess about the number of socks I had? – xavier Oct 30 '20 at 15:59
  • Maximum likelihood indicator, so 18 (assuming your calculations are correct) – Calvin Lin Oct 30 '20 at 16:00
  • But that's just the maximum likelihood. I want an "expected value" for that. I see the maximum likelihood indicator is skewed If I had to guess to the best "approximation", I wouldn't bet for the most likely element but the region with a lot of elements with "almost maximum likelihood". Doesn't it make sense? – xavier Nov 02 '20 at 08:16

0 Answers0