Tuesday, 27 November 2012

When brains are best

Operational Research is marketed as "The Science of Better".  As a science, the models that we develop can be classified as falling into two categories, to answer the questions "What happens if ...?" followed by proposed changes, or "What's best?".  As students, we learnt how to use standard techniques to construct models of a variety of commercial situations, and then were faced with a course on computer simulation.

And the running joke through the course was "If all other models fail, use simulation".  Of course simulation was much more than the stop gap for problems where there was no neat technique.  We learnt that operational research was useful for all kinds of problems, and especially the "Messy" ones.  Lancaster's Skein House, where the O.R. Department was housed for many years, took its name form the two meanings of "skein".  One, for untangling a skein of wool, and making sense of the messiness of it; two, for describing a group of geese, with humorous reference to O.R. sometimes being a "wild goose chase".

Simulation models over the years have been extremely useful, and the development of visual simulation models has been a boon to many O.R. workers who can demonstrate the "What happens if?" situation in their commercial situation.  And the client can interact with what he/she can see.  There are times when the best tool for the decision-maker is a pair of eyes, looking at the details of the model and using their brain while spotting how the system behaves. 

Over the years, there have been many times when aspects of the work that I have done have highlighted the importance of eyes and brain.  The client looks at how parts of the system perform and comments on those parts - as well as the primary objectives of the model.  A well-constructed model needs to be geared to the brain of the client.

The other day, I was in correspondence about another area of commerce where mathematical modelling is not the complete answer to a business problem, although it has been used routinely for many problems.

An  irregular item, shrink-wrapped.  The wrapping extends to the tapered neck, but it is noteworthy that there is no printing on the material which has shrunk there.

Plastic shrink wrap is widely used in industry.  Shrink material is a material that on a molecular level is a mass of twisted elastic bands. In the unheated material, these "bands" have been stretched till they are all tight and then they have been locked in that position. When heated they spring back to their happy knotted state and the film shrinks to its reduced size.  The more that the material has to be shrunk, the more expensive it is.  For some packaging all that is needed is to wrap a sheet around an object and then use a heat source to shrink the plastic. But there are many products on the shelves of shops and supermarkets where the shrink wrap carries the label.  Just look at batteries, plastic bottles of juice, and cans of drinks.  The label has been printed onto the material before it is shrunk, so the printing shrinks as well.  So, the client knows what the final product should look like, and the printer has to work from that back to what should be printed, and where.

So far so good.  If the object to be wrapped is a box, or a simple cylinder, then the printing will be straightforward, expanded in one or two dimensions.  But, businesses want to wrap more complex shapes, such as cones, or the flattened cone shape used in spray cleaners.

So, the engineers work by a sort of adaptive process, starting with a printed grid being shrunk and then measured.  Working back from the result, one can work out what to print and where.  Just like a neat mathematical technique in O.R.

Unfortunately, this client had a circular logo which had to appear on the package.  The engineers made their grids, measured them, and devised a print scheme with a distorted logo which would distort to appear correct when it was shrunk.  It didn't work.  Put bluntly, it looked wrong.  The human eye could see that it wasn't quite a circle, and did not interpret it correctly.

So, here was a case for a sort of interactive simulation process of "What's best?"  The engineers printed the logo in various places on the label, each design calculated to distort to the right shape.  Then they worked alongside the client to see where his human eyes and brain interpreted the result as the company's circular logo.  Where mathematics failed, the human eye and human brains won.

It was a good job that the engineers didn't rely on their models - they worked with the client to reach a "better" solution.  Just as we in O.R. need to remember that the client knows best.

Monday, 19 November 2012

Prostaglandins and genetics

In 1969, the science journal Nature published a letter from a researcher (V R Pickles) with the title "Prostaglandins - an experiment".  Although the writer was involved with medical research, his letter had nothing to do with that area of his work.  He was interested in the number of reprint requests that would be sent to him, once the title of the letter had appeared in issues of current content services.  (For those readers who don't remember 1969, in those days there was no internet or email.  When an article was published, its title would be collected and circulated by a number of hard-copy abstracting services and journals which printed the contents pages of journals.  Some even used computers to index the papers.  If you wanted to read an article of interest, then you wrote a letter to the author and hoped that he or she would respond.  Many researchers had their own preprinted postcards to send to authors.  I never went to such lengths, but worked in departments which had departmental cards.)  In the letter, Dr Pickles had asked that anyone who actually read the letter in the journal Nature should not send for a reprint.  At the time, prostaglandin research was flourishing all over the world.

The letter in Nature led to 615 reprint requests within the following two months.  He wrote:  I am writing not about prostaglandins but about requests for reprints of a Nature article1 about them. In the first two months after this was published, I received 615 reprint requests of which 53 per cent came from the USA or Canada. Thirty-eight per cent of these, and 16 per cent of those from other countries, bore the name of the sender only in typewritten or rubber-stamped form. Of the handwritten names, internal evidence suggested that many were not personal signatures.  

(Despite the request in Nature it was clear that there were some requests for a reprint, entering into the spirit of the joke.  One came from a Dr Sidney Arbour-Bridge.)

 Fast forward to this year. A few years ago, Tim Paulden, one of my PhD students, and I co-authored a series of papers about genetic algorithms, a metaheuristic approach to global optimization.  Last week, the email below arrived.

This is from the Editorial Board Office of the journal of Frontiers in Pathology and Genetics (FPG). It’s my honor to contact you.
We searched a good paper of yours
Title: The Dandelion code: A new coding of spanning trees for genetic algorithms
Authors: Smith David K.
This is an excellent paper in the related area of Pathology and Genetics. Considering your research in related areas, we cordially invite you to submit a new paper to the journal of Frontiers in Pathology and Genetics (FPG). If accepted, your paper will be published for free.
If you are interested in it, please submit your manuscript online before Dec. 6, 2012:
Do you suppose that anyone in the editorial board office has actually read the paper, in order to call it "a good paper of yours"?  Has a person actually read the title of our paper?  Did any person notice that the paper was not published in a medical journal?  No, no, and no!  
You would think that the advent of the internet and search engines would have eliminated such gross errors, and that search algorithms used by the editorial office would have  filters to prevent silly errors.  It seems not.  Meanwhile, I await the free gifts from drug companies who may want to send me samples to help my genetics research.  (And in the spirit of V R Pickles, I will give this blog posting some appropriate labels.)

Tuesday, 13 November 2012

50% of advertising expenditure is wasted ...

... but nobody really knows which 50% it is.  The O.R. professor who taught marketing when I was a postgraduate introduced us to that mantra, and went on to encourage us to think about the art and science of marketing and advertising, and how they relate to O.R.  The university also had a department of marketing in the business school, and our professor used to modestly(?) claim that he knew more about the subject than the staff of that department. 

There was one undergraduate project relating to marketing and advertising which I remember.  The company inserted reply-paid cards in trade journals, and wanted help analysing the responses.  Typically, there would be a dozen cards from each insertion, from 5000 sent out.  It really was a mug's game trying to make sense of the responses.  The student did learn some useful life skills, as well as the futility of trying to find patterns in small amounts of data. 

On another occasion, we were in a group working at a confectionery company, making products that are household names in the UK, USA and all over the world.  Why, we asked, did such a company bother to spend millions each year?  Simply to keep the company in the national psyche, was the response.  Can you measure the benefits of advertising for the products?  Not really, but we know that if we stopped, sales would fall, but we can't measure by how much! 

On Sunday, we drove into Exeter from the west, and passed an illuminated sign as we drove into the built-up area.  It is one of the signs put up by the council to warn of traffic delays and diversions, and on Sunday afternoon, there were neither delays nor diversions.  The sign read "Could your journey have been made by bicycle?".  In a way, this was an advertisement, encouraging green travel.  But ... was the message in the right place?  Or at the right time?  Addressed to the right people?  All three questions are key for advertisers.  And the answer to all three seemed to be "No".  The signs were on the entrance to the city.  Most of those who passed them would have come from out of the city, possibly from the next towns (10 miles and 15 miles away) or from one of the smaller villages between the city and its neighbouring towns.  They would have travelled along busy roads with no cycle paths.  So the signs were not in the right place - those who saw them would not have chosen to travel by bike in winter for such a distance or on such roads.  The right time and people?  Sunday afternoon is not the time to appeal to commuters; those who pass by might be families, or people visiting the shops, or out for leisure. 

So, here was an advert for which well over 90% of the expenditure will be wasted ... possibly all.  It's a shame, because other adverts for green travel have worked; car-sharing schemes are doing well around here.

The following morning, I was chatting about the sign to some friends, and one said that he had seen a similar sign on another major road into the city on the same Sunday afternoon.  Somebody at the council offices didn't stop to think about the marketing of green travel.

These observations started me thinking about other widespread advertisements and marketing where the advertiser has failed to think about the placing of the message.  (1) I wonder about the effectiveness of trade vehicles which provide a mobile phone number as the only means of contact.  If one sees such a vehicle in Exeter, say, the phone number does not offer any hint of the location of the business.  It might be local, or it might be from the other side of the country.  Maybe the philosophy is like the confectionery company, simply keeping the business in the public eye.  (2) And what about adverts on vehicles which give a URL as address?  Are these effective?  How are people supposed to record the address when they are driving? 

There's scope for some measurement to be made, but I suspect that we will be back to the opening lesson, the futility of trying to find patterns in small amounts of data. 

Monday, 5 November 2012

Too much precision (again)

I spent a good part of today in the kitchen, cooking.  At one stage, I needed suggestions for the way to create a dish, so used a search engine to look up recipes.  And I found a wonderful web page which offered instant translation between US quantities and metric.  So,

10 1/4 ounces German chocolate cake mix
1 1/4 cups water
1/3 cup oil
3 eggs
1 (14 ounce) can sweetened condensed milk
1 (16 ounce) jar caramel topping (OR butterscotch topping)
8 ounces Cool Whip
1 (8 ounce) bag toffee pieces (or bits)

converts to:

290.58 g German chocolate cake mix
295.73 ml water
78.07 ml oil
3 eggs
396.89 g can sweetened condensed milk
453.59 g jar caramel topping (OR butterscotch topping)
226.79 g Cool Whip
226.79 g bag toffee pieces (or bits) 
Oh, what precision!  At least the eggs stay the same!

Queues and Air Ambulances

When I need a succinct introduction to Operational Research, I generally refer to the application of queue models.  The two-minute lesson goes like this:
(1) Think of the number of cashiers in your local supermarket.  What's the best number?
(2) It can't be too many - they wouldn't have work to do; it can't be too few - then the queues would be over-long; so there is a right number, and hence some mathematics to find that number.
(3) But that number depends on knowledge of how many customers will come at different times of the day and days of the week, and seasons of the year.
(4) And it must fit in with the shift pattern of staff at the store
(5) So what started as a simple question of finding the right number becomes part of a problem of using data from the past to make forecasts, and managing the employees in the store.
(6) O.R. people deal with problems like that

It's much easier than trying to explain about linear programming, or game theory, or Black Scholes volatility.

But even that explanation hides a great deal of complexity.  Many supermarket queues are themselves complex systems, with separate queues for those with one basket, those with less than 10 items, the self-service queues ....  And generally, queue models work best when the servers and customers are not human beings but things.  Human beings have personalities and psychology.  So queues with human beings are more sophisticated and more complex than the ones one meets in theoretical courses.  Despite these complications, queue models are extremely useful.

One area where O.R. has used queue models to good effect is in the emergency services.  Call for police, fire brigade or ambulance, and you become a customer in a queueing system.  The dispatcher selects a server (or more than one) to send to you, unless there is none conveniently available for your need.  So you may wait for a server to become free, or your service may start as soon as your need has been assessed - although you may not actually see the server for some time, as "service time" includes the travel time to the point of need.  This queue system is one with multiple servers, the possibility of service by more than one server, and the possibility of pre-emption.  (Pre-emption means that the dispatcher may decide that another emergency is more pressing than yours and take away the server from you.)  And the dispatcher has the potential to change the availability of servers by moving them around as those in one geographical area become unavailable or free.  Good dispatchers know all this and handle their resources without solving too many mathematical models of queues - but in many circumstances the initial planning of the emergency service has been done with such models.

Last week, there was a news story about emergency vehicles for which queue modelling is relevant.  In the United Kingdom, there are about 30 air ambulances, mostly helicopters, which provide rapid transport of patients from their point of need to a hospital.  As my house is close to the hospital in Exeter, we frequently see one of the two air ambulances that fly in our county of Devon from our garden.  I am not sufficiently familiar with the air ambulances from the neighbouring counties to be able to recognise them, but I know that there are times when "Our" ambulances will cross the border and vice versa, so the Dorset ambulance sometimes comes to Exeter, and - rarely -  that from Cornwall flies here, though that generally only visits the west and the north of Devon.  So, essentially, the emergency service in Devon might be modelled as a queue with two servers.  Or, you could model the emergency service in Dorset, Devon and Cornwall as a queue with four servers.  However, as soon as you allow the latter, you need to consider the counties to the east of Dorset, who can also call on the Dorset helicopter.  So maybe you need to consider the whole country, and model a queue with 30 servers?  No, not really, because the response time would become excessive; a helicopter from London would not respond to an emergency in Devon, nor would one of ours respond to an emergency in Manchester.

Hence most modelling of air ambulances is going to be based on the county service, and not extend to the whole of England or Britain.  At least that is one way of looking at the news story which emerged last week. 

That story concerned the deployment of a dedicated Children's Air Ambulance whose specific role is to transfer children in a specialised vehicle between hospitals anywhere in the country.  Such inter-hospital transfers, for adults and children, are already part of the tasks undertaken by the county air ambulances.  Not all the county organisers are happy with the concept of such a dedicated "server".  They will say that the response time of a helicopter based in the centre of the UK will be too great for the needs of most counties, and therefore they will continue to treat their system as having "their" vehicles, and none from outside.  The proposers will argue that nationwide, the queue for air ambulances will have one more server, and that can only be a good thing - more servers reduce the waiting time (lesson number 1 in queue models). 

So it looks as if we have a clash of two ways of modelling the emergency service provided.  Is it one based on service by local helicopters, in Devon's case two?  Or is it one provided by helicopters which might come from elsewhere in the country, with a longer response time?  Can O.R. help?  Yes, but there is the psychology of the proponents of the new service and the established administrators of the existing one to consider!  And they each seem committed to their conceptual models of the air ambulance emergency service. 

And another thought about a dedicated service for a particular category of "customer".  Queue systems exist which offer dedicated servers to particular classes of customer.   The executive lift which only the holders of a particular key can use.  The private hospital operation only available to those who can pay for it.  Parking spaces for staff only.  Whenever customers are divided into different types, the queue modeller needs to calculate the optimal number of servers providing that service, and normal service.  It is easy (exercise for the reader) to create a queueing system where the division of customers into two classes and dividing the servers between them means that the quality of service for each customer deteriorates.   (hint, you only need two servers to create such an example)

O.R. modellers of the activities of air ambulances, please step forward (and watch out for the rotor blades)!