1997:6:16:19:35:


Odd socks: a combinatoric example of Murphy's Law

(Mathematics Today March-April 1996 39-41)


Abstract: We use combinatorics to examine the notorious ubiquity of unmatched - "odd" - socks. Using a random-loss model we show that (a) the disappearance of socks is indeed heavily biased towards the accumulation of odd socks; (b) random loss of just half the socks typically cuts the number of complete pairs left by 75 per cent; (c) the problem of finding matching pairs remains formidable, even after removal of all the odd socks. We suggest a remedy based on two varieties of socks.


Introduction

Murphy's Law - "If something can go wrong, it will" - is popularly held to underpin many unhappy phenomena, from being caught in rain without an umbrella to tumbling toast landing butter-side down. Orthodox scientific opinion, however, seems to be that Murphy's Law is merely an urban myth based on selective recall of unfavourable outcomes of events which can go either way. So sceptical an attitude has become somewhat harder to maintain following a recent analysis of the tumbling toast phenomenon [1]. This showed that toast sliding off a table or plate is indeed more likely to land butter-side down under a wide range of realistic conditions. Furthermore, it emerged that the origins of the phenomenon can ultimately be traced to the values of fundamental physical constants set shortly after the Big Bang. As well as confirming popular opinion, this result highlights the dangers of dismissing widely-reported phenomena as imaginary, nonsensical or trivial. Uncovering the truth can require detailed experimental and theoretical analysis. In what follows we analyse another widely-experienced manifestation of Murphy's Law: the proliferation of odd socks in drawers. Again, we find that popular experience is confirmed, and that the explanation has surprising depth.

The combinatorics of odd socks

At first glance, the notion that "If odd socks can be created, they will be" may seem ludicrous. However, a moment's reflection reveals its plausibility. Imagine a drawer containing only complete pairs of socks (as in most of the rest of this paper, we assume each pair is distinct). If one sock goes missing, it creates an odd sock in the drawer. When the next sock goes missing, it could either be the one odd sock just created, or a sock from a still-complete pair. As the latter typically outnumber the former, it is clearly more likely that another complete pair will be broken up, leading to the creation of yet another odd sock. We can thus see glimmerings of evidence that Murphy's Law really does affect sock drawers. It is worth noting that this plausibility argument is independent of any detailed knowledge of how or where the socks are lost. They may go missing after being taken off, on the way to or from the laundry, or be stolen by the family cat. Such details are irrelevant: the only assumption we need make for the analysis to proceed is that the loss process is random, with every sock as likely to go missing as any other. The analysis is made conceptually easier (and more fun) by assuming that socks are taken from the drawer by mythical gremlins, of whom we are the victims. Suppose that there are initially n complete, distinct pairs of socks in a drawer, and that the gremlins take 2s individual socks from the drawer at random. Then the probability that the gremlins can make exactly k complete pairs of socks from those they have taken is

so that

Our first demonstration of Murphy's Law of odd socks follows immediately from (2): when gremlins take socks, they are always more likely to leave us with odd socks than complete pairs. To see this, we first note that if 2s socks are taken, up to a maximum of n, the probability of the gremlins ending up with zero complete pairs - thus leaving us with 2s odd socks - is

Similarly, the probability of the gremlins obtaining s complete pairs from their raid on our drawer - thus leaving us with only complete pairs and no odd socks - is

So, defining a Murphy Ratio M(s,n) as the ratio of unhappy to happy outcomes, we have

Even at its least "unhappy" value, corresponding to s = n/2, this ratio is greater than unity, taking on the value

which ranges from M(1,2) = 2.0 for a drawer initially containing 2 pairs of socks, to M(10,20) = 5.7 for a 20 pair drawer.Thus if, for example, six socks are randomly lost from a drawer initially containing 10 complete pairs, (5) shows it is over 100 times more likely that the result will be the worst possible outcome - that is, just 4 complete pairs and 6 odd socks left in the drawer - than the best possible outcome, with 7 complete pairs being left. Even when half of the socks are lost, (6) shows it is 4 times more likely that the result will be a drawer full of odd socks, rather than one containing only complete pairs. Of course, this does not imply that a drawer full of odd socks is the most likely outcome of a gremlin raid; only that it is substantially more likely than a drawer full of complete pairs. To find the most likely effect of gremlin action, we require an estimate of the most probable number of complete pairs left behind after they have randomly extracted 2s socks. Let d denote the number of complete pairs left in our drawer. If the gremlins succeed in making k complete pairs out of the 2s they removed, then

Inserting this into (2) we find

A maximum likelihood estimate for d, denoted by <d>, follows from seeking the value of d that maximises the ratio Prob(d,s,n)/Prob(d-1,s,n). Using (8), setting the ratio to unity and solving for d, we find

where INT denotes integer part. Thus the most likely result of removing just 6 socks at random from 10 complete pairs - less than a third of the total - is a **halving** of the number of complete pairs. The powerful ability of the gremlins to create odd socks becomes still clearer if we allow them to take half the socks at random. Then (9) reduces to

a function which is well-approximated by INT[n/4]. Thus, if half the socks in a drawer are lost, the most likely outcome is for there to be just INT[n/4] complete pairs left, with all the other (n - 2.INT[n/4]) socks being odd. For example, losing half the socks from a drawer originally containing 10 complete pairs will most likely leave behind just 2 complete pairs, lost among 6 odd socks; no wonder complete pairs are so difficult to find in the morning !

If this were not bad enough, Murphy's Law also hinders our attempts to extract whatever complete pairs do exist in the drawer - even if we have been fortunate enough to have been left with a drawer-full of them. To see this, we form the maximum likelihood value for the number of complete pairs, <k(n,s)>, formed by extracting 2s socks from n jumbled complete pairs by substituting (7) into (9). This leads to

By setting 2s = 2, this equation confirms that for all n >= 2, drawing two socks at random even from a drawer-full of complete pairs is most likely to produce nothing but two odd socks. No surprises there; rather more striking, however, is the least proportion of socks, fmin, we have to extract to stand a reasonable chance of getting just one matching pair. This follows from setting <k(n,s)> to 1 and dividing by n:

which ranges from fmin (4 pairs) = 40 per cent to fmin(10 pairs) = 27 per cent.

Thus even if we have judiciously cleared out all the odd socks from our drawer (or if the gremlins have generously left us with all complete pairs) we are still likely to have to rummage through a substantial fraction of the remaining socks before getting just one matching pair. Beating Murphy's Law What practical lessons can we draw from all this ? First, (12) shows that those who ruthlessly eliminate odd socks but don't bother to keep the remaining pairs together should not be surprised if finding a matching pair is still a chore. In general, the number of socks one must extract to stand a reasonable chance of forming one complete pair from a drawer containing no odd socks is

that is, about 5 socks in the case of a drawer containing n = 10 complete pairs. Attempts to beat Murphy's Law of Odd Socks usually take the form of practical measures for keeping pairs of socks together, such as putting them into pillow-cases before they go into the washing machine. Ideally, of course, we would like to beat the Law without having to go to such pains. The simplest solution is to replace all our distinct pairs of socks with identical ones. Happily, however, combinatoric analysis shows this dreary solution to the gremlin problem is unnecessarily draconian: we can allow ourselves a little variety. Specifically, adopting a strategy based on two types of socks produces substantial gains in convenience over having all different types. Losing half the socks at random typically cuts the numbers of both types by half, and thus the number of possible pairs by three-quarters, as before. However, these remaining socks are not lost among a myriad of odd socks, and in general equal numbers of both types of sock will go missing. As a result, one can guarantee ending up with a complete pair from any size of two-variety sock collection after drawing out just 3 socks. More surprisingly, the probability of getting a matching pair after drawing out just two socks at random is also quite high if we restrict ourselves to equal numbers of two varieties. It is easily shown that the probability of getting one complete pair after drawing out just two socks from a collection of n socks of each type is

(The probability of getting a matching pair of a specific type of sock is, of course, half this). In contrast, the probability of doing so well after extracting two socks from a collection of n pairs of socks, all of which are distinct, is

This is typically much lower than (14): in the case of n = 10 pairs, for example, (14) shows there is about a 1 in 2 chance of drawing a matching pair out with the first two socks; the chances of success with all-different varieties are, by (15), 9 times lower. Furthermore, the probability of success with the two-variety remedy asymptotically approachs 1/2 for all large n, while the probability of success with all-different socks falls monotonically to zero as the number of pairs increases. This highlights another advantage of the two-variety approach: one can cheerfully buy as many extra pairs as one likes (as long as they are equally divided between the two varieties), and still have the same chance of quickly finding a matched pair in the morning. With all-distinct pairs, in contrast, buying more just makes things worse, reducing the chances of quick success to zero.

CONCLUSION

Using a very general random-loss model we have shown that gremlins have a penchant for odd socks that is not easily denied, and the result is another manifestation of Murphy's Law: "If odd socks can be created, they will be". Defeating this law is usually thought to demand either tiresome precautions to keep socks together, or the draconian measure of adopting just one type of sock. We have shown, however, that combinatoric arguments lead to a neater solution that requires neither vigilance nor dreary uniformity: get rid of all your existing socks, choose two favourite designs - and stick to them.

Reference

1. Matthews, R.A.J. 1995 "Tumbling Toast, Murphy's Law and the Fundamental Constants" European Journal of Physics 16 172-176