Hacker News new | comments | show | ask | jobs | submit login

I use the Birthday Paradox when I'm searching for matching socks in the morning -- rather than pick a sock and look for one that matches it, I accumulate socks and choose the first pair that match.

I use Lisp for that same purpose whenever I do my laundry. I cons my socks ahead of time, then serialize the pairs to a drawer. O(1) lookup FTW!

Quite possibly the geekiest hn comment I've read :)

That's an excellent metaphor!

My other favorite programming metaphor is about skiplists: they're like a set of subway lines, with some extra express lines that skip a random (and increasing, for each level) number of stops.

I wrote this thing "on the complexity of sock-matching" a few years back: http://www.mail-archive.com/kragen-tol@canonical.org/msg0008...

It was more about the problem of matching socks when I put them away, but the same principle applies.

I use the futon in my bedroom as an L1 cache for frequently worn clothes.

instead of casting other types, just make everything a string: buy a whole lot of pairs of the same type of sock so you don't have to worry about matching types!

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact