A Formal Model of the Relationship between the Number of Parties and the District Magnitude