Similar Items: Mathematical theory of democracy