
How to pair socks from a pile efficiently? - arono
http://stackoverflow.com/questions/14415881/how-to-pair-socks-from-a-pile-efficiently
======
SlyShy
I have 18 pairs of the same sock. I found that the most efficient way. YMMV.

~~~
AhtiK
Isn't this making it especially more complex because now you have to match
based on wear, not just the pattern?

With different patterns it's easier as the wear is constant for each pair. OCD
mileage may vary :)

~~~
TallGuyShort
If you really had OCD, you would always do laundry, pull the contents of your
sock drawer forward, put clean socks at the back, and only take socks from the
front. Problem solved.

~~~
Loughla
If you really had OCD, you would do laundry, wash your hands to avoid
spreading diseases to your family, pull the contents of your sock drawer
forward, wash your hands to avoid spreading diseases to your family, put clean
socks at the back, wash your hands to avoid spreading diseases to your family,
and only take socks from the front, after you have washed your hands to avoid
spreading diseases to your family. Problem solved, if the problem has been
washed, of course.

------
coldcode
The real world meets the world of algorithms. I solve the issue by buying only
1 color and type of sock.

~~~
bovermyer
What happens when your brand/model is discontinued?

~~~
privong
I had this happen a few years ago, though in a slightly different fashion. The
same "model" of sock was around, but the design changed once (width of
stripes) and the material/construction quality changed several times. So
despite having had ~15 pairs of the "same" socks, I still had to match because
otherwise they would feel different on my feet. That's obviously not an issue
in the grand scheme of things, but it bothered me :)

------
soneca
The first answer is kind of labourous, isn't?

I thought about simply removing a sock from the pile and isolating it. One for
one, maybe puting the man's socks on the left and the women's on the right.

So everytime you grab a new sock you can quickly check if you already isolated
the pair of that one.

This way you just have to grab each sock once. (this is similar to the second
answer, but no need to prepare a flat pile to begin with).

~~~
prawks
Yup. Unless you have millions of socks, you can afford to "hash" each style
sock by color + pattern + size + whatever, rather than repeatedly into ever-
smaller piles based on just one of the metrics.

That's actually how I pair my socks from the laundry pile, anything else seems
kind of silly...

 _This kind of recursive hash partitioning is actually being done by SQL
Server when it needs to hash join or hash aggregate over huge data sets._

My pile of socks is not a huge dataset. They easily fit on the seat of my
couch when laid out in pairs.

------
debacle
No one owns enough socks of enough different kinds to make the accepted
solution the most efficient.

It's much easier to simply try for a match on an unmatched sock, and if there
is no match put that sock into cache (usually somewhere else on the bed). Your
cache will probably never get above about 8 socks without a match.

~~~
jameshart
"No one owns enough socks of enough different kinds"

Not sure if you're making a legitimate YAGNI argument, or falling into a
programmer fallacy of believing you can safely generalize from your own
experience to your users...

I'm leaning towards the latter, and am further going to suggest that your
experience might be limited to being single, and likely male, and that it
generalizes badly on any axis away from that state.

This problem feels like a surprisingly good example of how your personal
intuitions about a problem space can lead you to make incorrect simplifying
assumptions to find an elegant solution, that will completely fail when they
run into the real needs of your actual users.

~~~
debacle
How many different kinds of sock do you own? I fold socks for four people - my
wife and my two children, contrary to your ignorant assertion - and between
the four of us we may have a dozen different kinds of sock.

------
grogenaut
The answer is [http://www.bargain-bulk-sock-sales.com/](http://www.bargain-
bulk-sock-sales.com/) Get a gross of either ankle, high or dress socks. ALL
EXACTLY THE SAME. When a sock goes bad, take it out of circulation and grab a
new one from the box. I bought a gross in 2004 and I'm about 1/2 of the way
through. So at that point it was about $90 for 10 years of socks with no time
spent on matching socks. They all match.

------
zhte415
Give the pile to a toddler. A lot can be learnt from sorting and hanging the
daily washing with a young child, on both sides.

~~~
satellitecat
My grandfather used to give me coins to count. Loved it. (Was older than a
toddler, though..)

------
peterwwillis
I wouldn't pair socks, personally. I would just create piles and offload
pairing to each sock-wearing instance. This becomes efficient by creating
piles based on intended use, and allowing each pile to have easily-
distinguished differences such as color difference or size. What's interesting
is that your pile criteria changes based on your socks. For me I have a long-
warm pile, long-cool pile, and short pile. But if I didn't have long or short
socks i'd have to create new piles: dress, casual, athletic, for example.
Another pile set might be long-short-dress, long-short-casual, long-short-
athletic, or long-short-warm, long-short-cool, long-short-athletic, etc.

In each case, the pile has socks that are so distinct that it becomes trivial
to identify a matching pair in the pile. This is also why I don't sort by
color.

------
dang
This has been posted many times to HN:

[https://hn.algolia.com/?q=how+to+pair+socks#!/story/forever/...](https://hn.algolia.com/?q=how+to+pair+socks#!/story/forever/0/how%20to%20pair%20socks)

The most recent repost was over a year ago, but not by much.

------
shangaslammi
I fold each pair of socks into each other when I put them into the washing
machine and then unfold them when hanging up to dry. All pairs stay together,
no sorting necessary.

------
facepalm
Or stop caring (that's what I do).

------
good-citizen
i made the 'mistake' of buying socks where some have a blue logo, some have a
green logo, and some have a grey logo. I forced myself to be 100% color blind
and mis-match the colors but consider that in my mind as a true match.

------
bagosm
Or, you know, do laundry more often so the socks dont actually pile up. May I
interest you in a to-do app?

~~~
antsar
This is still Hacker News, right?

