Sock Sorting Laxmi Parida (IBM and NYU), Rohit Parikh (CUNY and NYU) and Vaughan Pratt (Stanford) April 1, 1999 Abstract Algorithms of a social nature are extremely important and we are very dependent on certain “data structures” like names and social security numbers, on courts and on the postal system, and on various other social structures which enable us to perform activities like calling someone (you need her name for that), suing someone, or sending someone a bill. Unlike the situation in the theory of computation the existence of an algorithm for a real life situation always implies that the problem is feasibly solv- able. Perhaps the closest to the unsolvability of the halting problem are Arrow’s [1] impossibility theorems for voting. In this paper we analyze a rather mundane problem the problem of sorting socks after they have come out of the dryer and give several polynomial time algorithms Contents 1 Introduction 2 2 Problem Formulation: 3 3 The naive (greedy) algorithm: 3 4 An O(n 2 ) Algorithm Losing No Socks 5 1