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.

On apps tracking you and turning you into “lab rats”

Tech2, a division of FirstPost, reports that “Facebook could be tracking all rainbow profile pictures“. In what I think is a nonsensical first paragraph, the report says:

Facebook’s News Feed experiment received a huge blow from its social media networkers. With the new rainbow coloured profile picture that celebrates equality of marriage turned us into ‘lab rats’ again? Facebook is probably tracking all those who are using its new tool to change the profile picture, believes The Atlantic.

I’m surprised things like this still makes news. It is a feature (not a bug) of any good organisation that it learns from its user interactions and user behaviour, and hence tracking how users respond to certain kinds of news or updates is a fundamental part of how Facebook should behave.

And Facebook is a company that constantly improves and updates the algorithm it uses in order to decide what updates to show whom. And to do that, it needs to maintain data on who liked what, commented on what, and turned off what kind of updates. Collecting and maintaining and analysing such data is a fundamental, and critical, part of Facebook’s operations, and expecting them not to do so is downright silly (and it would be a downright silly act on part of the management if they stop experimenting or collecting data).

Whenever you sign on to an app or a service, you need to take it as a given that the app is collecting data and information from you. And that if you are not comfortable with this kind of data capture, you are better off not using the app. Of course, network effects mean that it is not that easy to live like you did in “the world until yesterday”.

This seems like yet another case of Radically Networked Outrage by outragers not having enough things to outrage about.

Testing the counterfactual: footballers eating pizza edition

Five German under-21 footballers, including Liverpool midfielder Emre Çan, went out for pizza before their U-21 European Championship semifinal against Portugal, in which they got walloped 5-0.

Following the wallop, these players have been pilloried for going out before an important knockout game, for not having taken it seriously enough.

To understand whether people are right or not in pillorying these players, and whether the players were wrong in going out for pizza before a game, we need to test the counterfactual (we had done this here once before with Moeen Ali’s wristbands).

What if Germany had won the game against Portugal? Had they won it, would people have still noticed that these players were out on the eve  of the game (it was public information. One of them posted it to Instagram) ? Would players have still been accused of not taking the game seriously enough?

Note that I’m not defending the German players here. I’m only questioning the timing of the attack – on the back of defeat, which to me seems to be a case of correlation (players go out for pizza; lose game) being mistaken for causation (pizza caused loss, approximately).

Reverse auction platforms

Before my recent trip to Indonesia, I used this website called Cash Kumar to buy my foreign exchange. It was rather simple to use. I posted my location and my requirement for foreign exchange. I had to provide my phone number (and verify it by entering an SMS code; I think this was to make sure only genuine buyers asked for a quote) and then a message went out to all foreign exchange dealers in this part of town, and a few of them responded to my request with quotes.

One of them was significantly cheaper than the other, so I chose him, and CashKumar connected us up. This dealer sent the foreign exchange home. It was an incredibly smooth process.

This is one example of a platform that conducts “reverse auctions”, where a customer states his preferences and you have providers who bid (in a competitive fashion) to provide the said product or service. This results in significant ease-of-use by the customers (though not for service providers since they need to have someone monitoring the requests and bidding for them).

There are several other websites that follow this model. TaxiForSure used to operate like this (I haven’t used it in a while so not sure if it still does). Your request would be broadcast to all taxis around and if one of them accepted it, a match would be made. The difference there was there was no bidding, just matching.

Then there is this AirBnB clone called TravelMob where you can post your requirements (rather than selecting an existing posting), and providers will start responding to that.

One of the “hot” sectors currently in India is hyperlocal delivery, where you request for a product, which a provider procures and delivers for you. In this context, I was thinking of reverse auctions for grocery. You upload your shopping list which goes to nearby grocers (with infrastructure to deliver to you). Since it’s all commodities, the platform can solve some kind of a set covering problem to determine which grocer has to sell you what for you to get the goods at the cheapest rate (after accounting for transaction costs). And in the next couple of hours, more than one delivery can come in to deliver the goods, which you’ve paid for on the platform!

And this multiple delivery thing reminds me of the time when I was doing my MBA (a decade ago), when Dell’s supply chain was widely hailed in Operations Management classes. And the beauty of that supply chain was apparently that once you specified your requirements, the Dell supply chain would get to work and within the next few days different components of the computer would land up at your door!

Cake cutting, Dutch auctions and chit funds

Last night at what started off as high tea but ended up as dinner (for me, at least), Baada and I shared a cake. The cake was delivered to our table along with a (rather sharp) knife. I used the knife to cut  the cake into two, and Baada chose one of the two pieces (inexplicably he chose the smaller one). That way, we had achieved the most efficient method of splitting a piece of cake between two people.

It has been an interesting mathematical problem as to how to split a piece of cake between three people, since the above algorithm doesn’t work. The problem has been solved, but is rather complicated with several cases, involving one person cutting a piece, the second person trimming it and offering it to the third, followed by further complications. I won’t bother describing it further here. And then you have the problem of extending the solution to N people sharing a piece of cake.

But then, there is an elegant solution, after all, which I found in Alex Bellos‘s excellent book Alex Through the Looking Glass a couple of days back. As Bellos describes,

One ingenious method invented in the 1960s, which can be used for any number of people, concerns a moving knife. The knife is positioned at the side of the cake and then moves very slowly across it. When someone shouts ‘STOP!’ the knife slices at that position. The person who shouted out receives the slice. The knife then continues for the remaining participants.

It is not hard to see how this works (it assumes that the players, unlike Baada last night, want the largest possible piece of cake while being fair). If you call too early, you end up with a smaller piece of cake than you’re entitled to, and so you wait. You call too late, and someone has already called for it. So with every player playing the optimal strategy, this moving knife strategy results in each person getting their fair share.

While reading this cake-cutting strategy, I got reminded of the Dutch auction. In such an auction, the house starts with a very high price, which drops slowly (represented by a clock, usually). And as the price drops, when one of the buyers is willing to pay the price at that moment, they bid for it, and the object gets sold at that price. While it is a “first price auction” and buyers may not disclose their true willingness to pay (in the hope of getting the item for a lower price), the advantage is that it’s quick, and hence used for auctioning things such as flowers.

It works the same way as the cake-cutting algorithm in that if there is a well-defined value for the object being auctioned (this is rarely the case in practice), it makes sense to bid exactly at the point when the price equals this well-defined value.

This method of cutting cakes and auctioning flowers is also similar to how chit funds work in India. In a chit fund, you have N people who invest money into a pot at N different points in time. Each time, the money thus collected is auctioned to the person who needs it the most, and the price of the auction is determined by the amount that the person is willing to “let go” of the maximum amount. This amount that is thus let go of is distributed to the other participants (with the house taking a commission).

This is exactly similar to the cake cutting case. Think about it!

So it is very interesting that a fundamental feature of Indian homegrown finance, the chit fund, draws from important concepts in maths and game theory. We’re truly great!

 

Ramzan walking in Jakarta

Ever since I stopped being vegetarian in 2011, I’ve started indulging in the so-called “Ramzan walks”. The concept is as it states – basically a bunch of you go to this Muslim dominated area where special stalls are set up so that people breaking the fast can indulge. Food at such stalls is generally of a very high quality, so you have a large number of non-fasters, which includes a large number of non-Muslims also indulging.

20150624070956

I somehow missed going on one such last year, but have done so in 2011 and 2012 (in Bangalore, in Frazer Town) and 2013 in Mumbai (Mohammed Ali Road), and generally enjoyed them.

And this time was going to be different, and special, since this is the first time ever I’m in a Muslim-majority country during Ramzan. Though I’m basically stuck in this hotel with access to little else but two adjacent malls, I got lucky in that one of these two malls decided to have a food festival to celebrate Ramzan. I wasn’t able to go the last two days since I was meeting people for dinner (one of the said dinner counterparties was vegetarian and the other(s) demanded a more formal setting), but made amends today.

So the open courtyard of this mall called La Piazza (in Kelapa Gading, North Jakarta) has a large number of stalls set up. You have these cash counters where you pay up and get a prepaid smart card. Once this is obtained you can walk up to any counter and buy food from there upon swiping the said card. An excellent and efficient system to ensure fast processing, keep track of revenues (from the point of view of the organisers) and offer a hassle-free experience for customers.

The big challenge, of course, was the lack of knowledge of the language. While Bahasa uses the Roman script (because of which you are able to “read” stuff), almost no one here speaks any English, so trying to figure out what was what, and what to eat was a huge challenge.

We started with the safe option of the Chicken Satay (I had figured out through Rosetta stoning over the last few days that Ayam is Chicken), which is something we were already aware of. It was absolutely excellent. Next we decided to get a “rice item”. I saw someone at the adjacent table eating something and decided to hunt for that specific thing. I finally found it – “Nasi Bebek Madura” (Nasi is rice; Bebek is duck and Madura is an island off Java). It was extremely spicy but the leftover Satay sauce tempered matters.

We followed this up with a meat-based “kaDubu” equivalent, which was excellent once again, and rounded things off with a local dessert (a lot of random things poured over crushed ice), which was quite nice, too.

This food festival goes on for another week, so if you’re going to be near Kelapa Gading, you should surely attend. The organisation is top-notch. I already mentioned about the simplified payment dynamics. Apart from this, sufficient tables have been set up (both sitting and standing types) all over the place, and there are people cleaning the tables and floors at regular intervals. The variety in food is astounding and just the atmosphere itself is something worth taking in!

20150624070956-2

Now I’m jealous of the wife since she has an opportunity to continue experiencing this for a few days more!

Genesis, the Nile and the Nifty

So I’ve written on the financial markets for Mint. This is not part of my usual mandate – which is to write data/quant stories related to politics and the economy and suchlike, I believe this is very different from the kind of markets pieces Mint normally writes.

For starters, I see that there is very little “quant” stuff in mainstream financial reporting. You have tonnes of writing on “fundamentals” (“Company A got this new deal so expect their stock price to increase” or “Company B has regulatory trouble, so short their stock” level) and tonnes on “technicals” (“the nifty will find resistance at 7891″ and “we are seeing a head-and-shoulders market (sponsored by P&G)” type), but none on quant.

In fact, if you were to learn finance by reading the newspapers (admittedly a stupid thing to do), you wouldn’t know of how bankers work, of the models they use, of random walks, and of the Black-Scholes-Merton equation. You would think of finance as a rather boring accounting-related fundamentals or voodoo technical stuff. All the cool quant stuff will be lost to you.

So in my attempt to remedy that, I’ve gone all the way and introduced readers of Mint to Fractional Brownian Motion. No, really. I tell a story from Genesis (I actually looked up and read this chapter from the Old Testament so that I could quote it properly), and then relate it to the flooding of the Nile, and that to the work of hydrologist Harold Edwin Hurst, and how that can help us understand the markets. An extract:

Hurst was to remain in Egypt and be associated with the Nile for 62 years (the Egyptian government retained his services after the country’s independence). Looking through 847 years of Nile overflow data (existence of this data tells us much about the farsightedness of the Mameluke and Ottoman rulers of Egypt), Hurst managed to crack the puzzle. The model he built was one of long-range dependence. It is a model that has far-reaching effects, most importantly in the financial markets.
And another:
Turning this around, analysing the rescaled range of a time series as a function of number of time periods will tell us about its long-range dependence. All we need to do is to find the exponent of N, according to which the rescaled range grows. If this exponent is half (in which case the rescaled range grows with the square root of N), we have a regular random walk (or Brownian motion). If the exponent is greater than half, we have positive long-range time dependence, and the value of the exponent tells us the degree of such dependence. Similarly, if the exponent is less than half, we have negative long-range time dependence, which is known as fraction Brownian motion.
Go read the whole thing! And while you’re at it, pick up Benoit Mandelbrot’s The (Mis)Behaviour of Markets and read that, too. It’s a fantastic book on financial markets, and while it has been written by a mathematician, contains no math. And it’s absolutely fascinating stuff. Oh, I’ve read that book twice. And refer to it quite often.