Tackling Impossible Projects

There was one time one of the files used in building a report was corrupted. In most cases this would be an easy fix: e-mail the relevant IT person in charge of this file and get him or her to send the corrected file over. But there was a small problem: we needed this report to be sent out within the next few hours, but this person lived half a globe and multiple time zones away.

So I had to work on a local fix.

The very first thing I had to do was this: to decide that I would work on the fix. I cannot tell you how important this step was because I was this close (holding up thumb and forefinger a centimeter apart) to not trying to fix it at all.

When I first realised the data wasn’t correct, I started immediately thinking about was what exactly the data was (Was it essential to the report? Was it time-sensitive? What information did it convey?) and how I might salvage the situation. I dug through memories of past events trying to figure out if this had happened before and if so what was done then. I figured that this exact situation was new, and that that best I could do was figure out if similar situations had occurred (yes) and see if approaches to those situations could be applied to this one as well (no).

All this time, the thought that I wouldn’t/couldn’t be faulted for failing to provide the numbers on time kept presenting itself to me. It was extremely tempting to just say it couldn’t be done and call it a day (because frankly the fix was, intuitively, “too difficult”). But if there’s one thing I hate it’s giving up before I’d actually had a good go at it.

Which brings me to the very important second thing I did: to convince myself that if I was going to go through with this, I’d sure as hell believe that it was possible to do. Since I was going to go through with trying to fix this damn thing, it wasn’t going to help continuing to think it was impossible, right? (Yup, it’s my version of the four-minute mile.)

So with these two things out of the way I pushed ahead.

In the end, within a couple of hours after planning my route of attack and plowing through a programming fog of war that descended early on (where we’re always just one step away from declaring the exercise more trouble than it was worth), the fix was complete. Virtual celebratory drinks were passed all around, and Asia had another good reporting day. On time. On target. World peace.

A lesson on tackling impossible projects

What I found was that the fix was surprisingly easier than I’d expected. (Granted, everything’s easy on hindsight.) And the hardest part was really taking that first step, telling myself that (as in Seth Godin’s words) I was going to ship today and not tomorrow.

And you know what really stoked my fire on this fix? That I managed to use high school algebra to sort out several equations in my queries (and I thought it had no real world value, silly me).

So the next time you start thinking a project’s impossible: stop, take a deep breath, and think hard about it’s impossibility. Is it really impossible, or merely impossible to do easily? Don’t take the easy way out, because one day there may not be one, and you’d be left unprepared.

Statistics do not always tell the whole story

I’m not sure if you’ve read or heard about the recent unfavourable review of the Tesla Model S by New York Times reporter John Broder, but if you haven’t, you should.

Image of Tesla Model S
The Tesla Model S, similar to the one Broder took on his trip.

Not because of the review itself, which was newsworthy in possibly putting a large dent in the credibility of the Model S as an “everyday car”, but because of the very interesting back-and-forth between Broder and Elon Musk (Tesla Motor’s
CEO), and the use of statistics/numbers to prove a point. And how those numbers fail to show the whole picture.

After the review of Broder’s was published, Musk provided a scathing rebuttal on his blog, going so far as to say that Broder “worked very hard to force our car to stop running”. Filled with logs and statistics he put forth a convincing argument. Broder then responded in his own blog, explaining just as convincingly how some of the facts Musk brought up missed some context.

Two things in particular stood out for me.

First, as an analyst, was how statistics and “facts” were used by Musk to refute Broder’s claims.

I am–was–a strong believer in the saying numbers don’t lie. And when Musk dug up the car’s logs, posting evidence that Broder deliberately set out to jeopardise the car’s performance in his review, I couldn’t help thinking there was no way out for Broder.

For example, Musk had remarked on this blog that Broder “drove in circles for over half a mile in a tiny, 100-space parking lot. When the Model S valiantly refused to die, he eventually plugged it in.” Damning evidence if there was one.

I thought that Musk made plenty of good points, but I also couldn’t help thinking that there was a possibility of the statistics not telling the whole story. Musk was, after all, selecting the logs/numbers he thought would back up his claim the best, and several commenters had brought up the point that he neglected mentioning anything about the battery’s dramatic power-loss when parked overnight.

Second, as a son of parents not particularly keen to experiment when trying out technology they’re not confident of, what Broder had written in his response to Musk’s rebuttal made perfect sense. His actions, though deemed by some commenters as “stupid” (read what he did in the next paragraph in parenthesis) were probably what any person in the context of unfamiliarity might do: rely on the experts (in this case the Tesla representative on the phone with him).

(Broder set out for his destination 61 miles away “even though the car’s range estimator read 32 miles – because, again, I was told that moderate-speed driving would ‘restore’ the battery power lost overnight”.)

On the “driving in circles” comment, Broder made himself quite clear on this point: “I drove around the Milford service plaza in the dark looking for the Supercharger, which is not prominently marked. I was not trying to drain the battery. (It was already on reserve power.) As soon as I found the Supercharger, I plugged the car in.” This claim was backed up by a number of commenters who themselves owned electric cars, saying that it wasn’t uncommon to circle around looking for chargers.

When statistics doesn’t tell the whole story

This reminded me of how businesses sometimes use statistics to measure employee performance, and how it might sometimes fail. Don’t get me wrong. I believe in that practice: statistics helps add an objective viewpoint to an otherwise very subjective activity. The problem is when statistics is taken at face value, with the context behind the numbers ignored, even when it’d have changed the story completely.

When we see employees “circling a parking lot” seemingly looking to jeopardise the company’s performance (e.g. not hitting budget or unproductive), we miss the bigger picture: that the superchargers aren’t prominent enough. So, employees are unproductive. Is it really their fault or is the support lacking, or is it something else?

If these “circling” employees are fired because of their poor performance, employees hired to take over these “poor performers” who come in are still going to be “circling” the parking lot because the root cause wasn’t found. And that’s not an entirely smart thing to do.

Predictive analytics in layman’s terms

I’m going to be talking a little about predictive analytics today, to give you a rough idea of what it is (and isn’t).

You might have read in the news before about things like computers and algorithms churning out predictions on what might happen next, in industries as diverse as the financial markets to soccer betting.

You might have read how accurate (or inaccurate, as the case may be) they were, and how “analytics” (or more accurately, predictive analytics) is changing the nature of information. Analytics used to simply describe what happened (see “descriptive statistics“), but now they’re almost just as often used to predict what’s going to happen (“predictive analytics“).

Perhaps you had in your mind a vision of data scientists in lab coats peering into a computer screen like a crystal ball, with the crystal ball telling them what is or is not going to happen in the future. If you did, then get a cloth and prepare to wipe that image out of your head, because other than the computer screen nothing else is true.

Predictive analytics isn’t rocket science. Not always, anyway.

The ingredients of predictive analytics

The ingredients that go into predictive analytics are quite straightforward. In most cases, what you’ll have is some historical data and a predictive model.

Historical data

The historical data is often split into two: one for building the predictive model, and the other for testing it. For example, suppose I have 100 days of sales history (my “historical data”). For the sake of simplicity, let’s assume my sales history contains just two pieces of information: number of visits to my website, and the number of units of widgets sold. I would split this 100 days of sales history randomly into two separate groups of sales history, one with, say, 70 records for building the model, and the remaining 30 for testing it.

Using the 70 records, I build a model says that for every 1000 visitors, I’d sell approximately 10.3 units of my product. This is my “predictive model”. So if I had 2000 visitors, I’d sell approximately 20.6 (10.3 x 2) units; and if I had 3000 visitors I’d sell 10.3 x 3 or 30.9 units and so on.

In order to test my data, I’d run this model on the 30 days of sales history I had put aside. So for each day of sales history, I’d use my formula of 10.3 units sold per 1000 visitors and compare that result against the actual sales results I had.

If I found that the model’s predicted results and what actually happened were very different, I’d know that the model needed tweaking and wasn’t suitable for real-world use (it’s a “bad fit”). On the other hand, if I found that the predicted and actual results were close, then I’d be happy to assume the model was correct and test it on current, ongoing data to see how it worked out.

You may be wondering why we don’t just use the data we built the model on to test the model. It is because we want to make sure that the model we built is too specific to the data used to build it (i.e. the predictive model predicts with great accuracy the data it was built on, but not anything else). Testing the predictive model against the data that helped to build it would be inherently biased.

Think of it like the baby with a face only a mother could love, with the predictive model the baby and the dataset the mother. Just like you wouldn’t ask the baby’s mom to judge a baby contest her child was participating in, you wouldn’t want to test a predictive model against the data it was built from.

Predictive Model

Now that we’ve settled one half of the predictive analytics equation (i.e. the data portion), let’s get to the predictive model. You may be wondering what a predictive model is exactly. Or you may have guessed it already based on what was written above. Whatever the case, a predictive model is simply is a set of rules, formulas, or algorithms: given input [A], what will be the output be?

This predictive model is something like a map. It aims to predict what will happen (the output) given a value (the input).

Let’s run with the map anology for a bit. Let’s say that I have in my hands the perfect map (i.e. it models the real world perfectly). Using this map, I can predict that starting from where I am right now, if I walked straight for 100 meters, turned 90 degrees to my right, and walked straight for another 50 meters (the input), I should arrive at the mall (the output). And if I tested the map and actually followed its directions, I’d find the “prediction” to be right and I’d be at the mall.

But if I had in my hands an inferior map (i.e. a lousy representation of the real world), if I “asked” it what would happen if I followed the exact same directions as above (100 metres straight, turn 90 degress right, 50 meters straight), it wouldn’t say the mall. And because it doesn’t say the mall, which so happens to be where I want to go, I “ask” the map what directions I needed to take if I wanted to get to the mall. The inferior map would provide some directions, but because it’s so different from the real world, even if I followed these directions to the most exact millimeter I wouldn’t get there.

So the prefect predictive model will predict things to happen in the real world exactly as they will happen, given a set of inputs.

In a nutshell, that’s just what predictive analytics is: an input, a predictive model, and an output (the prediction). Though what I’ve written here is grossly simplified, it helps to have a concept in your head when you hear people talking about algorithms or computers predicting such-and-such.

The problem with using analytics to predict team performance

Read this interesting (and insightful+funny) article by McAfee on baseball and analytics (with reference to the enjoyable baseball movie Moneyball). Although it’s written about baseball, it’s really about sports and analytics, and how analytics has changed the way we made decisions. (Disclaimer: I don’t follow baseball; don’t play it; don’t know much about it.)

Moneyball poster
Analytics may predict individual performance. But the team’s?

The funny thing is, even though I’m certainly a believer in the power of analytics and how it can help businesses (including sports teams), I’m still not entirely sold on the concept that it’s the only thing that matters. Even while watching Moneyball, which I enjoyed, there was the very human intuition (maybe wrong, maybe right) that kept on telling me (shouting! in fact) that statistics weren’t–couldn’t be–the whole story.

I couldn’t help but agree with some of the statistical non-believers in the movie (portrayed like they lived in the stone-age) that building a team based on statistics alone, without due consideration for personalities or dressing-room morale, would work.

I mean, should know. I’m a veteran Championship Manager (and its latest variant Football Manager) fan, and if there’s one thing I’ve learned is that one unhappy player creates another. And with enough unhappy players, team morale takes a big hit and performance suffers. Multiple star performers on a team doesn’t always guarantee a star performance.

Bringing in players with abusive personalities, no matter how their performance on the pitch, can be a disruptive influence, right? (I’m just guessing here as I’ve no real-world experience.)The players with the abusive personalities may continue to play well. But will the other players continue to play at the standards they used to play at? And can analytics take these off-the-pitch, indirect influences, into account as well?

(By the way, I’m pretty sure I was deceived by Moneyball. It was sort of a feel-good movie after all. I just do not believe that personalities were never taken into consideration.)

How to make better decisions using Opportunity Cost

The cynic knows the price of everything and the value of nothing.
— Oscar Wilde

Opportunity cost can help you make better decisions because it helps put your decisions in context. Costs and benefits are framed in terms of what is most important to you at the time of the decision.

Every time we make a decision involving mutually exclusive alternatives, we will always be subject to this thing called “opportunity cost“.

Opportunity cost is the cost you pay for choosing one alternative over the others. But this cost isn’t “cost” in the regular sense of the word. It is the benefits of the next-best alternative that you have given up.

I hope you’re still with me here. But even if you’re not, don’t worry. I’ll give more examples below.

The concept of opportunity cost illustrated in under 60 words

You are given a choice between two pieces of fruit: an apple and an orange. You can choose only one. By choosing one, you give up the other. If you choose the apple, your opportunity cost would be the enjoyment of the orange. And if you choose the orange, your opportunity would be the enjoyment of apple.

The concept’s that simple. You give up the enjoyment of the orange when you choose the apple, so you “pay” for the apple by giving up the opportunity to enjoy the orange. So far so good? Good.

Let’s shake things up a bit.

Opportunity cost can be for indirect costs too

The scenario. Say a man, we’ll call him Man A, comes up to you and demands from you a glass of orange juice. If you don’t give in to his demands within the next five minutes, he’ll spill permanent ink all over the shirt you’re wearing, which just so happens to be your favourite. Unfortunately for you, you don’t have any orange juice or oranges on hand.

Suddenly another man, Man B, whom you had once given a banana, comes up to you and serendipitously offers to return the fruity favour. Not knowing what type of fruit you like, he offers you a choice of two fruits, an apple and an orange, from which you can take one. You grab the orange, thank him, and quickly make some orange juice for Man A, saving your favourite shirt from certain doom.

Let’s say that in normal times you would pay $1 for an apple and only $0.80 for an orange. Without Man A, the guy who threatened to spill ink on you, you’d have most definitely gone for the apple because it’d have been a better value. But because you knew of what would happen if you didn’t get the orange juice to Man A in time, you opted for the orange.

Opportunity cost is context-sensitive. You gave up the opportunity for an additional $0.20 in value (the difference between the apple and the orange) for the opportunity to save your shirt. Very smart.

Money isn’t everything: Applying opportunity costs to decisions not involving money

Thinking about the opportunity costs also helps us to think about value beyond price (as illustrated by the example above). And sometimes when price isn’t a factor at all, this can be especially important.

The scenario. Imagine facing the decision of painting a wall in your room green or blue. The paint of both colors cost the same, and both look equally good. So you consider flipping a coin and letting chance determine the colour.

But because you’ve learned about opportunity cost, you ask yourself, If I paint my wall blue, what do I give up? And if I paint my wall green, what do I give up?

After giving it a little think, you realise that by painting your wall blue, you’d probably not be able to hang your favourite poster because the colours wouldn’t match. Some of the furniture you had previously picked out would also have to be given up because they didn’t match the blue colour scheme either.

A green wall, on the other hand, would suit the poster and the furniture you picked out just fine. With your knowledge of what you had to give up if you chose the blue paint, you decide to go for the green.

Remember, if cost was the only consideration, you might not have gone for green. If colour preference was the only other consideration, you still might not have gone for green either. It was only after you considered everything in context, figuring out what had to be sacrificed (the poster and the furniture you had picked out), that you could make an informed decision.

Score one for opportunity cost.

Opportunity cost and time

Opportunity cost can also be applicable to time. If you’re stuck doing activity A, chances are you won’t be able to do activity B at the same time.

The scenario. Suppose you’ve just learned how to do your taxes. You estimate that it will take up about two hours of your time if you did it yourself.

Your cousin, who happens to love doing taxes, offers to do it for you for $50, with a free tub of ice-cream (she’s dropping by the supermarket and there’s a two-for-one special).

If you rejected your cousin’s offer, you’d save yourself $50. But it’d cost you two hours of your time doing whatever you wanted, the actual work of doing your taxes, and a tub of ice-cream.

If you took your cousin’s offer, apart from getting your taxes done for you, you’d a free tub of ice-cream. Of course, you’d have to pay her $50 — that’s the cost.

Depending on how much you valued your time, and how much you valued money, I’d say it’s a tough call. If you felt that an hour of your time was worth only a dollar (and two hours of your time being worth two dollars), it would probably make sense for you to do your taxes if you felt neutral about it (i.e. you didn’t hate doing it).

If you felt that an hour of your time was worth $50 on the other hand, letting your cousin do your taxes would probably make pretty good sense, since you’d essentially be getting back $100 worth of time for an expense of $50.

But we’re cold rational beings, and “feelings” of how much our time is worth just doesn’t cut it. So how do we find out how much our time is really worth? Again, here comes opportunity cost to the rescue.

Using opportunity cost to find the monetary value of your time

The scenario. Suppose you earn on average $25 per hour doing freelance work. Let’s say you’ve got more than enough jobs to go around, and that any free time you have could be used to your work. If you didn’t have to do your taxes, you’d be working on your freelance gigs, earning $25 per hour.

The estimated monetary value of an hour of your time would then be $25, which is the amount you’d earn if you had put that hour to work.

So, carrying on from the previous example, if you had given up your cousin’s offer you’d save yourself $50 but be giving up $50 in lost paid work (that’s $25 x 2 hours) and a tub of ice-cream. If you do the math that’s a negative return.

But if you took up your cousin’s offer, assuming you used those two hours you saved to work, you’d break-even and get a free tub of ice-cream.

Everything else being equal, there’s no reason why you shouldn’t be taking up your cousin’s offer.

Think about all your decisions using opportunity costs. And before making a decision, ask yourself these questions:

  • If I choose alternative A instead of alternative B, what am I giving up?
    • Now that I know what I’m giving up, what are the consequences of giving that up?
  • Are there any hidden benefits or costs I’m not seeing? Anything in terms of:
    • Time;
    • Energy;
    • Money; or perhaps
    • Intangibles?

With practice, thinking in terms of opportunity costs and benefits forgone or sacrificed will come naturally to you. And you’ll start looking not at the price of things, but the value of everything.