Monday, February 28, 2011

85% of Statistics Are Made Up On The Spot

I had a good chuckle the other day when I was caught by an example of numerical illiteracy on the part of at least two people: an author and an editor. I had to share.

I was flying with Air Asia from Banda Aceh, Indonesia to Kuala Lumpur, Malaysia. The in flight magazine isn't exactly high production value, as the airline is all about saving. Consider Air Asia to be the Ryan Air of the East. Anyways, here's the tasty treat now:

I can take no issue with the first section on young billionaires as it was actually quite interesting. In the second section, I am entertained by the translation of $122.1k GDP per capita to an average income of about $120,000 per year. Taking the crown though, was the gem at the bottom.

"72% of the 14.5 million population in Mali, Western Africa, earn about $0.003 a day with the average worker's salary of only US$1,500 per year!" Now what is that supposed to mean?

Before you reach for your calculator I can tell you that $0.003/day = $1.10/year.
Also I can tell you that 72% of 14.5 million = 10.44 million.
And that (10.44 million people * $1.10 per person per year ) / $1,500 per worker per year = 7656 workers.
And that 7656/10.44 million = 0.07% employment.

Curiously I can't quite determine what I think they were going for. Anything I try to explain the numbers I see gets destroyed anyway by the strange "72% of 14.5 million". According to Wikipedia, only 43.51 million out of the 81.76 million people in Germany are employed. I suppose I could say that 53% of Germans earn about $0 per day. By adding a dash of real workers I could make that figure $0.003.

Please comment and speculate.

Sunday, February 27, 2011

Faking It On Your Wedding Day

Earlier this month we wrote about our love of podcasts and just last week I was listening to Japan: A Friend In Need from the BBC Documentaries Archive. Here I was in the month of love, listening to a podcast on the subject and I found math in an unexpected place.

The documentary is about an agency in Japan that supplies fake people, or actors I suppose. In particular, this agency will supply people to fill out your side of a wedding. In the given example, we met a young man whose parents were deceased and his siblings were astranged, such that he only had two friends to attend his wedding. So as to keep up appearances, unbeknownest to the bride, he hired parents, friends and relatives. All told, 30 people at his wedding were fake, costing him something like £3,000, equal to his recent redundancy compensation.

The agency claims never to have been caught, and they say that they "research their assignments assiduously", but it got me wondering just how long you could operate such a service without getting caught. How many weddings could you do before a repeat guest noticed that they had seen one of your actors at a wedding before?

The first wedding is simple, and guaranteed to go off without a hitch, but what about the second? Suppose every wedding has on average 30 guests from each family. In the second wedding we need all 30 people to not be from the 30 in the previous wedding. Still pretty easy in a country of 127 million. But what about the 30th wedding when there are 900 previous guests out there in the population? Things are still looking pretty good, but the probabilities are starting to pile up in a similar way to the phenomenon that means that in a group of 23 people there's a 50% chance that two will have the same birthday.

So given a constant wedding size of 60, 30 real and 30 fake, what is the probability that this is the wedding that breaks us? This is the same as the probability that one or more of today's guests attended a previous wedding. This is the same as one minus the probability that none of today's guests attended a previous wedding. For wedding n and a population p:
Assuming 127 million people in Japan...
  • For wedding 1, it's a sure bet as nobody has attended a previous wedding.
  • For wedding 2, we face only a 0.0011% chance of getting caught.
  • Even for wedding 100 our risk is only a 0.11% chance. No problem!
But wait, the above probabilities are conditional probabilites. Our chance of getting caught at wedding 100 given that we got to wedding 99 is 0.11%. What is our chance of getting to wedding 99? This is the the probability that we didn't get caught in one or more of the previous weddings, the probability of a perfect record. Mathematically our chance of getting to and past wedding n is:
  • For wedding 1, it's a sure bet.
  • For wedding 2, it's 99.99%
  • For wedding 100, it's 94.58%.
  • For wedding 500, it's 24.57%.
Even though by the time we get to wedding 500, ony 15,000 people in Japan have been to weddings with our staff, we would be lucky to have made it that far.

If we started this agency today, on average how long can we expect to go before we get caught? Now I'm not going to bother expressing that mathematically, but hacking at it with Excel numerically, I can tell you that it comes to roughly 374. If we were to start such an agency today under such conditions and such assumptions, we would on average expect to do 374 weddings before getting caught.

So I think the moral of the story is, if you're looking to hire fake people for your wedding, you're doing alright, but if you're looking to run a business doing it, you might want to reconsider. Then again, if we're looking for morals in this story, honesty might come first.

Monday, February 7, 2011

I heart smartphones and podcast favourites

I heart smartphones. It is the symbol of the new world, where the world is at your finger tips, and, in your pocket! There is so much information out there, digesting it is a big quest. I'd love to have the time to sit down and browse the net for a couple hours every day to catch up on all the news and events, but now I can do all this while on the move.



I am an owner of an HTC Hero on Android. It is the only digital device I carry in my hand bag (other than my obligatory work phone). Living in a busy city like London means I spend a fair amount of time in transit. If you are a Google fan like me, then Google Reader and Google Listen would be your good friends. My favourite activity during transit when I'm not walking about, is to catch up on the news and my favourite blogs through the RSS reader. My favourite activity during transit when I am walking about, is to plug into one of the following podcasts, which keeps me informed and entertained. If this is not optimising your time, then I don't know what would. I guess the next step is to jog to work while listening to podcasts: information downloading and calorie offloading all at once!

  • LSE lecture and events: London School of Economist half hour to hour long lectures or guest speakers plus Q&A session (frequent publishing of events)

  • The Economist: I like the magazine, but there is so much content to digest. The podcasts do a great job summarising the highlights (weekly publishing or more frequent ones available too)

  • NPR News: short bursts of news that keeps me informed of the North American highlights (hourly publishing)

  • Science of Better: Operations Research podcasts/interviews by INFORMS (monthly publishing)

  • More or Less: BBC radio programme making sense or debunking the numbers behind the news

  • Freakonomics: spin off by the authors of the ever so popular Freakonomics book/movie/blog/etc.

What are some of your favourite podcasts?


Aside from being my RSS reader and podcast player, my smartphone is also my:
- phone (first and foremost)
- email
- calendar
- access to the internet
- Skype to call anyone around the world
- instant messaging to keep in touch with friends
- handy document storage
- camera / video cam
- GPS and compass
- maps (offline maps too)
- ebook reader
- notebook (takes my hand scribbling too)
- news reader
- scanner
- games when I'm bored waiting in a queue somewhere
- MP3 player
- all the other things that come with a phone (alarm clock, calculator, voice recorder, etc.)
- and thousands of other applications available for download (often for free) that keep my life organised and what not

Saturday, December 11, 2010

Excellent Data Visualisation - Mortality Statistics Meets Modern Video Technology

Exciting statistics on visual display on BBC4. It indeed is an exciting, visually pleasing and modern video. The presenter, Hans Rosling, a statistician and a guru of data animation, makes numbers look matrix-cool! I thought I was watching a 4-minute magic show. Savour in the power of great data visualisation. Watch the life expectancy and wealth progression of 200 countries in 200 years in 4 minutes.

Monday, November 8, 2010

Smart Systems and Competent Systems

It amazes me how companies won't do the most basic things with their data. About once a quarter the company that rents us our flat solicits us by mail to sell the place. I just recycled a letter from our current broadband provider encouraging us to switch to them as they have better reliability and lower rates than the competition.

Surely there should be a database out there where a simple join between a residential addresses table and a current customers table would result in a mailing list that does not include me. I'm not sure what offends me more, the excess waste this represents not just in felled trees, but in the entire supply chain that delivers me this mail, or the simple incompetence that it represents.

The Economist has an interesting special report this week on Smart Systems. This report portrays a future where the rapidly progressing sensor, wireless communication and power/battery technologies converge to deliver endless data enabling us to analyse and optimise everything. Power grids, water works, and even cows are candidates for this new age of analytics. They could be exciting times for Operations Researcher practitioners. Early benefits will probably come from simple applications and may resemble the traditional benefits from IT and access to information. As a second level, Operations Research will be able to do more sophisticated things with the data, but when I see the examples I mentioned above, it can be possible to lose faith.

Saturday, October 30, 2010

Young OR Conference April 2011 - Consultancy Stream

The OR Society is hosting the biennial Young OR conference in the University of Nottingham, United Kingdom, on 5-7 April 2011. I am organising the Consultancy stream, and I am looking for speakers, presenters and of course audience. If you are disregarding the conference because of the word 'young', think again, because the definition of 'young' in this context is <= 10 years in the field of OR. You can find more information for presenters here. Essentially, this is what you need to do:
  • a 200 word abstract for the conference programme
  • a presentation of max 20 minutes


I described the stream as follows:

The consultancy stream aims to attract speakers and audience interested in sharing their experiences in the practical application of Operational Research in a client-consultant setting. The consultant can be internal or external to an organisation. The problem at hand can be simple or complex, technically or organisationally.

The challenges we face as OR consultants are very similar no matter the industry, the organisation or the problem at hand. There are definite gaps between practical application and academic research in OR, but it is still one of the most rewarding jobs. The recommended format would be a case study presentation covering the entire cycle of the project where possible, but presentation creativity is absolutely encouraged.

  • How did the problem find you or how did you find the problem? i.e. How was it sold?
  • Steps taken to establish your course of action
  • OR and non-OR techniques and methodologies used to structure and solve the problem
  • How were your findings and recommendations communicated to the stakeholders and decision makers in an effective way?
  • How did the client take your recommendations? Did they implement?
  • Finally, what do you enjoy most about your job?

Most of all, have fun and meet some fellow Operational Research practitioners.


Please pass on the message. Better yet, please drop me a line to present! As you can see, the stream description is very wide, encompassing all real life applications of OR. You don't have to have 'consultant' in your title, neither does your company or organisation. Come and share your experience and the fun (or pain?) of applying Operational Research in anything from ordinary day to day life to extraordinary situations of, for instance, life and death and taxes. How have you helped with better and more informed decision making?

Wednesday, October 13, 2010

Oyster Card Optimisation

Transportation is an industry where a lot of Operations Research is practiced. In the following article I would like to share an example of optimisation that I have noticed in the fare pricing system on the London Underground.

Public transportation in London, England has a convenient and efficient means of collecting fares from travellers. Introduced back in 2003, the Oyster Card is the size of a credit card and is pre-loaded with money by the traveller. On each trip they take, the traveller touches the oyster card to a reader, registering their journey with the system which deducts payment from their balance. Each single journey is charged at a different rate depending on the origin zone, destination zone, and time of day.

A daily capping system is in place such that you will never pay, in a day, more than the price of a day-pass covering all of your journeys for the day. For example, in a day where you only travel in zone 1 off-peak your journeys will cost £1.80, £1.80, £1.80, £0.20, £0, £0 and each journey after that is free, as you essentially now have a day-pass on your card when your daily cap has reach at £1.80*3 + £0.20 = £5.60.

A Canadian friend of mine, currently residing in Australia, visited me here in London the other weekend. Knowing the ease, convenience, and price-capping guarantee, I recommended that he get an Oyster Card. He loaded it up with £10 at Heathrow and came into town to drop his bags at my place. After a short jet-lag nap he headed out into the core to see the tourist sights, travelling frequently on the underground. At the end of the day he reported that his Oyster Card credit had run out and that he had needed to top up the balance. This surprised me, so we worked out his journeys and payments:
  • Zone 6 (Heathrow) to Zone 1 at Peak - £4.20
  • 6 x Zone 1 Off-Peak - £1.80 each

Because he travelled from Zone 6 to Zone 1 at peak, his cap for the day was £14.80 even though had he bought a Zone 1 day-pass at Heathrow he would have only paid £5.60 + £4.20 = £9.80. So the Oyster Card is convenient and comes with a price capping system, but there are holes in that system. In this case it cost him £5.00 which is about an hours work at minimum wage in the UK, so not trivial.

Any individual travelling on a public transportation network wants to perform an optimisation. In this case, they want to minimize their total cost by selecting the most efficient combination of fares to cover all of their journeys. This problem presents itself as a classic optimization problem; Subject to constraints, like the requirement to purchase tickets to cover all journeys, the goal is to minimize total cost, a function of the decisions to buy tickets. An optimisation problem like this can be formulated mathematically and solved by computers using a discipline called integer programming, one of the tools in the Operations Research practitioner's toolbox.

If this problem can be solved by computers, why doesn't the Oyster Card system provide a lowest price guarantee rather than the evidently imperfect price-capping system? Consider for a moment the requirements of the system:
  • Daily ridership of around 3 million
  • At the end of their journey, users must be told almost instantaneously what the cost was and what their remaining balance is

Optimisation problems of this nature are not always fast, easy, or even possible to solve optimally. The computers of today are fast, but there's plenty still beyond them. The tube system isn't even using the latest technology. I've been told that some Underground components still use punch cards! Every time a customer makes a journey this optimisation must be calculated and that must be done 3 million times a day and that is unfortunately too much.

When an optimisation problem is too big or too complex to solve directly and perfectly, analysts use something called heuristics to come up with near-optimal solutions. There are commonly used methods, but depending on the problem, customised heuristics can be developed, using the unique structure of the problem in question to produce a near-optimal result. That is exactly what the price capping system is; It is a heuristic used to make a good approximation of the lowest price.

There are effectively only two types of tickets in the system: single tickets and day passes. Day passes are the only way to save money. It is rarely worthwhile buying two separate day passes. It follows naturally that a simple rule of thumb for cost optimisation is to compare your daily total of single trips to the price of a day pass covering all those journeys and choose the lower option. The conditions that I list at the start of this paragraph are essential consequences of the structure of the problem, and we can exploit them to arrive at our simple heuristic, the same one that the oyster cards use.

In a future article I hope to look into formulating the optimisation problem of the London Underground and consider alternative heuristics.

Saturday, October 9, 2010

Expedia Revenue Management at Check-out or Rule Compliance

We have all been shopping online for something only to be told after making the purchase decision that it is no longer available or no longer available at that price. This often happens when buying flights, as prices can change minute-to-minute and you can be left with a much higher ticket price which makes you abandon your purchase. Disappointment all around.

However, the opposite happens from time to time as well! The price of a London to Seattle flight, when I found it was £649.07 (including all fees). I clicked to start jumping through all the purchase hoops, but after a couple steps into the check-out process, it flagged up, rather alarmingly, as £616.07. That's a 5% decrease in price. (See, I'm not making it up!)





I was pleasantly surprised, of course. But why would they do that?

I've got 2 suspicions.

1. Revenue Management / Yield Management / Consumer Psychology
In the weeks prior to this screen capture, I've been to the site a few times already looking for the exact same flight. Even though I'm not logged in, I'd venture to guess that the site has looked up my cookies and knew that I've been looking for these flights. Therefore, it should know that I was a likely buyer, rather than a window shopper (pc pun intended). I've been at the check-out stage before, but have abandoned the shopping cart eventually. It would be quite logical for the site to entice me with a lower price as a 'pleasant surprise' to finally get me to spill my moola. Not to mention the positive impression it's left with the shopper (look what I'm doing now - free advertising!).

However, is it worth the 5% price drop? How does Expedia decide 5% was the right balance of customer incentive and revenue loss? I was already a willing customer, ready to bite. Isn't it just giving the 5% away for free? In my case, it's difficult to say whether the move has gained my loyalty to Expedia, because I was already a frequent visitor and buyer there. It may have re-enforced my loyalty though. It would be very interesting to analyse a few year's purchase and cart abandonment data of customers where this has happened to, versus a control group. Would we observe a lower purchase completion rate, which would drive a higher lifetime revenue per customer?

2. Airline price adjustment rule compliance
There could exist such a regulatory rule in the online airline pricing world to protect consumers, such that the vendor must notify the buyer of last minute price changes before the final purchase is completed. Now, I don't know if such a rule exists, but it is possible. However, it sounds extremely difficult for the regulators to enforce and monitor compliance.

I personally think it's more the former than the latter. One way to test the real reason behind the price drop could be to see if it's always a 5% decrease. Time to do some more flights window shopping!



P.S. In a previous article where we observed operational inefficiencies at London's Gatwick Airport, we erroneously stated that the airport operator was BAA (British Airports Authority). In fact, BAA was forced to sell Gatwick to please regulators seeking to break a monopoly on UK's airports. Our apologies to BAA. The current owners are Global Infrastructure Partners, who also owns 75% of the London City Airport.



Update:
Responding to two unconstructive comments, one of which was downright rude and was deleted, we thought we would add to this article.

The commenters suggest that Expedia is not a price setter, but just a re-seller making possibility one above unlikely. That said, the question still stands, "What's going on here?". If the prices that Expedia gives you when you search are cached and not live, that seems to be to be a surprising shortcoming. If they are, why offer a lower price to someone who appears to have already made the decision to purchase?

There are probably a number of factors at play that someone from the online travel community could answer.

If I were reselling through Expedia, I would want my price-updating algorithm to give the higher of the two prices at the point of payment, i.e. more profit. Both Expedia and the vendor are motivated to collect a higher price and therefore a higher commission as a percentage of the selling price.

The commenters may be very correct in saying that Expedia doesn't set the price, but merely re-sells at whatever the price the vendor names. That's why we said there were two possibilities, the second being not revenue management. However, if Expedia is not practicing revenue management in this way, they probably should at least experiment with it. Their commission represents a headroom within which they can optimize and the goal, after all, is not to make the greatest profit on each sale, but instead the greatest profit across all possible sales.

Wednesday, September 15, 2010

Restaurant Systems Dynamics - Influence Diagrams

Systems Dynamics is a discipline that floats about in the management science/management consulting ecosystem. It is genetically related to Systems Thinking, though Systems Thinking contains much more, but no aspect of simulation. The two most important aspects of Systems Dynamics are influence/causal diagrams and continuous simulation. Today I would like to outline an example of the use of influence diagrams to study a simple system, gain strategic insight, and form the basis of a stock and flow continuous simulation.

I was in Paris the other weekend, looking for a restaurant for Sunday lunch. Finding a good restaurant as a tourist is always difficult because tourist restaurants just aren't very good. The restaurants in my neighbourhood in London rely a lot on repeat business and referrals from friends and engage in a repeated interaction with their customers. The restaurants in touristy areas on the other hand get the majority of their business based on location. My local restaurant wants to delivery value for money so that I or my friends will come again. The restaurant in Venice never expects to see me again and is motivated to give me the lowest value for money to maximize profit. We have an example here of repeated and non-repeated games, but this is not an article about game theory.

As regular travellers, we have a strategy for finding the right place. There are a number of aspects to that strategy, but the one I want to highlight today is: Find busy restaurants. We are by no means the only people employing this strategy, as it is clear that busyness should be an indication of quality.

Where is this all going? I'm telling this story because I want to use an influence diagram to study restaurants in general, study touristy restaurants in particular and gain strategic insight from that. Influence diagrams are used to study the interactions in a system, particularly the between key strategic resources. In the case of our restaurants these will be:
  • Customers occupying tables
  • Customers queuing for tables
  • Perceived restaurant quality
  • Available customers


Figure 1. Simple Tourist Restaurant Influence Diagram

The make-up of an influence diagram is relatively simple:
  • Strategic resources, flows or other system variables
  • Arrows indicating one influencing another
  • An indication of a positive influence or negative influence
  • Optionally indications of re-enforcing and balancing loops

Consider Figure 1 above, the influences shown are as follows:
  • As the number of "New Customers Arriving" increases, the number of "Customers Occupying Tables" increases
  • As the number of "Customers Occupying Tables" increases, the "Perceived Restaurant Quality" increases
  • As the "Perceived Restaurant Quality" increases, the "New Customers Arriving" increases
  • As the number of "Customers Occupying Tables" increases, the "Length of Queue for Seating" increases
  • As the "Length of Queue for Seating" increases people will be discouraged and it will reduce the number of "New Customers Arriving"
  • As the number of "New Customers Arriving" increases, the number of "Available Customers" decreases
  • As the number of "Available Customers" decreases, the number of "New Customers Arriving" decreases

Re-enforcing loops can be exploited to achieve exponential growth and profit, but can also cause exponential collapse and bankruptcy. Balancing loops are often related to limited resources which limit what we can achieve, but also serve to mitigate damage.

Loop B1 is a balancing loop: As more customers choose to enter our restaurant, the total number of potential customers is diminished, thus reducing the flow of new customers. This puts a natural limit on our business, the number of potential customers.

Loop B2 is a balancing loop: As more customers arrive, our tables experience a higher and higher occupancy and customers must wait in a queue either for other customers to leave or for dirty tables to be turned over. Here is another resource constraint on our system: capacity.

Loop R1 is a re-enforcing loop: More customers leads to an increased perception of quality which then leads to more customers. This is they key re-enforcing loop that we should study further.

The key strategic conclusion that can be drawn form studying this influence diagram comes out of loop R1, the re-enforcing loop. The consequence of this loop is that full restaurants tend to stay full and empty restaurants tend to stay empty. Given that each restaurant starts empty each day, the key challenge appears to be in first becoming not empty. Easier said than done.

Restaurants and bars have a number of ways of achieving this. The first, but least interesting, is simply good quality. A regular customer base or recommendations in guide books will provide the seed customers from which a full house can grow. Alternatively, we need some other means of getting people in the door. This makes me think of my time in Turkey on the Mediterranean coast. Walking along the waterfront in a tourist town, a restaurant owner offered me a half-priced beer as long as I would sit along the front edge of his balcony. If this makes you think of happy hour there's probably a good reason.

I will admit that the "strategic insights" discussed above with respect to the restaurant industry are not earth moving, profound, or even unexpected. However, this article provides a simple real-world example of a dynamic system, and demonstrates the concept nicely. Had we not already known that full restaurants stay full and empty restaurants stay empty, going through this exercise could have revealed that to us.

The next step would be to design a simulation based on the influence diagram, something that I will endeavour to do in a future article.

Wednesday, September 1, 2010

What motivates us the most

First let me make clear that I am talking about the motivation in workplace. In personal life it's easy - in first half of our life it's the Sex, in second half it's the Comfort. (So to speak with tongue in cheek)

But the workplace motivation is more intriguing. And that is the area that every OR specialist should always keep in the forefront of their mind - the questions and aspects of human motivation. Here's an excellent animated video derived from the talk of one Dan Pink at RSA. Seems that Mr. Pink also excels in self-motivation, since this lecture is a small masterpiece.
True, these research findings are popping up here and there for the last two decades, at least, and lots of companies are adopting some of those principles, however this short video sums it up in excellent concise way. Enjoy!



However, I personally think that all these findings are missing some essential qualifications. I thinks that it reflects the motivation of people in developed countries, where there is no hunger and war is something nobody really remembers.
To echo the words of Mika Waltari in his book Egyptian Sinuhe, where he describes one lucky country he travels through, "...and the people who knew neither hunger no war, were already in middle age...".
I wonder, how the same research would turned out in war torn Angola, or Iraq.
I suspect that this type of "Make the world a better place" altruism grows best in economically nutritious Petri dish - relatively wealthy society. But what do I know about the poor countries. Maybe they would surprise us the most. The world is changing after all. It's the Internet age now.

One observation I made about the phenomenon of people working in their free time for free. (Linux developers, etc.) First I would liken it to simple hobby-ism. And I think that it indeed has the roots in hobbies. Everybody at some time in their life likes to build some "model airplane" and see it fly. But, and here comes my observation, they would like more to see it soar, than just fly. In other words, people don't mind to work for free on somebody's else project (i.e. Linux), but they prefer to jump on winning bandwagon. The likelihood of overall impact (let's even say world wide impact) is a specific motivation on its own.

It's the Internet age now.