3

A) the socks are asymmetrical (I must pair a left one with a right one)

This looks trivial:

  • I place the left socks in a random order. the order is immaterial, because I only care which 2 colors I get to wear.
  • then I place a right sock near each left sock

I can do this in $P(n) = n!$ ways

B) the socks are symmetrical (I can pair any sock with any other).

As I can wear any pair socks in both ways, I consider $(yellow,red)$ and $(red,yellow)$ as the same pairing.

I found several wrong answers from reasoning (fractional results, wrong result for trivial cases).

Ultimately, I am led to think that the two cases are actually the same problem, but can't find an explanation for that.

example of a wrong solution:

  • I choose n socks - can do this in ${2n \choose n}$ ways, and place them in a random order. the order is immaterial, because I only care which 2 colors I get to wear.
  • I can place the other n socks in $P(n) = n!$ ways
  • If I swap the two socks with the same colors, I have the same pairing. reduce by $\frac{1}{2^n}$
  • If I swap the two socks of a pair, I have the same pairing. reduce by $\frac{1}{2^n}$

result: $$ {2n \choose n}*n!*\frac{1}{2^{2n}} = \frac{ (2n)! }{n! 2^{2n}}$$

for $n=2$, this gives $3$, while the intuitive answer is $2$.

2 Answers2

4

There are $\frac{(2n)!}{2^nn!}$ ways to partition a set of $2n$ items into $n$ pairs. E.g., for $n=2$ there are $\frac{4!}{2^2\cdot2}=3$ ways to partition $4$ items into $2$ pairs. However, this calculation is based on the assumption that all $2n$ items are distinguishable, which is not the case in your second scenario: in that scenario the two socks of a given color are indistinguishable, so if red and yellow are the two colors, there is only one to make two mixed pairs, not two.

Your $\frac{(2n)!}{n!2^{2n}}$ does not actually give you $3$ for $n=2$: you have an extra factor of $2^n$ in the denominator, so it gives you $\frac{24}{32}=\frac34$.

Say that a pair of socks of the same color is a matched pair. One way to approach the problem is to count the pairings according to the number of matched pairs. For $k=0,\ldots,n$ there are $\binom{n}k$ ways to choose $k$ colors for $k$ matched pairs. The remaining $2n-2k$ socks of the other $n-k$ colors must be paired up so that no sock is matched with its mate. This amounts to choosing a derangement of these $n-k$ colors, something that can be done in

$$d_{n-k}=(n-k)!\sum_{i=0}^{n-k}\frac{(-1)^i}{i!}$$

ways. Thus, the number of possible pairings is

$$\begin{align*} \sum_{k=0}^n\binom{n}kd_{n-k}&=\sum_{k=0}^n\binom{n}k(n-k)!\sum_{i=0}^{n-k}\frac{(-1)^i}{i!}\\ &=\sum_{k=0}^n\frac{n!}{k!}\sum_{i=0}^{n-k}\frac{(-1)^i}{i!}\,. \end{align*}$$

For $n=2$ this yields

$$\frac21\left(1-1+\frac12\right)+\frac21(1-1)+\frac22(1)=2\,,$$

just as it should.

Brian M. Scott
  • 616,228
0

Initially I thought you meant how many different pairs could be worn and posted this.

A) It's n for the left foot times n for the right foot $n^2$

B) Imagine there are 4 colours. Red Blue Green Yellow.

We can do RR RB RG RY (4), then we start with B, but have to leave off BR, already used. So its BB BG BY (3), then start with G leaving off two used, its GG GY (2), then only YY (1).

They are the triangle numbers $0.5n(n+1)$

For all socks being paired answer B) still seems to involve the triangle numbers and becomes this...

to be continued