The madness of mobs, the wisdom of crowds and the paradoxes of democracy