the mathematics of elections