## I sock at maths

For the discussion of math. Duh.

Moderators: gmalivuk, Moderators General, Prelates

Theory
Posts: 1
Joined: Fri Feb 13, 2009 12:04 am UTC

### I sock at maths

A little probability problem which occurred to me whilst doing my laundry the other day. So far unsolved by a bunch of maths majors, but I'm sure xkcd can do better

I own 7 pairs of socks, one for each day of the week. One pair has 'Monday' on, the second 'Tuesday' etc. I mix them all up in a drawer, and randomly remove 9 individual socks. What is the probability that from the 9 socks I have removed, I can make exactly 2 pairs of matching socks?

There's a trick that makes it easy to solve for this particular case. However I still do not have a solution for the general case of selecting x socks from y pairs and obtaining z matching pairs. Can anyone here provide one?

Token
Posts: 1481
Joined: Fri Dec 01, 2006 5:07 pm UTC
Location: London

### Re: I sock at maths

The general case should be something like $\frac{\displaystyle{{y}\choose{z}} {{y-z}\choose{x-2z}}2^{\displaystyle x-2z}}{\displaystyle{{2y}\choose{x}}}$
First we pick which z of the y pairs we take, then which of the remaining y-z pairs we take a single sock from, then which single sock to take from each pair.

EDIT: Damn. I nearly didn't notice my 1000th post. I better not have made a mistake now.
All posts are works in progress. If I posted something within the last hour, chances are I'm still editing it.

quintopia
Posts: 2906
Joined: Fri Nov 17, 2006 2:53 am UTC
Location: atlanta, ga

### Re: I sock at maths

For this particular case, in order to get exactly 2 pair, you need to, at some point, draw at least one of every kind of sock. This makes the calculation pretty easy, but I'm really tired and will let someone else write it.

Beacons!
Posts: 213
Joined: Thu May 29, 2008 2:17 pm UTC
Location: The Grand Unifying Intermahweb

### Re: I sock at maths

There must be a program out there that writes immense tree-diagrams.
"Woof!", explained the dog

Posts: 5
Joined: Sat Feb 14, 2009 3:05 pm UTC

### Re: I sock at maths

For those who want the simple
Spoiler:
100%

You have 14 socks

You take out 9.

By pigeon hole theory you've got 2 extras, which means you can make 2 pairs of socks.

edit: this is the ONLY time I haven't complicated a question

Yesila
Posts: 221
Joined: Sun Dec 16, 2007 11:38 am UTC

### Re: I sock at maths

xkcdaddict wrote:For those who want the simple
Spoiler:
100%

You have 14 socks

You take out 9.

By pigeon hole theory you've got 2 extras, which means you can make 2 pairs of socks.

edit: this is the ONLY time I haven't complicated a question

But the op wanted exactly 2 pairs. Your solution gives at least 2 pairs but possibly as many as 4.

Posts: 5
Joined: Sat Feb 14, 2009 3:05 pm UTC

### Re: I sock at maths

Sorry, I misread the question as "guaranteed to have exactly 2 pairs."
English + late night != good

I agree with Token btw.