Temperature Controlled Clothing for South Indian Summers

One of the first things we invented at Aiaioo Labs was a cheap vest that could keep people cool in the hot Bangalore summers.

We had applied for a patent for the vest, but later abandoned the application (it had appeared in the Indian patent office gazette as 2058/CHE/2008, with a filing date of 25.08.2008).

Since we do not intend to pursue the technology to production ourselves, I thought I’d describe it in our blog in the hope that someone interested in the idea might find a way to solve the remaining problems on the road to productising it.

clothing_temperature_controlled_1

This figure illustrates the components of the vest:

  1. Tubing filled with water
  2. A connector that connects the tubing to a reservoir (a bottle) of cold water
  3. A reservoir full of ice-cold water
  4. A hand-pump for circulating the water

clothing_temperature_controlled_5

The tubing is laid out in the pattern shown in the figure above so that cold water, entering at the top, can flow through the tube freely all the way to the bottom, mixing with the fluid already in the tubing.

This prevents the formation of cold spots and permits the water to maintain an evenly cool temperature throughout the vest.

clothing_temperature_controlled_4

The tubes that run up from the reservoir to the top of the vest carry very cold water and the wearer needs to be insulated from them as shown in the above figure.

clothing_temperature_controlled_2

The coolant is circulated using a hand pump – a kind of bellows – as shown above.  There are two reservoirs in the figure, but one reservoir will suffice.

clothing_temperature_controlled_7

The second reservoir comes in handy if the mixing of warm and cool fluids in the tubing does not warm of the coolant to a comfortable temperature.  The second reservoir can then be kept at a higher temperature than the first.

clothing_temperature_controlled_3

The above figure is of a simple pump that I built from commonly available parts – a rubber bulb, two valves and two nozzles.

Field Trials

We built a working prototype of the vest, and on a fine day in 2008, I wore it under my clothes while travelling by bus from Banashankari to Vidyaranyapura.

I thought it felt cooler with the vest on, but not significantly.

Work Remaining

To productise this, among other things, one needs to improve the tubing.

The only tubing whose walls could maintain their shape tended to have thick rubber/plastic insulating walls which impeded the cooling effect of the vest.

Thinner tubes tended to collapse and fold sharply, stopping the circulation of the fluid.

Another issue was the pumping pressure.  The hand pump (the bladder) was sufficient but needed frequent tight short squeezes to pump the fluid through the tube, which became exhausting and monotonous.

If a non-insulating, non-collapsing tubing system could be constructed, and the pump operated by a light battery-powered peristaltic pump, and the cost of the latter kept to within a few hundred rupees, then the vest could become a commercially feasible proposition.

A device for carrying road traffic on the Bangalore metro

A few of us were wondering the other day if it might be possible to carry road vehicles on metro rails.

A car is a machine with wheels that operates on certain flat surfaces, namely roads.

cars

A metro train is also a machine on wheels, but it operates on railway tracks.

metro

Roads tend to be very crowded, but not so the rails.  Long stretches of railway tracks go unoccupied most of the time.

So, initially, we felt that if we could put cars on rails using a suitable adaptor, we could move some 4-wheeler traffic off the roads.

Such an adaptor, it turns out, is easy to build.

car_holder

A cage with a roof with eyelets that allow the cage to be lifted, and wheel chocks that immobilize the car will do the trick.

Such a cage makes the car easily transportable and allows it to be lifted onto railway carriages or inaccessible parking spaces (say on the roofs of buildings).

Advantages

We calculated that a typical metro coach could hold up to 8 cars (a coach is 22 metres in length while cars are usually less than 5 metres in length, and you can stack two car cages one on top of the other).

So, 20 coaches could hold 160 cars.

Assuming a metro train frequency of one every 5 minutes and 20 car coaches, you would have an hourly capacity of 1920 cars.

Typical peak road capacities are around 1700 cars per hour per lane.

Since many central Bangalore roads are single lane roads, this could effectively double the traffic capacity at the city center.

Disadvantages

However, the plan would be hard to justify for the following reasons.

Each metro coach can carry a maximum of 300 passengers (if they are packed 6 to a square metre).  So the ticket for a car would be that of 40 passengers during peak hours.  I doubt anyone would pay so much to travel by car on a metro train.

The second problem is that metro coaches are prohibitively expensive.  Metro coaches cost upwards of Rs. 8 crores each.

Finally, a metro transport system is designed to serve a high density of passengers.  Those 20 coaches would have been of far greater service to commuters if employed to carry 6000 people instead of 160 cars.

So, it would make sense to add car-carrying trailers only after all commuter demand has been met, and only if the cost of car-carrying trailers turns out to be far less than that of passenger coaches.

Using such cages for parking also seemed like an interesting idea, but I feel that the cost of such a system might again be prohibitive (it’s cheaper in India to use a valet).

Anyways, it was an interesting thought experiment.

Naive Bayes Classifier in OpenNLP

The OpenNLP project of the Apache Foundation is a machine learning toolkit for text analytics.

For many years, OpenNLP did not carry a Naive Bayes classifier implementation.

OpenNLP has finally included a Naive Bayes classifier implementation in the trunk (it is not yet available in a stable release).

Naive Bayes classifiers are very useful when there is little to no labelled data available.

Labelled data is usually needed in large quantities to train classifiers.

However, the Naive Bayes classifier can sometimes make do with a very small amount of labelled data and bootstrap itself over unlabelled data.  Unlabelled data is usually easier to get your hands on or cheaper to collect than labelled data – by far.  The process of bootstrapping Naive Bayes classifiers over unlabelled data is explained in the paper “Text Classification from Labelled and Unlabelled Documents using EM” by Kamal Nigam et al.

So, whenever I get clients who are using OpenNLP, but have only very scanty labelled data available to train a classifier with, I end up having to teach them to build a Naive Bayes classifier and bootstrap it by using an EM procedure over unlabelled data.

Now that won’t be necessary any longer, because OpenNLP provides a Naive Bayes classifier that can be used for that purpose.

Tutorial

Training a Naive Bayes classifier is a lot like training a maximum entropy classifier.  In fact, you still have to use the DocumentCategorizerME class to do it.

But you pass in a special parameter to tell the DocumentCategorizerME class that you want a Naive Bayes classifier instead.

Here is some code for training a classifier (from the OpenNLP manual) in this case, the Maximum Entropy classifier.

DoccatModel model = null;
InputStream dataIn = null;
try {
  dataIn = new FileInputStream("en-sentiment.train");
  ObjectStream<String> lineStream =
		new PlainTextByLineStream(dataIn, "UTF-8");
  ObjectStream<DocumentSample> sampleStream = new DocumentSampleStream(lineStream);

  // Training a maxent model by default!!!
  model = DocumentCategorizerME.train("en", sampleStream);
}
catch (IOException e) {
  // Failed to read or parse training data, training failed
  e.printStackTrace();
}

Now, if you want to invoke the new Naive Bayes classifier instead, you just have to pass in a few training parameters, as follows.

						
DoccatModel model = null;
InputStream dataIn = null;
try {
  dataIn = new FileInputStream("en-sentiment.train");
  ObjectStream<String> lineStream =
		new PlainTextByLineStream(dataIn, "UTF-8");
  ObjectStream<DocumentSample> sampleStream = new DocumentSampleStream(lineStream);

  TrainingParameters params = new TrainingParameters();
  params.put(TrainingParameters.CUTOFF_PARAM, Integer.toString(0));
  params.put(TrainingParameters.ALGORITHM_PARAM, NaiveBayesTrainer.NAIVE_BAYES_VALUE);

  // Now the parameter TrainingParameters.ALGORITHM_PARAM ensures
  // that we train a Naive Bayes model instead
  model = DocumentCategorizerME.train("en", sampleStream, params);
}
catch (IOException e) {
  // Failed to read or parse training data, training failed
  e.printStackTrace();
}

Evaluation

I ran some tests on the Naive Bayes document categorizer in OpenNLP built from the trunk (you can also get the latest build using Maven).

Here are the numbers.

1. Subjectivity Classification

I ran the experiment on the 5000 movie reviews dataset (used in the paper “A Sentimental Education” by Bo Pang and Lillian Lee) with a 50:50 split into training and test:

Accuracies
Perceptron: 57.54% (100 iterations)
Perceptron: 59.96% (1000 iterations)
Maxent: 91.48% (100 iterations)
Maxent: 90.68% (1000 iterations)
Naive Bayes: 90.72%

2. Sentiment Polarity Classification

Cornell movie review dataset v1.1 (700 positive and 700 negative reviews).

With 350 of each as training and the rest as test, I get:

Accuracies
Perceptron: 49.70% (100 iterations)
Perceptron: 49.85% (1000 iterations)
Maxent: 77.11% (100 iterations)
Maxent: 77.55% (1000 iterations)
Naive Bayes: 75.65%

The data used in this experiment was taken from http://www.cs.cornell.edu/people/pabo/movie-review-data/

The OpenNLP Jira details for this feature are available at: https://issues.apache.org/jira/browse/OPENNLP-777

From Naive to Perplexed

We recently came up with three proofs that taken together suggest that the naive independence assumptions made in the Naive Bayes classifier are quite unnecessary for achieving the accuracy it is capable of.

A new classifier based on this math (called the Perplexed Bayes Classifier) is described in our recent research paper.

This blog post is to announce that we’ve also provided a mathematics companion to the paper.

The mathematics companion may be downloaded from:  http://www.aiaioo.com/publications/icon2015_mathematics_companion.pdf

What is the Perplexed Bayes Classifier?

The perplexed bayes classifier is a classifier that resembles the naive bayes classifier but does not suffer from one of the shortcomings of the naive bayes classifier (a tendency to be unjustifiably overconfident about its predictions).

The following diagram shows how the reliability curves of the perplexed bayes classifier look alongside the naive bayes classifier’s.

research_paper_graph

 

The Perplexed Bayes Classifier

research_paper

We are proud to announce our latest research paper.

This paper describes an improved version of the grand old Naive Bayesian classification algorithm with rather interesting mathematical implications.

We have shown in this paper that it is possible to create a classifier that can classify data in exactly the same way as a Naive Bayes classifier, but without using the same “naive” independence assumptions from which the old classifier got its name.

Now smoke that for a second.  What we’re saying is that it was completely unnecessary to make those independence assumptions to get that accuracy after all.

So you take them out.

And what results is vastly better posterior probabilities. In other words, the classifier’s confidence in a prediction becomes vastly more believable.

But since it makes the same decisions as a Naive Bayes algorithm, its accuracy is provably the same!

We call the new classifier the Perplexed Bayes classifier because it uses the reciprocal of perplexity (the geometric mean) as the combination operator for individual feature probabilities.

It turns out moreover, that the mathematical implications of using this operator are that the naive independence assumptions disappear.

The Perplexed Bayes classifier and the math thereof are described in this research paper: http://www.aiaioo.com/publications/icon2015.pdf

This new classifier is as easy to build as a Naive Bayes, has the same accuracy, learns fast, and returns confidence scores that are way better.

And the math is amenable to retrofitting into Hidden Markov Models and Probabilistic Graphical Models to dissolve invalid independence assumptions.

Yes, as I said, the mathematical implications are very interesting.

The paper will be presented at ICON in Trivandrum in December 2015: http://ltrc.iiit.ac.in/icon2015/.

Protecting against deadly stampedes during the Hajj and other religious festivals

More than 700 people were killed in a stampede during the Hajj pilgrimage of 2015, which took place just a few days ago.

There have also been stampedes during religious events in India that have cost us hundreds of lives.

So pin-pointing the causes of death and injury in stampedes, and devising methods of prevention is of great importance to a large number of people.

In our earlier posts on stampedes, we looked at possible causes of deaths on sloping paths:

  1. How to prevent death and injury in stampedes – Part 1
  2. How to prevent death and injury in stampedes – Part 2

However, we had not been able to explain how people could die on flat ground.

In this article, we present a model for how forces on people in a crowd of flat ground can increase to such a magnitude that people would be crushed to death.

We also present a number of mechanisms for preventing deaths due to excess pressure in crowds.

On flat ground, as long as everyone in the crowd remains standing and stationary, there would be no horizontal crushing force.

However, a person can generate a force by trying to move in any direction.

Let’s say one person can generate 10 Kilograms of lateral force.

Now, if ten people stood one behind the other, in contact with each other, and pushed in the same direction, they could be expected to generate approximately ten times the 10 Kg of lateral force.

In other words, they’d be exerting 100 Kg of force on anything ahead of them, as shown in the figure below.

force_accumulation

When people in a crowd experience such accumulated forces, they are either injured physically or asphyxiated.

Autopsies of victims of asphyxiation in stampedes showed that they could have experienced pressures on their chests of around 6.4 psi.

If the area of the torso coming in contact with another person in a crush is 2 square feet, about 1 ton of force (about 1000 Kg) would be needed to exert a force of 6.4 psi.

A tightly packed column of 100 people could generate that kind of cumulative lateral crushing force.

So, if a tightly packed column of people say a 100 men/women deep were to suddenly be obstructed, say by a barrier or by another group of people crossing their path, the forces experienced by those in front (or at the intersection) could be as high as 1 ton.

This seems to have been what happened in Mecca a few days ago.

How people were injured

According to eye witness accounts of the stampede during the Hajj, the deaths occurred on a flat road, and there had been pushing and jostling at the start of the stampede:

“As our group started to head back, taking Road 204, another group, coming from Road 206, crossed our way,” said another worshipper, Ahmed Mohammed Amer.

“Heavy pushing ensued. I’m at a loss of words to describe what happened. This massive pushing is what caused the high number of casualties among the pilgrims.”

Something very similar seems to have been reported by a witness to the Hajj stampede of 2006 where 350 people died:

On January 12, as we were returning to Mina for the last ritual of Haj, we saw the big stampede from a distance as waves of people collided.

Mathematical / Physical Models

I will now attempt to show that in a constrained space, even higher forces can be generated by a wedging effect.

The Wedge Effect

A wedge is a mechanical device that can amplify forces.

If a wedge that is four times as long as it is tall is used, and a force of 10 Kg applied along its longer edge, it can generate a force of 40 Kg in the direction of the shorter edge, as shown in the following diagram.

wedge

Restraints of any kind (railings, barriers, fences, chains) can act as wedges and increase the pressure within a crowd perpendicular to the direction of movement of the crowd.

So, a column of 20 people can generate a force of one ton if they were wedged in between fences of an aspect ratio of 1:5 (the fence closed in by 1 meter for every 5 meters of road), as shown in the following diagram (for space, we have demonstrated that a column of 5 people can generate a lateral force of 250 Kg on account of the wedging).

wedging_barriers

Wedging could also occur if the path had no constrictions, if people in the crowd moved in opposite directions, as shown in the following figure.

wedging_parallel_barriers

The  above kind of wedging is probably what caused the deaths at a Love Parade in a crowd that had been standing still.

So, the following need to be eliminated to prevent deadly crushes:

  1. Obstructions to the movement of a tightly packed column of people
  2. Any wedges that can amplify pressures

A Partial Solution

The organizers could therefore probably improve the safety of their events by doing the following:

Parallel Channel Movement

Organizers could close off all intersections, and keeping all movement going along completely parallel, non-intersecting channels.

This would ensure that there could be no obstructions to movement.

Prevention of Wedging

Organizers would need to ensure that routes never constrict.

So, gates and converging roads would need to be avoided.

Also all traffic would have to be one-way.

This would prevent the formation of wedges.

References:

The Hajj Stampede is a Fluid Dynamics Problem

Why Crowds Turn Deadly

The Science of Human Stampedes
How to Survive a Stampede

 

 

Why Google is being investigated for rigging search results

I read in an article a few days ago that Google is being investigated by the Competition Council of India on suspicion of rigging search results.

One of the complainants was none other than Flipkart which is, I believe, one of the largest e-commerce companies in India.

Flipkart seems to have complained that ‘it found search results to have a direct correlation with the amount of money it spent on advertising with Google through Google’s Adwords program’ (the quote is from the news article; I haven’t seen the actual complaint).

Iff Flipkart’s observations are indeed true, and if Flipkart can establish beyond a shadow of doubt the existence of a correlation between advertising expenditure and search ranking (for a random allocation of advertising spend – and we see later why this is important) then it could have serious implications for digital marketers.

If the search rankings really correlate with advertising spend, it would mean that customers would be better off not spending any money at all on advertising with Google, rather than spending a small amount of money on the same.  In other words, it impacts the choice of SEO vs SEM for digital marketing.

SEO vs SEM

SEO and SEM are two strategies available to firms to bring their offerings to the notice of customers seeking information using search engines.

SEO (Search Engine Optimization) involves optimizing the text and links of web pages so that they rank higher in search results.

SEM (Search Engine Marketing) is the term used to describe the strategy of paying search engines (like Google) to display ads about a firm’s offerings alongside search results.

If there is a causal relation between advertising spend and ranking, then a common strategy used by many Indian firms – that of spending a little on SEM in addition to SEO – might hurt rather than help them.

Is Flipkart’s complaint valid?

I don’t have a detailed study and can’t provide incontrovertible evidence for the validity or invalidity of Flipkart’s complaint.

However, I have some anecdotal evidence that suggests that Flipkart’s complaint might hold some water.

And I am going to present the evidence to you in the form of a search experiment that you can all perform yourselves.

Search Experiment

Here’s an exercise that you can all try yourselves.

There is a book called “Taming Text” that is a practical introduction to a text search platform called ‘Solr’.

When I search for the string “taming text” (the location is India and I use a browser into which I am neither logged in nor signed into Google from), I get the following results:

Results for 'taming text' page 1 (above the fold)
Results for ‘taming text’ page 1 (above the fold)

As you can see, Flipkart is nowhere to be seen (though it is the largest online book retailer in India).

If you scroll down to the bottom and look ‘below the fold’, you see the following:

Results for 'taming text' page 1 (below the fold)
Results for ‘taming text’ page 1 (below the fold)

The Flipkart product page does not show up here either.  But you see an Amazon India advertisement right at the bottom.

Let’s look at the second page.

Results for 'taming text' page 2 (above the fold)
Results for ‘taming text’ page 2 (above the fold)

Again, no luck.  You get a link to Google books, but no Flipkart.

(We looked through 10 pages of results but found no link to Flipkart.  Did you?)

So, we try a different search.

We enter “taming text flipkart” into the search engine.

And here are the results!

flipkart6
Results for ‘taming text flipkart’ page 1 (above the fold)

This time, the Flipkart page shows up right at the top!

In addition, a Flipkart advertisement shows up right above it.

So it appears that Flipkart had bid on the ‘flipkart’ keyword or on ‘taming text’ or on some combination of ‘flipkart’ and ‘taming text’.

When we scroll to the bottom of this page of results, we see:

Results for 'taming text flipkart' page 1 (below the fold)
Results for ‘taming text flipkart’ page 1 (below the fold)

Amazon, it appears, had also bid for either ‘flipkart’ or ‘taming text’.

Moreover, we see that Google has obviously indexed the Flipkart product page for ‘Taming Text’.

Then why was the Flipkart page ranking so low as compared to the Amazon India page?

Evil or Innocent

Could the difference in rankings be caused by the differences in advertisement expenditure on different keywords by different vendors?

If so, it would be evil.

Flipkart seems to think so, as evidenced by their complaint.

But, as it turns out, that does not have to be the case.

It is possible for the search rankings to be correlated with advertising spend without the latter causing the former (correlation without causation) in the following manner.

If Flipkart’s own SEM algorithms had bid higher on keywords that described their products better, that could in and of itself have resulted in a correlation between search ranking and ad-spend.

You probably saw a case of that in the example above.

The term ‘taming text flipkart’ would certainly have matched the link to the Flipkart product better than the link to the Amazon product.  This is because of the appearance of the word ‘flipkart’ in the Flipkart URL (the word ‘flipkart’ would not have appeared in the Amazon URL).

So, the fact that more words in the search string were matched would have caused the Flipkart URL to be ranked higher.  If Flipkart had bid on the keyword ‘flipkart’ but not on ‘taming text’, it would appear as if the rankings were correlated with the advertising spend.  But one (the expenditure) would not have caused the other (the rankings).

Similarly, for the string ‘taming text’, the Flipkart product URL could have ranked lower than the Amazon URL merely because there are fewer buyers for the book in India than in the USA.  This could have resulted in Google’s machine learning algorithms associating the name of this book with the keyword ‘Amazon’.

Thus, there could have been a correlation of ad spend and ranking without causation.

In other words, the perceived correlation could be on account of external factors that affected both variables.  The only way to eliminate those external factors would be to randomly allocate advertising spend and then see if there still was a correlation.  If a correlation could still be established, there would then be a strong case for saying that the relation was one of causation and not correlation.

But even if there were no evil intention (no causation), the fact remains that this ranking pattern is unfair to Flipkart, though unintendedly.

In other words, Amazon’s search rankings (if my theory as to why it ranked higher is right), might have received a boost from buyer behaviour in a geography where its competitor Flipkart does not operate.

So, Flipkart’s complaint of unfairness might indeed be warranted.

Bias Prevention

In any case, this illustrates the importance of a new area of study – the study of bias in algorithms.

The article linked to above says:

Venkatasubramanian’s research revealed that you can use a test to determine if the algorithm in question is possibly biased. If the test—which ironically uses another machine-learning algorithm—can accurately predict a person’s race or gender based on the data being analyzed, even though race or gender is hidden from the data, then there is a potential problem for bias based on the definition of disparate impact.

Search bias was also described as a cause for concern by Brin and Page in their paper on Google written during their days at Stanford:

http://infolab.stanford.edu/~backrub/google.html

The paper says, and I quote none other than Sergey Brin and Lawrence Page:

The goals of the advertising business model do not always correspond to providing quality search to users.  … we expect that advertising funded search engines will be inherently biased towards the advertisers and away from the needs of the consumers.

Since it is very difficult even for experts to evaluate search engines, search engine bias is particularly insidious. A good example was OpenText, which was reported to be selling companies the right to be listed at the top of the search results for particular queries.  This type of bias is much more insidious than advertising, because it is not clear who “deserves” to be there, and who is willing to pay money to be listed. This business model resulted in an uproar, and OpenText has ceased to be a viable search engine. But less blatant bias are likely to be tolerated by the market. For example, a search engine could add a small factor to search results from “friendly” companies, and subtract a factor from results from competitors. This type of bias is very difficult to detect but could still have a significant effect on the market.

Other interesting articles on the subject of search result bias:

  1. http://www.politico.com/magazine/story/2015/08/how-google-could-rig-the-2016-election-121548_full.html
  2. http://www.politico.com/magazine/story/2015/08/google-2016-election-121766
  3. http://www.theguardian.com/technology/2014/may/15/google-did-not-rig-indian-elections

Fun With Text – Hacking Text Analytics

hacking_text_analytics

I’ve always wondered if there was a way to teach people to cobble together quick and dirty solutions to problems involving natural language, from duct tape, as it were.

Having worked in the field now for a donkey’s years as of 2015, and having taught a number of text analytics courses along the way, I’ve seen students of text analysis stumble mostly on one of two hurdles:

1.  Inability to Reduce Text Analytics Problems to Machine Learning Problems

I’ve seen students, after hours of training, still revert to rule-based thinking when asked to solve new problems involving text.

You can spend hours teaching people about classification and feature sets, but when you ask them to apply their learning to a new task, say segmenting a resume, you’ll hear them very quickly falling back to thinking in terms of programming steps.

Umm, you could write a script to look for a horizontal line, followed by capitalized text in bold, big font, with the words “Education” or “Experience” in it !!!

2.  Inability to Solve the Machine Learning (ML) Problems

Another task that I have seen teams getting hung up on has been solving ML problems and comparing different solutions.

My manager wants me to identify the ‘introduction’ sections.  So, I labelled 5 sentences as introductions.  Then, I trained a maximum entropy classifier with them.  Why isn’t it working?

One Machine Learning Algorithm to Rule Them All

One day, when I was about to give a lecture at Barcamp Bangalore, I had an idea.

Wouldn’t it be fun to try to use just one machine learning algorithm, show people how to code up that algorithm themselves, and then show them how a really large number of text analytics problem (almost every single problem related to the semantic web) could be solved using it.

So, I quickly wrote up a set of problems in order of increasing complexity, and went about trying to reduce them all to one ML problem, and surprised myself!  It could be done!

Just about every text analytics problem related to the semantic web (which is, by far, the most important commercial category) could be reduced to a classification problem.

Moreover, you could tackle just about any problem using just two steps:

a) Modeling the problem as a machine learning problem

Spot the appropriate machine learning problem underlying the text analytics problem, and if it is a classification problem, the relevant categories, and you’ve reduced the text analytics problem to a machine learning problem.

b) Solving the problem using feature engineering

To solve the machine learning problem, you need to coming up with a set of features that allows the machine learning algorithm to separate the desired categories.

That’s it!

Check it out for yourself!

Here’s a set of slides.

It’s called “Fun with Text – Hacking Text Analytics”.

Why the example of a Nash equilibrium in the movie “A Beautiful Mind” is incorrect

I was reading an article today about the mathematician John Nash, whose life the movie “A Beautiful Mind” was based on.

The article contained a link to a clipping from the movie that, it said, explained the game theoretic concept of a Nash equilibrium.

In the clip, Nash and his three friends are at a bar and have to make a choice.

They can go and speak to the four brunettes at the bar, or they can all go to talk to the lone blonde, whom they all like better.

Nash explains to his friends that if they all went to speak to the blonde, she would be put off by all the attention and turn them all down.

But once the blonde turned them down, the brunettes would too, since no one wants to be someone’s second choice (and so they would all lose).

So, Nash convinces his friends to ignore the blonde and speak to one of the brunettes each (so that they would all win).

The strategy of ignoring the blonde, the movie suggests, results in a Nash equilibrium.

However, that turns out to be incorrect.

The strategies adopted by the four men do not result in a Nash equilibrium.

A Nash equilibrium is only obtained when all players adopt a strategy where no single player, by changing his strategy, can obtain a better outcome.

That is obviously not true in this case.

Any one of the four friends, by reneging on their deal, might get to go home with the blonde (a better deal).

nash_equilibrium_2

So, the strategy of going after the second choice does not satisfy the conditions for a Nash equilibrium.

A Nash equilibrium is really only obtained when all the men follow the strategy of going after the blonde (in vain).

The mistake has also been pointed out by others: http://math.stackexchange.com/questions/853988/is-the-nash-equilibrium-example-in-a-beautiful-mind-accurate

There is a better explanation of the Nash equilibrium in the video I shared in an earlier blog post:  https://aiaioo.wordpress.com/2013/01/26/what-game-theory-says-about-why-gas-stations-are-built-next-to-each-other/

Professor Nash passed away a few days ago in a car crash.

Meet us at Barcamp Bangalore 2015: Fun With Text – Natural Language Processing For Hackers

We’re going to be at Barcamp Bangalore.  You can come and meet us at our session “Fun With Text” which is a workshop on text analytics for hackers.

We’re actually going to be trying something a bit crazy at this session.

We’ll start by going over an extremely simple machine learning algorithm.

And then we’re going to go about showing people how almost everything you could ever want to do with text can be done using only that algorithm.

All programmers welcome. Refresh your basic probability theory before you come!

Here’s the Barcamp link:  https://barcampbangalore.org/bcb/spring-2015/fun-with-text-natural-language-processing-for-hackers