Matching Socks

You do a load of laundry containing 4 4 identical black socks, 4 4 identical blue socks, and 4 4 identical white socks. When it is finished, you randomly place all the socks in a single row on a table so that you can match them later on.

To your surprise, all 6 6 pairs of socks are already beside their match!

The probability that a match-up is already complete is 1 x . \frac{1}{x}.

What is x ? x?


The answer is 385.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

6 solutions

Zee Ell
Sep 27, 2018

The total number of ways the 12 socks can be ordered if we have 3 sets of 4 identical socks each:

12 ! 4 ! 4 ! 4 ! = 34650 \frac {12!}{4!4!4!} = 34650

The total number of ways the 6 pairs of socks can be ordered if we have 3 sets of 2 identical pairs each:

6 ! 2 ! 2 ! 2 ! = 90 \frac {6!}{2!2!2!} = 90

Hence the probability of having all socks in pairs in a row:

p = 1 x = 90 34650 = 1 385 p = \frac {1}{x} = \frac {90}{34650} = \frac {1}{385}

x = 385 x = \boxed {385}

Great solution!

David Vreken - 2 years, 8 months ago

Btw, anyone who isn’t so good at math, the exclamation points show factorials, meaning x+(x-1) (x-2) ...*1

DOMINIC FRANCIS ALVAREZ - 2 years, 8 months ago

Log in to reply

I need to correct you,

x ! x! = = x × ( x 1 ) × ( x 2 ) × × 3 × 2 × 1 x × (x-1) × (x-2) × \cdots × 3 × 2 × 1 .

For example, 4 ! 4! = 4 × 3 × 2 × 1 = 4 × 3 × 2 × 1 = 24 = 24 . And this symbol " ! ! " is know as "factorial".

I'm not sounding rude, it might be a typo, that you've typed '+' instead of '×' at the start @DOMINIC FRANCIS ALVAREZ ! 😊

Prem Chebrolu - 2 years, 8 months ago

And, the * is a multiplication sign.

DOMINIC FRANCIS ALVAREZ - 2 years, 8 months ago

Nice approach! @Zee Ell

Prem Chebrolu - 2 years, 8 months ago

Yep... Damn... i did nt multiply the 5 in the corner... and i did try out of whimse.. at the last trial.

Ananya Aaniya - 2 years, 8 months ago

This seems wrong to me... in the denominator, you’re assuming identical socks are interchangeable. In the numerator, you’re not. Can you find my error?

I’m getting: Six pairs in any order = 6! Four of each color can be in any order = 4!4!4! Total orders = 12!

So it should be 6!4!4!4!/12!

Why do we need the 2!2!2! in your formula? The order of identical socks is already accounted for in the 4! terms

Jonathan Drucker - 2 years, 8 months ago

For anyone not satisfied with this formula, there's another way to get it: by induction. Let there be a a black pairs, b b blue pairs and c c white pairs and let's show that the probability is P a , b , c = ( a + b + c ) ! ( 2 a ) ! ( 2 b ) ! ( 2 c ) ! ( 2 ( a + b + c ) ) ! a ! b ! c ! \boxed{P_{a,b,c}=\dfrac{(a+b+c)!·(2a)!·(2b)!·(2c)!}{(2(a+b+c))!·a!·b!·c!}} .

Let's call f ( a , b , c ) : = ( a + b + c ) ! ( 2 a ) ! ( 2 b ) ! ( 2 c ) ! ( 2 ( a + b + c ) ) ! a ! b ! c ! f(a, b, c):=\dfrac{(a+b+c)!·(2a)!·(2b)!·(2c)!}{(2(a+b+c))!·a!·b!·c!} .

  • The formula is correct with only one color: P a , 0 , 0 = 1 = f ( a , 0 , 0 ) P_{a,0,0}=1=f(a, 0, 0) .

Using x ! ! = x ( x 2 ) ( x 4 ) 1 x!!=x·(x-2)·(x-4)·\cdots·1 for x x odd, so 7 ! ! = 7 5 3 1 = 105 7!!=7·5·3·1=105 , it is left to the reader to show that ( 2 k 1 ) ! ! = ( 2 k ) ! 2 k k ! (2k-1)!!=\dfrac{(2k)!}{2^k·k!} and therefore that:

f ( a , b , c ) = ( 2 a 1 ) ! ! ( 2 b 1 ) ! ! ( 2 c 1 ) ! ! ( 2 ( a + b + c ) 1 ) ! ! f(a, b, c)=\boxed{\ \dfrac{(2a-1)!!·(2b-1)!!·(2c-1)!!}{(2(a+b+c)-1)!!}\ }

Note: This formula is indirectly used in other answers: f ( 2 , 2 , 2 ) = ( 3 1 ) ( 3 1 ) ( 3 1 ) 11 9 7 5 3 1 = 3 11 1 9 3 7 1 5 f(2,2,2)=\dfrac{(3·1)·(3·1)·(3·1)}{11·9·7·5·3·1}=\dfrac{3}{11}·\dfrac{1}{9}·\dfrac{3}{7}·\dfrac{1}{5}

  • Now, suppose P a , b , c = f ( a , b , c ) P_{a,b,c}=f(a, b, c) , let's show that P a + 1 , b , c = f ( a + 1 , b , c ) P_{a+1,b,c}=f(a+1,b,c) :

As a + 1 > 0 a+1>0 , there's a place with a black sock, next to a pairing sock which has probability 2 ( a + 1 ) 1 2 ( ( a + 1 ) + b + c ) 1 \dfrac{2(a+1)-1}{2((a+1)+b+c)-1} to be also black. So we have P a + 1 , b , c = 2 ( a + 1 ) 1 2 ( ( a + 1 ) + b + c ) 1 P a , b , c P_{a+1,b,c}=\dfrac{2(a+1)-1}{2((a+1)+b+c)-1}·P_{a,b,c} = by ind. 2 ( a + 1 ) 1 2 ( ( a + 1 ) + b + c ) 1 ( 2 a 1 ) ! ! ( 2 b 1 ) ! ! ( 2 c 1 ) ! ! ( 2 ( a + b + c ) 1 ) ! ! \overset{\text{by ind.}}{=}\dfrac{2(a+1)-1}{2((a+1)+b+c)-1}·\dfrac{(2a-1)!!·(2b-1)!!·(2c-1)!!}{(2(a+b+c)-1)!!}

= 2 a + 1 2 ( a + b + c ) + 1 ( 2 a 1 ) ! ! ( 2 b 1 ) ! ! ( 2 c 1 ) ! ! ( 2 ( a + b + c ) 1 ) ! ! = ( 2 a + 1 ) ! ! ( 2 b 1 ) ! ! ( 2 c 1 ) ! ! ( 2 ( a + b + c ) + 1 ) ! ! =\dfrac{2a+1}{2(a+b+c)+1}·\dfrac{(2a-1)!!·(2b-1)!!·(2c-1)!!}{(2(a+b+c)-1)!!}\ =\ \dfrac{(2a+1)!!·(2b-1)!!·(2c-1)!!}{(2(a+b+c)+1)!!}

= ( 2 ( a + 1 ) 1 ) ! ! ( 2 b 1 ) ! ! ( 2 c 1 ) ! ! ( 2 ( ( a + 1 ) + b + c ) 1 ) ! ! = f ( a + 1 , b , c ) =\ \dfrac{(2(a+1)-1)!!·(2b-1)!!·(2c-1)!!}{(2((a+1)+b+c)-1)!!}\ =\ f(a+1, b, c) .

Note: P a , b + 1 , c = f ( a , b + 1 , c ) P_{a,b+1,c}=f(a, b+1, c) and P a , b , c + 1 = f ( a , b , c + 1 ) P_{a,b,c+1}=f(a, b, c+1) can be done the same way, but it's obvious because P a , b , c = P b , a , c = P c , b , a P_{a,b,c}=P_{b,a,c}=P_{c,b,a} .

  • That shows the formula holds for any a a , b b and c c .

If you're not satisfied with picking a place where there's a black sock, there are two other ways:

1) Have to cases, one where the first sock is black, and one where the first is, WLOG, blue. Show that P a + 1 , b , c = f ( a + 1 , b , c ) P_{a+1,b,c}=f(a+1, b, c) in both cases. Only difference is that induction must be made on n = a + b + c n=a+b+c and beginning with showing that P a , b , c = f ( a , b , c ) P_{a,b,c}=f(a, b, c) for a + b + c 1 a+b+c\leq1 .

2) Show that the probability doesn't change with the color of the first sock (i.e. knowing which color is the first sock doesn't increase or decrease your chances of success) and then just assume the first one is black to do the maths. To show that, see that you can alter the row of socks without changing the probability that socks are paired. If some black sock is on an even place, exchange it with its matching sock -- the one just before. The pair remains two blacks, or of different colors. Now, you have at least one black sock on an odd place. Exchange it and its following neighbor with the first and second one. This doesn't change the probability either.

Laurent Shorts - 2 years, 7 months ago
Paul Cockburn
Oct 7, 2018

Working along the illustrated row one sock at a time, the colour of the first sock is irrelevant but the probability for the second sock to match is 3/11. The colour of the next sock is again irrelevant (bear with me...) but the probability for the fourth sock to match is 3/9. The probability of the sixth sock matching (blue in the illustration) is 1/7 and so on, giving a total probability of 3/11 x 3/9 x 1/7 x 3/5 x 1/3 x 1/1 = 1/(11x7x5) = 1/385.

OK, this is a slight cheat because I have used the illustration which is only one possible arrangement. The colour of the first sock in each pair is not strictly irrelevant. If it is the same as a previous colour the probability of a match becomes 1/n instead of 3/n. But all this does is change the order of the numerators in the above product and it has no effect on the denominators. The end result is the same.

I don't think it's a cheat. You've taken an arrangement that meets the criteria, and then calculated the odds of that specific arrangement occurring, which should tell you the odds of any satisfactory arrangement occurring. Nicely done.

Brian Egedy - 2 years, 8 months ago

Log in to reply

I solved it the same way.

Scott Broughton - 2 years, 8 months ago

I don't understand how you got a probability of 3/9 for the fourth sock. Since the third sock has 1/5 chance of being the same color as the first pair and 4/5 chance of being one of the other two colors, the odds of finding a match for the fourth sock should be 1/5 x 1/9 + 4/5 x 3/9 = 13/45.

Your calculation for the fourth sock assumes the third sock is not the same color as the first pair, and yet you say the color of the third sock doesn't matter.

Why does your math add up when it really doesn't seem to take everything into consideration?

Kevin Higby - 2 years, 8 months ago

Log in to reply

3/9 for the fourth sock takes into account that there are 3 socks of any same color out of 9 possible socks.

Scott Broughton - 2 years, 8 months ago

Yes, that's the way I did it. Was a bit worried about the cheat at first but then I thought, it'll happen further down anyway.

Michael McLaughlin - 2 years, 7 months ago

You just made a very broad generalization and that's okay because the question wasn't asking for specific orders or anything.

Kevin He - 2 years, 7 months ago

We can show that the color of the first sock doesn't change the probability to have them sorted, and therefore that you can do the maths by picking either color for the first sock.

Proving this fact can be made with some algebra and the formula for k k black pairs, c c blue pairs and w w white pairs: P ( k , c , w ) = ( k + c + w ) ! ( 2 k ) ! ( 2 c ) ! ( 2 w ) ! ( 2 ( k + c + w ) ) ! k ! c ! w ! P(k, c, w)=\dfrac{(k+c+w)!(2k)!(2c)!(2w)!}{(2(k+c+w))!k!c!w!}

An other way, without algebra and easier, is to see that you don't change the probability if you exchange the two first socks with socks number 2 n 1 2n-1 and 2 n 2n , nor if you exchange the first and second socks. If you want to start with a black sock, find any place where there's one, exchange the black sock and the one next to it with the first and second, putting the black sock first. Tada!

Laurent Shorts - 2 years, 7 months ago
Liu Qi
Oct 8, 2018

6! *(4!/2)^3/ 12! (Total possibilities)

Apoorva Singal
Oct 11, 2018

We need 6 pairs of white, blue and black. The order in which these pairs are does not matter.

Let's say the first sock is white. The probability of the first sock being either white, blue or black is 1. For the second sock the probability that it is the same color is 3/11.

The third sock again can be any color and the probability is 1. The fact that it's pair should be the same color is 1/9 if it's white or 3/9 if it's blue or black.

So till the fourth sock we have either 1 x 3/11 x 1 x 1/9 or 1 x 3/11 x 1 x 3/9 Lets look at the first case all white socks are over. The fifth and sixth probability that they pair up would be 1 x 3/7 (since either blue or black can be picked and there would be 3/7 chance of the next sock being the same pair). Similarly the remaining probability for 7th, 8th, 9th and 10th would be 1 x 3/5 x 1 x 1/3.

Lets compare this with second case. If we consider the first white pair is followed by a blue or black pair then the white pairs probability will still follow with 1 x 1/3

So the final probability for 12 socks is (since the order doesn't matter) is: 1 x 3/11 x 1 x 3/9 x 1 x 3/7 x 1 x 1/5 x 1 x 1/3 x 1 x 1 =1/385

The 11th and 12th socks are what remain and hence their probability of selection is 1.

Thanks for simple explanation.

Akela Chana - 2 years, 8 months ago
Daniel Baton
Oct 21, 2018

Consider the case where you have 6 distinct pairs of socks (in 6 different colors).

After the first sock is drawn (the color is irrelevant), the probability that the next sock drawn makes a pair with the sock is 1 11 \frac{1}{11} . Then, once the third sock is picked, the fourth sock has a 1 9 \frac{1}{9} chance of making a pair, followed by a 1 7 \frac{1}{7} chance for the next two socks, etc. Therefore, in this case, the probability of a match-up is 1 11 9 7 5 3 1 \frac{1}{11 \cdot 9 \cdot 7 \cdot 5 \cdot 3 \cdot 1} = 1 10395 \frac{1}{10395}

However, in the real problem, the socks come in only four colors, with four socks of each color. This means the first sock picked of a color has 3 possibilities for the sock it makes a pair with, and the other two socks would have to become the other pair. There are three colors of socks, each of which can be placed into two pairs in 3 ways, which means we only found 1 3 3 3 \frac{1}{3 \cdot 3 \cdot 3} or 1 27 \frac{1}{27} of the possible outcomes. Multiplying 1 10395 \frac{1}{10395} by 27 gives us 1 385 \frac{1}{385} , so x = 385 x = \boxed{385}

Charles Morace
Oct 10, 2018

There are ( 12 4 ) ( 8 4 ) {12\choose 4}\cdot {8\choose 4} total ways to arrange the 12 socks since there are ( 12 4 ) {12\choose 4} ways to arrange the first color; after the first color has been positioned, there are ( 8 4 ) {8\choose 4} ways to arrange the second color; and after the first and second colors have been positioned, there is only one way to arrange the last color.

Similarly, there are ( 6 2 ) {6\choose 2} ways to arrange the matching pairs of the first color and ( 4 2 ) {4\choose 2} ways to arrange the matching pairs of the second color. So, there are ( 6 2 ) ( 4 2 ) {6\choose 2}\cdot {4\choose 2} total ways to arrange the 6 matching pairs.

Thus, assuming all arrangements are equally likely, the probability that all pairs of socks are beside their match is ( 6 2 ) ( 4 2 ) ( 12 4 ) ( 8 4 ) = 1 385 \frac{{6\choose 2}{4\choose 2}}{{12\choose 4}{8\choose 4} } = \frac{1}{385}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...