IBM and NYU
c/o Computer Science
Courant Institute
251 Mercer Street
New York
NY 10012 USA
CUNY and NYU
c/o Computer Science
Courant Institute
251 Mercer Street
New York
NY 10012 USA
parikh@math1.nyu.edu
Computer Science Department
Stanford University
CA 94305-9045 USA
pratt@cs.stanford.edu
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 solvable. Perhaps the closest to the unsolvability of the halting problem are Arrow's Arrow 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