Understanding Democracy Through Mathematics