Analysing the BBMP Elections

The Bruhat Bengaluru Mahanagara Palike (BBMP) went to polls on Saturday, and votes were counted today. The BJP has retained its majority in the house, winning 100 out of 198 available seats. While this is a downer compared to the 113 seats they had won in the previous elections in 2010, the fact that they have won despite being in opposition in the state is a significant achievement.

Based on data put out by Citizen Matters, here is some rudimentary analysis. The first is a choropleth of where each party has performed. Note that this is likely to be misleading since constituencies with large areas are over-represented, but this can give you a good picture.

Red: BJP Green: Congress Cyan: JD(S) Blue: Independents Black: Others

Notice that there are a few “bands” where the BJP has performed really well. There is the south-western part of the city that it has literally swept, and it has done well in the south-eastern and northern suburbs, too. And the party hasn’t done too well in the north-west, the traditional “cantonment” area.

We can get a better picture of this by looking at the choropleths by assembly constituency. These shapes might be familiar to regular readers of the blog since I’d done one post on gerrymandering.


This tells you where each party has done well. As was evident from the first figure, the BJP has done rather well in Basavanagudi, Jayanagar and Padmanabhanagar in “traditional South Bangalore” and blanked out in Pulakeshi Nagar in the cantonment. In fact, if you try to correlate these results with that of the last Assembly elections, the correlation is rather strong. Most constituencies have gone the way of the assembly segments they are part of.

Then there is the issue of reservation – there were a lot of murmurs that the Congress party which is in power in the state changed the reservations to suit itself. Yet, there are a few interesting factoids that indicate that the new set of reservations were rather logical.

The next two graphs show the distribution of SC and ST populations respectively as a function of the reservations of the constituencies (population data from

Rplot03 Rplot02Notice that the constituencies reserved for SCs and STs are among those that have the highest SC and ST populations respectively. The trick in gerrymandering was in terms of distributions between general and OBC constituencies, and among women.

I could put the performance of different parties by reservation categories, and on whether the reservation of a constituency has changed has any effect on results, but (un)fortunately, there aren’t any trends, and consequently there is little information content. Hence I won’t bother putting them in.

Nevertheless, these have been extremely interesting elections. All the postponement, all the drama and court case, and finally the underdog (based on previous trends) winning. Yet, given the structure of the corporation, there is little hope that much good will come of the city in the coming years. And there is nothing in the election results that can alter this.


My tryst with Kannada media

So about a month or so back, I wrote up an essay on why the much-maligned TenderSURE project is a right step in the development of Bangalore, and why the Chief Minister’s comments on the issue were misguided and wrong.

Having written it, considering it worthy of a better forum than NED, I shared it with my Takshashila colleagues. They opined that is should get published in a Kannada newspaper, and Varun Shenoy duly translated the piece into Kannada. And then the story began.

We sent it to PrajaVani (which has published several other Op-Eds from other Takshashila people), but they summarily rejected this without giving reasons. We then sent it to UdayaVani, reaching it after passing some hoops, but then they raised some questions with the content, the answers to which had been made quite clear within the text.

I think Mint has spoilt me, in that I assume that it’s okay to write geeky stuff and have it accepted for publication. Rather, it is possible that they’ve recruited me so that they can further bolster their geek quotient. Last week, for example, I sent a piece on Fractional Brownian Motion, and it got published. A couple of years back I’d sent a formula with Tchebyshev’s inequality to be included in a piece on sampling, and they had published that too.

When translating my piece, Varun thought it was too geeky and technical, and he made an attempt to tone it down during his translation. And the translation wasn’t easy – for we had to find Kannada equivalents for some technical terms that I’d used. In some cases, Varun expertly found terms. In others, we simply toned it down.

Having toned down the piece and made an effort to make it “accessible”, UdayaVani’s response was a bit of a dampener for us – and it resulted in a severe bout of NED. And so we sat on the piece. And continued to put NED.

Finally, Varun got out of it and published it on the Takshashila blog (!!). The original piece I’d written is here:

A feature of Bangalore traffic, given the nature of the road network, is that bottlenecks are usually at the intersections, and not at the roads. As a consequence, irrespective of how much we widen the roads, the intersections will continue to constrain the flow of traffic in the city. In other words, making roads narrower will not have a material impact on the throughput of traffic in the city.

And Varun’s translation is here:

(Update: I tried to extract Varun’s piece here but it’s not rendering properly, so please click through and read on the Logos blog)

Read the whole thing, whichever piece you can understand. I think we are on to something here.

And on that note, it might make sense to do a more rigorous network-level analysis of Bangalore’s roads. Designing the graph is simple – each intersection (however small it might be) is a node, each “road segment” is an edge. The graph is both directed (to take care of one-ways) and weighted (to indicate width of roads).

We’ll need data on flows, though. If we can get comprehensive data of origin and destination of a large number of people, we should be able to impute flows in each segment based on that.

And then we can rigorously test the hypothesis (I admit that it’s still only a hypothesis) that bottlenecks on Bangalore’s roads are intersections and not roads.

Splitting BBMP and gerrymandering ToK

Kannada organisations have argued against splitting of the Bruhat Bengaluru Mahanagara Palike (BBMP), the civic agency that is supposed to govern Bangalore, arguing that a three-way-split of the municipal corporation, as has been proposed, will lead to “non-Kannadiga mayors” for some of the newly created corporations, and hence this is an “anti-Kannada” move. In a funny twist, the Chief Minister himself has had to make a statement that the split won’t lead to “Telugu and Tamil mayors”.

A couple of months back, Thejaswi Udupa had written this tongue-in-cheek post on the geopolitics of Bangalore, for April Fool’s Day on Takshashila’s Logos blog. The Business Standard picked it up and published it as an Op-Ed the next day. The reason the piece matters is that it introduces the larger public to the wonderful phrase ToK. Quoting,

The largest of disputed territories in Bangalore is that of ToK. Tamil occupied Karnataka. These are large swathes of interconnected parcels of land in the South-Eastern quadrant of Bangalore. ToK’s existence is mostly under the radar, and people notice it only when the census figures come in once a decade with its linguistic break-ups, and suddenly people realise that nearly 25% of Bangalore’s population is Tamil. However, there are many who believe that ToK stands for Telugu owned Karnataka, as most of the land here is owned by Telugu landlords.

So basically the concern of the Kannada organisations is that when Bangalore is split ToK (however you may define it) will become an independent city. While some people might consider it a good thing in a “ok those buggers are not in our city any more” sort of way, these organisations will see this as a loss of territory, and consequently as a loss of power. So this is a genuine problem.

While this might be a genuine problem, the fact is that there is a “genuine” solution to this problem. We had seen last month about how Bangalore city is so badly gerrymandered in terms of splitting its assembly constituencies. For example, my constituency (Padmanabhanagar) looks like a dancing hen. To refresh your memory, this is what Bangalore’s assembly constituencies look like:

So if assembly constituencies are so badly gerrymandered, what prevents us from gerrymandering the municipal corporations? And there is further precedence to this – there are primarily three Parliamentary constituencies in Bangalore, and it is not hard to argue that they have been gerrymandered in a similar manner.

It all finally comes down to the mechanics of how we split the city. If the city is cut into three by drawing North-South lines (creating “Bangalore East”, “Bangalore West” and “Bangalore”), we have a problem, since the Bangalore East thus created will largely coincide with ToK, and we might end up with non-Kannadiga mayors there, as the Kannada organisations fear.

However, considering that Bangalore is being split for purely administrative efficiencies, and for no real cultural reasons, there is no reason we need to split the city in that way. All we need to do is to draw the lines in an East-West fashion, as we have done with our Parliamentary constituencies, giving us a “Bangalore North”, “Bangalore Central” and “Bangalore South”. A split like this, well done and well gerrymandered, will ensure that ToK is split evenly into the three new corporations, and all will remain under the control of the Kannadigas.

So the Kannada organisations don’t need to fear the split. Solution exists. Only thing they need to fear is the way the split is implemented. And with precedence (parliamentary gerrymandering) on their side, they really have nothing to fear!


Thanks to Varun Shenoy for the discussions leading up to this post

The Cooling Effect of Bangalore Rains

So it is “well known” that whenever it rains heavily in Bangalore, the city cools down like crazy. However, all these days, thanks to dodgy data from the Met department, it’s just been an (multiple) anecdotal observation, and not really backed by data.

However, thanks to the efforts of Pavan and Saurabh and the Yuktix team, we have “citizen weather monitoring centres” in several places across Bangalore. These are simple devices that have been installed on terraces or gardens of people, and they contain a rain gauge, a hygrometer, a thermometer and a wind gauge (or whatever it is that measures wind). And they have an embedded SIM card and transmit data every few minutes to the central server (for all you VCs, this is both “cloud-based” and “Internet of things”, so fund them already!).

The web interface isn’t great yet, and the data download is a bit dodgy, but hey, it works for now and we have actual data to show the weather conditions in Bangalore. And there are several stations all over the city (all installed by volunteers who have paid to have one such device in their homes. If you are interested, you can get one, too. Contact Pavan for this), so we can actually test popular hypothesis like how it can rain in one part of Bangalore and not in the other, etc.

Anyway, given the dodgy interface I’m unable plug a weather widget here (how cool would that have been?) so I’ve to shamelessly take screenshots and paste it. This one shows the temperature as measured by the device in Pavan’s house in 4th T Block (the station closest to my home) in the last one week:

Screen Shot 2015-04-24 at 9.49.10 am


Notice the nice sawtooth pattern of Bangalroe summer temperature. Temperatures rise steadily till about 2:30 pm and then fall steadily (but at a lower rate) till about 5:30 am. It is rather steady and repetitive as the graph shows. And then look at what happened yesterday! A steep plunge between 4:30 and 6:30 pm yesterday, and remember that the hailstorm started around 6!

I’ve noticed this on other days also (again by looking at Pavan’s data), and the same pattern holds. The hypothesis that rains do have an instant effect on the city’s temperature definitely holds!

For more interactivity with the data, you can check out Pavan’s station. Or whichever station that is closest to where you are! if there is none close to where you are, maybe it’s time for you to set up one such station!

Gerrymandering in Bangalore

So a couple of years back, just before the Karnataka Assembly elections, I had taken a look at Gerrymandering within the constituencies of Bangalore. This picture shows the boundaries of the parliamentary constituencies in the city, and you can see that it is bizarre. For example, parts of the Bangalore North parliamentary constituency (black) lie to the south of all of Bangalore South constituency (green)!

Now, the word “gerrymander” was invented in the 1800s, when one Mr. Gerry, who was the governor of Massachusetts, redrew the districts (constituencies) in the state in order to maximise the chances of his further election victory, and the redrawn districts looked like some kind of a mythical creature, which was given the name “gerrymander”.

Now, while the Bangalore figure above looks bizarre, no doubt, it doesn’t really resemble any animal, mythical or otherwise. However, with the proposed BBMP Restructuring, Bangalore’s wards are in the news again. And I was just looking at the population densities in different wards, and happened to take a look at Padmanabhanagar, which is my current assembly constituency. And this is what it looks like (different components are the different wards within the constituency, and intensity of colouring indicates population density within these wards).

padmanabhanagarYes, really, that is the shape of the Padmanabhanagar assembly constituency. If you have any doubts, get the data from and check out for yourself (that’s where I got the mapping data from; density data came from the BBMP Restructuring site  – there’s a link there with excel file on areas and populations).

Anyway, so what do you think Padmanabhanagar looks like? To me, this looks like a hen that is running. To Thejaswi Udupa, with whom I shared this picture, it looks like a “hen doing ballet”.

Whatever it is, such gerrymandering leads to atrocious policy and implementation. My house, for example, is very close to the beak of the hen described above. In other words, it’s in one extreme corner of the constituency. Actually, if you look at the portion forming the hen’s head, that’s Yediyur ward, and my house is at one extreme of Yediyur ward, too.

The road outside was dug up a year and half back and hasn’t yet been asphalted. Stone slabs covering storm water drains were removed four months back for desilting and are yet to be placed back. And because we are at one extreme edge of both assembly and BBMP constituencies, neither MLA (R Ashok) nor corporator (NR Ramesh) bothers.

If there were no gerrymandering, there wouldn’t be any “extreme corners” like this one. And that would mean less chance for elected representatives to ignore certain parts. And that would lead to better governance!


This is what all the constituencies of Bangalore look like (click for a full size image)


Let your imagination run wild!

Karnataka’s bizarre liquor license policy

Karnataka has a rather weird liquor license policy. Some twenty years ago, back when S Bangarappa was the chief minister (if I’m not wrong) the state decided to freeze the number of bars. “Growing alcoholism” was the ostensible reason. Since then, if someone has to open a bar, the license has to be purchased from an existing bar owner who will then shut down his bar. Thus, the number of bars in the state (whose population has increased manifold since) has remained constant.

This is not the only funny aspect of liquor regulation in Karnataka.  Till recently, there was also the rather bizarre requirement that each bar sell a minimum “quota” of liquor each month. If the bar failed to do so, it had to pay “short lifting” fines. While this regulation (minimum “lifting” by bars) went much before the time when number of licenses was capped, the two can be seen to be related. When the number of licenses is capped, the state needs to ensure that it gets a certain fixed revenue out of excise licenses and sales. Fixing a minimum sale quantity ensures that licenses are not “wasted” by bars with low sales, and in case they are, the government doesn’t lose out on such sales.

A possible reason that this rather bizarre regulation on minimum sales was lifted is due to it becoming moot thanks to competition. When the number of liquor licenses is limited, the price increases, and thus bars which are selling lower amounts of liquor find it more profitable to cash out on their licenses than continue their business. Thus, bars that continue to have their licenses are those that continue to sell significant quantities, which makes the quotas moot.

Nevertheless, the cap on the number of bars means that the liquor scene in Karnataka is rather bizarre, the point being that there are no “middle class bars”. Here in Barcelona, where I’m currently on holiday, pretty much every restaurant and cafe has an alcohol license (at least beer and wine), and it is possible to have a drink in an “ordinary setting” at a reasonable price. A glass of beer at any of these establishments, for example (small quiet places which are seldom crowded), costs about EUR 1.80 (~Rs. 120 by today’s exchange rate).

In Karnataka, on the other hand, thanks to the limited licensing regime, a bar needs to do a certain minimum amount of business before it is viable. This has led to bars in Karnataka adopt one of two opposing routes. Some play the volume route, setting up an atmosphere where there is quick turnaround of customers (it can be argued that atmosphere is set up to ensure customers don’t stay too long) each of who consumes in significant volumes so that the bar can make significant amount of money despite charging only a small premium on the liqour.

At the other end you have the rather fancy “value players”, who make their margins on rather large markups on the liquor they sell. These are typically fine dining restaurants where people’s primary purpose is eating (rather than drinking) and which have rather low table turnover. A combination of the above two means that volumes are low, but such restaurants more than make up by means of significant markups. These markups are extended to non alcohol items also (these restaurants can afford to charge a premium since all other similar restaurants serving alcohol also charge the same premium, and presence of alcohol is a hygiene factor for such restaurants). Here is an old blog post where I argue why liquor regulations imply high.

So the question is if the government can do away with the bizarre regulations on minimum sales, why can’t they increase the number of liquor licenses? The problem is that it is a classic case of baptists and bootleggers. The baptist case is that by issuing more liquor licenses, it makes things easier for people to drink alcohol and that’s not a good thing for society. And the bootleggers are existing licenseholders, whose licenses will get devalued if their supply increases. I just realised I’ve already done another blog post addressing this topic.

R, Windows, Mac, and Bangalore and Chennai Auto Rickshaws

R on Windows is like a Bangalore auto rickshaw, R on Mac is a Chennai auto rickshaw. Let me explain.

For a long time now I’ve been using R for all my data management and manipulation and analysis and what not. Till two months back I did so on a Windows laptop and a desktop. The laptop had 8 GB RAM and the desktop had 16GB RAM. I would handle large datasets, and sometimes when I would try to do something complicated that required the use of more memory space than the computer had, the process would fail, saying “fail to allocate X GB of memory”. On Windows R would not creep into the hard disk, into virtual memory territory.

In other words it was like a Bangalore auto rickshaw, which plies mostly on meter but refuses to come to areas that are outside the driver’s “zone”. A binary decision. A yes or a no. No concept of price discrimination.

The Mac, which I’ve been using for the last two months, behaves differently. This one has only 8GB of RAM, but I’m able to handle large datasets without ever running out of memory. How is this achieved? By means of using the system’s Virtual Memory. This means the system doesn’t run out of memory, I haven’t received the “can’t allocate memory” error even once on this Mac.

So the catch here is that the virtual memory (despite having a SSD hard disk) is painfully slow, and it takes a much longer time for the program to read and write from the memory than it does with the main memory. This means that processes that need more than 8 GB of RAM (I frequently end up running such queries) execute, but take a really long time to do so.

This is like Chennai auto rickshaws, who never say “no” but make sure they charge a price that will well compensate them for the distance and time and trouble and effort, and a bit more.