Elegant and practical solutions

There are two ways in which you can tie a shoelace – one is the “ordinary method”, where you explicitly make the loops around both ends of the lace before tying together to form a bow. The other is the “elegant method” where you only make one loop explicitly, but tie with such great skill that the bow automatically gets formed.

I have never learnt to tie my shoelaces in the latter manner – I suspect my father didn’t know it either, because of which it wasn’t passed on to me. Metaphorically, however, I like to implement such solutions in other aspects.

Having been educated in mathematics, I’m a sucker for “elegant solutions”. I look down upon brute force solutions, which is why I might sometimes spend half an hour writing a script to accomplish a repetitive task that might have otherwise taken 15 minutes. Over the long run, I believe, this elegance will pay off, in terms of scaling easier.

And I suspect I’m not alone in this love for elegance. If the world were only about efficiency, brute force would prevail. That we appreciate things like poetry and music and art and what not means that there is some preference for elegance. And that extends to business solutions as well.

While going for elegance is a useful heuristic, sometimes it can lead to missing the woods for the trees (or missing the random forests for the decision trees if you may will). For there are situations that simply don’t, or won’t, scale, and where elegance will send you on a wild goose chase while a little fighter work will get the job done.

I got reminded of this sometime last week when my wife asked me for some Excel help in some work she was doing. Now, there was a recent article in WSJ which claimed that the “first rule of Microsoft Excel is that you shouldn’t let people know you’re good at it”. However, having taught a university course on spreadsheet modelling, there is no place to hide for me, and people keep coming to me for Excel help (though it helps I don’t work in an office).

So the problem wasn’t a simple one, and I dug around for about half an hour without a solution in sight. And then my wife happened to casually mention that this was a one-time thing. That she had to solve this problem once but didn’t expect to come across it again, so “a little manual work” won’t hurt.

And the problem was solved in two minutes – a minor variation of the requirement was only one formula away (did you know that the latest versions of Excel for Windows offer a “count distinct” function in pivot tables?). Five minutes of fighter work by the wife after that completely solved the problem.

Most data scientists (now that I’m not one!)  typically work in production environments, where the result of their analysis is expressed in code that is run on a repeated basis. This means that data scientists are typically tuned to finding elegant solutions since any manual intervention means that the code is not production-able and scalable.

This can mean finding complicated workarounds in order to “pull the bow of the shoelaces” in order to avoid that little bit of manual effort at the end, so that the whole thing can be automated. And these habits can extend to the occasional work that is not needed to be repeatable and scalable.

And so you have teams spending an inordinate amount of time finding elegant solutions for problems for which easy but non-scalable “solutions exist”.

Elegance is a hard quality to shake off, even when it only hinders you.

I’ll close with a fairytale – a deer looks at its reflection and admires its beautiful anchors and admonishes its own ugly legs. Lion arrives, the ugly legs help the deer run fast, but the beautiful antlers get stuck in a low tree, and the lion catches up.

 

The Crane-Mongoose Theory of Public Policy

I have several favourite stories from the Panchatantra (which perhaps explains my lack of appreciation of modern children’s fiction). One of them involves a crane and a mongoose. And I think it is a good lesson on when and where to call for regulation, and government or legal intervention.

So the story goes like this. A snake lives at the bottom of the tree where a crane has built its nest. Each time the crane lays eggs, the snake slithers up the tree and devours them. And the crane doesn’t know what to do. Ultimately it receives some “brilliant advice”.

There is a mongoose living somewhere nearby, and the crane lays out a Hansel-and-Gretel like path of fish from the mongoose’s house to the snake’s house. The mongoose duly follows the trail of fish and finishes off the snake. The next day, the mongoose is hungry again, and it climbs up the tree and devours the crane’s eggs.

It is common political discourse nowadays to call for the government’s or court’s intervention to solve what seems to be private problems. The governments and courts are of course happy to oblige – any new source for intervention and rent-seeking are good news for the people involved. And then you get a solution that temporarily solves the problem (slaughtering the snake). And then in the long term, what you get is a bigger problem (mongoose eating the crane’s eggs). The only difference is that in real life it is not just the crane that gets negatively affected – the regulations hurt everyone.

The examples that come to my mind at this point in time are all “local”. Some residents in Indiranagar in Bangalore weren’t happy about the noise from nearby pubs. They asked the government to “do something”. And the government “did something” – it banned the playing of live music in restaurants, killing off what was then a budding industry in Bangalore.

Some other residents somewhere else in Bangalore were unhappy that their neighbours had dogs that barked. They asked the government to do something. The government did something – coming up with an elaborate document to regulate dogs that people can own.

And there are more involved (and dangerous) examples of this as well.

Don’t be like the crane.

Acceptable forms of help

I was reading this note by Kunal Bahl, CEO and co-founder of Snapdeal on the company’s turnaround after the failed acquisition by Flipkart last year. It’s a very interesting note – while I’ve never been a fan of the company (never considered buying from them), this story seems rather interesting, especially given the deep shit it was in a year ago.

What caught my eye is this little note about getting help from a small network of mentors. Bahl writes:

I was able to get the guidance and counsel from some of the most respected and leading business persons in the country. […] In our time of need, it was those who had the least to gain, and most to give, that came to our help. Not with money. But with their wisdom and encouragement. I recall sitting in the room with one of the above persons in August 2017, staring down the barrel with only months of money left in the bank. The gentleman, probably seeing how dire our situation was, picked up the phone and called six of the top business people in the country in quick succession explaining our situation to them – that we were good guys stuck in a bad situation – and requesting them to meet me to see if there were any synergies with their businesses[…]

(emphasis added)

What this got me thinking was about why it’s considered okay to give or take help in the form of intangibles, but not in terms of money. It’s rather common that people help each other out by way of providing advice, making introductions and sometimes just hearing them out. It’s not that common, though, that people help each other out with money.

To take a personal example, if someone asks to talk to me to get some advice, or asks for some connections, it’s very likely that I’ll help them out. On the other hand, if someone were to ask me for money I’ll start seeing them suspiciously.

One quick reason as to why intangibles is okay is that it is sometimes “cheap”. Making introductions doesn’t cost you much as long as you think it’s mutually beneficial for both parties (and in that, it seriously helps if you do double consent introductions – talk to both parties independently before introducing). Advice costs you maybe half an hour or an hour of your time, and if you feel like your time is being wasted, it’s not hard to cut losses. And the value that the recipient gets from this can far exceed the cost incurred by the “giver”.

Another reason is that intangibles are intangible – they’re hard to measure. And by that measure, you don’t rack up some sort of debt. If I take money from you, then what I owe you becomes precisely measurable. And until I repay you, things between us can be awkward. Introductions or advice, on the other hand, keep the value of the “debt” fuzzy, and in most case it gets “written off” any way, permitting the two parties to continue their relationship normally.

Anything else that I might have missed out?

Speaking of yellow

Last night, we needed to distract the daughter from the play-doh she was playing with so that she could have dinner. So I set up a diversionary tactic by feeding her M&Ms while her mother hurriedly put away the play-doh.

Soon we figured we needed a diversionary tactic from the diversionary tactic, for the daughter wanted to continuously eat M&Ms rather than have dinner. I tried being the “bad dad” by just refusing to give her any more M&Ms but that didn’t work. So another diversion was set up where the put on TV, and in that little moment of distraction, I put away the yellow packet of M&Ms behind some boxes in its shelf.

Evidently, it wasn’t enough of a distraction, as the daughter quickly remembered the M&Ms and started asking for it. I told her it’s “gone” (a word she uses to describe my aunt who passed away recently), but she wouldn’t believe it. Soon she demanded to inspect the shelf by herself.

Her mother held her high, and she surveyed all three shelves in the cupboard. I hadn’t done a particularly great job of hiding the M&M packet, but thankfully she didn’t spot the yellow top of the packet from behind the masala box.

Instead, her eyes went up to the top shelf of the same cupboard where there was the only visible yellow thing – a bright yellow packet of coffee powder (from Electric Coffee). She demanded to inspect it.

Both of us told her it was coffee powder, but she simply wouldn’t listen. I opened the packet to make her smell it, and see the brown powder inside (we get our coffee ground at the shop since we don’t have a grinder at home, else it’s likely she might have mistaken a bean for a brown M&M). She still wasn’t convinced.

She put her hand right in and pulled out a tiny fistful of coffee powder, which she proceeded to ingest. Soon enough, she was making funny faces, though to her credit she ate all the coffee. It seems the high was enough to make her forget the M&Ms. And suddenly she started running around well-at-a-faster-rate. Fast enough to go bang her head to the wall a minute later – I suspect the caffeine had begun to act.

By the time she had finished crying and recovering from the head-bang, she was ready to belt curd-rice with lime pickle.

And if you want to ask, she fell asleep an hour later. Unlike us oldies, caffeine doesn’t seem to interfere with her sleep!

PS: The title of this post is a dedication to Sanjeev Naik, for reasons that cannot be described here.

Pertinent Observations Grows Up

Over the weekend, I read Ben Blatt’s Nabokov’s Favourite Word Is Mauve, a simple natural language processing based analysis of hundreds of popular authors and their books. In this, Blatt uses several measures of goodness or badness of writing, and then measures different authors by it.

So he finds, for example, that Danielle Steel opens a lot of her books by talking about the weather, or that Charles Dickens uses a lot of “anaphora” (anyone who remembers the opening of A Tale of Two Cities shouldn’t be surprised by that). He also talks about the use of simple word counts to detect authorship of unknown documents (a separate post will come on that soon).

As someone who has already written a book (albeit nonfiction), I found a lot of this rather interesting, and constantly found myself trying to evaluate myself on the metrics with which Blatt subjected the famous authors to. And one metric that I found especially interesting was the “Flesch-Kincaid grade level“, which is a measure of complexity of language in a work.

It is a fairly simple formula, based on a linear combination of the average number of words per sentence and the average number of syllables per word. The formula goes like this:

Flesch-Kincaid Grade Score

And the result of the formula tells the approximate school grade of a reader who will be able to understand your writing. As you see, it is not a complex formula, and the shorter your sentences and shorter your words (measured in syllables), the simpler your prose is supposed to be.

The simplest works by this metric as mentioned in Blatt’s book are the works of Dr. Seuss, such as The Cat in the Hat or Green Eggs and Spam, on account of the exclusive usage of a small set of words in both books (Dr Seuss wrote the latter as a challenge, not unlike the challenges we would pose each other during “class participation” in business school). These books have a negative grade score, technically indicating that even a nursery kid should be able to read them, but actually meaning they’re simply easy to read.

Since the Flesch Kincaid Grade Score is based on a simple set of parameters (word count, sentence count and syllable count), it was rather simple for me to implement that on the posts from this blog.

I downloaded an XML export of all posts (I took this dump some two or three weeks ago), and then used R, with the Tidytext package to analyse the posts. Word count was most straightforward, using the str_count function in the stringr package (part of the tidyverse). Sentence count was a bit more complicated – there were no ready algorithms. I instead just searched for “sentence enders” (., ?, !, etc. I know the use of . in abbreviations creates problems but I can live with that).

Syllable count was the hardest. Again, there are some packages but it’s incredibly hard to use. Finally after much searching, I came across some code that again approximates this and used it.

Now that the technical stuff is done with, let’s get to the content. This word count, sentence count and syllable count all flow into calculating the Flesch-Kincaid (FK) score, which is the approximate class that one needs to be in to understand the text. Let’s just plot the FK score for all my blog posts (a total of 2341 of them) against time. I’ve added a regression line for good effect.

The trend is pretty clear. Over time, this blog has become more complicated and harder to read. In fact, drawing this graph slightly differently gives another message. This time, instead of a regression line, I’ve drawn a curve showing the trend.

When I started writing in 2004, I was at a 5th standard level. This increased steadily for the first two years (I gained a lot of my steady readership in this time) to get to about 8th standard, and plateaued there for a bit. And then again around 2009-10 there was n increase, as my blog got up to the 10th standard level. It’s pretty much stayed there ever since, apart from a tiny bump up in the end of 2014.

I don’t know if this increase in “complexity” of my blog is a good or a bad thing. On the one hand, it shows growing up. On the other, it’s becoming tougher to read, which has probably coincided with a plateauing (or even a drop) in the readership as well.

Let me know what you think – if you prefer this “grown up style”, or if you want to go back to the more simple writing I started off with.

Taking sides on twitter

Garry Kasparov versus Nassim Nicholas Taleb
Joe Weisenthal versus Balaji Srinivasan

These are two twitter battles that have raged (ok the latter is muted in comparison) on my timeline during the last few days. I’ve been witness to these battles because I follow all of these worthies, who are each interesting for their own reason. But I don’t like these battles, and fights, and I find that apart from quickly scrolling through my timeline, there is no way for me to ignore these battles.

I find all four of these people independently interesting, and so don’t want to unfollow any of them just for the sake of avoiding being witness to these fights. But in due course of time, if any of them were to focus excessively on these fights (which is unlikely to happen) at the cost of other interesting tweets, I’m likely to unfollow.

These episodes, however, have given me an insight into why there is some sort of a political division in twitter following – that people who follow a set of argumentative people with one set of beliefs are unlikely to follow members from another set with the opposite kind of beliefs. This is because if you follow argumentative people from both sides, you end up getting caught in their argument which can contaminate your timeline.

You tolerate it for a while, but then over time you start losing patience. And you realise that the only way of avoiding following these arguments is by unfollowing, or even muting, people from one side of the argument. It is more likely that you unfollow the people whose beliefs agree with less. And you do this a sufficient number of times, and you’ll end up only following people whose beliefs you fully agree with.

And then they say social media is an echo chamber!

Anyway, the moral of the story for me is that I shouldn’t engage in protracted flamewars on twitter, for each time I do, I run the risk of losing followers who might also be following my counterparty in such flame wars.

Branding and positions of strength

I had an invitation to attend a data science networking event today. I had accepted the free pass for option value, but decided today to not exercise the option. Given I was not going to speak at the event, I realised that the value of the conversations at the event for me would be limited.

One of the internet gurus (it might be Naval Ravikant, but I’m unable to locate the source) has this principle that you shouldn’t go to networking events unless you’re speaking. Now, if everyone applied this principle events would look very different, with speakers speaking to one another (like in NED Talks!).

Thinking about it, though, I see clear value in this maxim. Basically when you go to a networking event and speak, you can network from a position of strength, especially after you’ve spoken. This is assuming you’ve done a good job of your speech, of course, but apart from elevating your status as a “speaker”, speaking at the event allows potential counterparties in conversations to have prior information about you before they talk to you.

So there is context in the conversation, and since you know they know something about you, you can speak from a position of strength, and hopefully make a greater impact.

It is not just about speaking and events. For a long time, a lot of my consulting business came from readers of this blog (yes, really!). This was because these people had been reading me, and knew me, and so when I spoke to them, there was already a “prior” on which I could base my sale. Of late, I’ve been putting out a lot of work-related content here and on LinkedIn, and that has sparked several conversations, which I have been able to navigate from a position of strength.

A possibly simpler word to describe this is “branding”. By speaking at an event or putting out content or indulging in other activities that let people know about you and what you do, you are building a brand. And then when the conversation happens, the brand you have thus built puts you in a position of strength which makes the sale far easier than if you didn’t have the brand.

You need to remember that position of strength as I’ve described here is not relative. It is not always necessary for the brand to elevate you to a level higher than the counterparty. All that is necessary is for it to put you at a high enough level that you don’t need to talk from a position of weakness. And if you think about it, cold calling and door to door sales is basically selling from a position of weakness – while it might have worked occasionally (which makes for fantastic stories), it is on the most part not successful.

And in some way, this concept of branding and positions of strength is well correlated to what I recently described as “the secret of my happiness“. By being really good at what you are good at, you are essentially putting yourself in a position of strength, so that people have no choice but to tolerate your inadequacies in other areas. Putting it another way, being really good at what you are good at is another exercise in brand building!

Brand building efforts can sometimes fail. There are times when I have given talks and got few questions – clearly indicating it was a wasted talk (either I didn’t talk well, or the audience didn’t get it). I have put out content that has just sank without a trace or any feedback. The important thing to know is that somewhere it all adds up – that these small efforts in branding can come together at some point in time, and make it work for you.

 

Suckers still exist

Matt Levine’s latest newsletter describes a sucker of a trade:

 

  1. You give Citigroup Inc. $1,000, when Amazon.com’s stock is at $1,339.60.
  2. At the end of each quarter for the next three years, Citi looks at Amazon’s stock price. If it’s at or below $1,339.60, Citi sends you $25 and the trade continues. If it’s above $1,339.60, Citi sends you back your $1,000 and the trade is over.
  3. At the end of the three years, Citi looks at Amazon’s stock price. If it’s above $1,004.70 (75 percent of the initial stock price), then Citi sends you $1,025 and the trade is over. But if it’s below $1,004.70, you eat the full amount of the loss: For instance, if Amazon’s stock price is $803.80 (60 percent of the initial stock price), then you lose 40 percent of your money, and get back only $600. Citi keeps the rest. (You get to keep all the premiums, though.)

Anyone with half a brain should know that this is not a great trade.

For starters, it gives the client (usually a hedge fund or a pension fund or someone who represents rich guys) a small limited upside (of 10% per year for three years), while giving unlimited downside if Amazon lost over 25% in 3 years.

Then, the trade has a “knock out” (gets unwound with Citigroup paying back the client the principal) clause, with the strike price of the knockout being exactly the Amazon share price on the day the contract came into force. And given that Amazon has been on a strong bull run for a while now, it seems like a strange price at which to put a knock out clause. In other words, there is a high probability that the trade gets “knocked out” soon after it comes into existence, with the client having paid up all the transaction costs (3.5% of the principal in fees).

Despite this being such a shitty deal, Levine reports that Citigroup sold $16.3 million worth of these “notes”. While that is not a large amount, it is significant that nearly ten years after the financial crisis, there are still suckers out there, whom clever salespersons in investment banks can con into buying such shitty notes. It seems institutional memory is short (or these clients are located in states in the US where marijuana is legal).

I mean, who even buys structured notes nowadays?

PS: Speaking of suckers, I recently got to know of the existence of a school in Mumbai named “Our Lady of Perpetual Succour“. Splendid.

One axis politics

Historically, political leanings have ben described on two dimensions – economic freedom and social freedom. In the American scenario, the Republican Party has historically been supportive of economic freedom and restrictive of social freedom. The Democratic Party has been liberal on social freedom but illiberal on the economic freedom front.

While other major Western democracies occupying these two opposite quadrants, the other two quadrants have been largely empty. The libertarians occupy the “free on both fronts” quadrant, but nowhere is there a party to represent them – giving people freedom on all fronts means lesser power for the government and no politician wants that. And being restrictive of both kinds of freedom means people won’t vote for you – at least this was the way historically.

Of course things have been different in India. While we did have a series of governments between 1991 and 2004 that were reasonably economically liberal (“liberalisation” happened in this time period), all Indian political parties are required to swear by socialism, and they swear by it in spirit as well. So the difference on the economic freedom front between different Indian parties is marginal (in 2014, many of us thought the BJP might be supportive of economic freedom, given its record in the 1999-2004 period. Instead, it gave us demonetisation).

So in effect, in India we have a one-axis democracy, where parties try to differentiate themselves on one axis, which is the kind of social freedom they allow. Even there, it is not so much of an axis, but different ways in which they control social freedoms.

The BJP doesn’t want you to eat beef. The AAP doesn’t want recorded music in restaurants. The Congress and JDS don’t want live music in restaurants. The BJP puts cow welfare over human welfare. The Congress enacts and supports laws that allow suppression of Muslim women (by Muslim men). Many parties want to ban liquor, despite it having been repeatedly shown that such bans don’t work. No party wants to legalise marijuana, despite our rich tradition in the substance (heck, its scientific name is Cannabis indica). And we all seem to vote based on which of these social freedoms are more precious to us than others – economic freedom is a battle already lost.

In any case, it seems like other countries are also moving towards one axis democracy.  A chart posted on Twitter today describes results from a survey in the US on voters’ attitudes towards social and economic freedoms, and how they voted in the 2016 presidential elections (which Donald Trump famously won).

Source: https://www.voterstudygroup.org/publications/2016-elections/political-divisions-in-2016-and-beyond

A large part of America seems to lie in the left half of the economic freedom spectrum. Yes, the republican voters are still more towards the centre than the democratic voter, but the bigger separation here is on the social rather than the economic dimension. And the Trump administration has been pursuing several policies cutting economic freedoms, such as tearing up trade deals and imposing tariffs.

So it seems like the world is following India in terms of enacting one axis politics – where voters vote more on the social dimension rather than the economic dimension. Then again, I don’t expect this to last – with parties moving left economically, soon you can expect economic freedoms to be crushed to the extent that it becomes advantageous for a party to signal economically right and still get votes.

PS: We don’t need to limit ourselves to two dimensions.  A few years back, Nitin Pai had proposed the Niti Mandala which has three dimensions.

Source: http://acorn.nationalinterest.in/2012/03/03/nitimandala-the-indian-political-spectrum/

Social Capital and Caste

Conventional wisdom is that social capitalin India is low because of our historical caste system. By placing people in a rigid hierarchy, and giving some people privileges over others just because of the families they were born into, the caste system prevented people from cooperating as well as they would in a more equitable society – that is what conventional wisdom says.

However, a point that we cannot miss is that despite the caste system placing a hierarchy on people, people from different castes did regularly cooperate and trade with each other. In fact, with caste being tied to hereditary professions, people had little choice but to regularly interact and trade with people from other castes. And this inevitably created social capital.

Putting it differently, the result of the caste system was an unequal but stable society, and this stability led to reasonably good social capital (history might be biased given it was written by people from certain castes, but we don’t see many instances of caste riots or clashes from over 200 years ago). You can think of it as a stable society with “handicaps”, where some people were privileged over others (in fact, there was a hierarchy of privilege), to the extent that it was okay for some people to abuse others in various ways.

Over the last 150 years or so, the caste system has been (rightly) challenged, and we are seeing various movements towards a more equal society. One side effect of this has been that the (unequal) equilibrium that had existed has been disturbed, leading to caste-based antagonism and a fall in social capital.

We are in the process of moving from one (unequal) equilibrium to another (more equal) equilibrium, but until we get there, existing beliefs and biases will continue to be challenged, which means some sets of people will continue to be suspicious of others, and there will be mistrust and thus low social capital.

Originally posted at Pragati Express