Monday, July 12, 2010

How to calculate the constituencies per province

When I wrote about the constituency changes for the next national election, I only said there's an algorithm to calculate those numbers. I did not research that point further, but when nudged by a reader comment I can now not only give reference to this algorithm, I even created some code to calculate numbers myself, so I can even shed even more light on those two changes.

It turns out that already the 1997 constitution (unofficial translation) lays down the algorithm. In Section 102 it says
2. The determination of the ratio of the number of inhabitants to one member shall be made by reference to the division of such number of inhabitants throughout the country as evidenced in the census announced in the year preceding the year of election by the number of four hundred members of the House of Representatives.
3. The number of members of the House of Representatives of each Changwat [electoral district] shall be determined by the division of the number of inhabitants in that Changwat [electoral district] by such number of inhabitants per one member as determined under paragraph two. Any Changwat [electoral district] with inhabitants below the number of inhabitants per one member under paragraph two shall have one member of the House of Representative. Any Changwat [electoral district] with more inhabitants than the number of inhabitants per one member shall have an additional member of the House of Representatives for every such number of inhabitants as representing the number of inhabitants per one member.
4. Upon the number of members of the House of Representatives of each Changwat [electoral district] being obtained under paragraph three, if the number of members of the House of Representatives is still less than four hundred, any Changwat [electoral district] with the largest fraction remaining from the determination under paragraph three shall have an additional member of the House of Representatives and the addition of the members of the House of Representatives in accordance with such procedure shall be made to Changwat [electoral district]s in respective order of fractions remaining from the determination under paragraph three until the number of four hundred is obtained.
Coding this was really straightforward, only need the theoretical number of votes per one parliament seat, then divide the province population by this number and take the integer part of the result, and if this is smaller than one use one. The fractional part is then sorted and all the remaining seats are put according to that order.

Using the DOPA numbers of 20091 I could not only reproduce the numbers in the latest announcement, but also by repeating the same for 2008 and 2007 I found out that Yasothon lost its constituency to Nonthaburi with the 2007 population numbers, and Chiang Mai its seat to Songkhla with the 2009 numbers.

The same algorithm also works for the constituencies for the PAO councils. For example the 30 seats of the Surat Thani PAO council are - according to a 2004 announcement - split to 5 seats for Mueang district, 3 for Phunphin and Kanchanadit, 2 for Ban Na San, Wiang Sa and Phrasaeng, and one for each of the other districts. And exactly this result I could reproduce with the 2003 population numbers of Surat Thani province.

While looking for the algorithm, I also found the following interesting paper by Michael H. Nelson titled A Proportional Election System for Thailand, in which the author advocates the German electoral system for Thailand. Not directly related with this posting, but wanted to share that paper.

1The link currently does not work, because in the DOPA website reorganization in June the population numbers of 2009 were accidentally removed from the site.

4 comments:

john francis lee said...

Great work... where did you get the 2009 DOPA numbers if they are no longer available from the government?

Andy said...

My software makes a local cache, so it only needs to download them once. Which was rather handy when the pages disappeared completely. :-)

john francis lee said...

Will you share?

Andy said...

In this ZIP file are all the HTML with the 2009 (2552) numbers. However I skipped the province numbers (list for 2008) as I did not need them in the software, so you'd have to navigate manually. But the system is easy - the files are all named p52xx_y.html - xx the geocode of the province and y the subpage number.