Saturday, 15 January 2011

Epidemics and advertising

I first learnt the power of stochastic models when I had lectures by the late Professor David Kendall (famed for the Kendall notation for queue models He spoke about a simple model of an epidemic, and how that model gave rise to a statistical distribution for the number of people who would be infected. To add variety to his lectures, he spoke of the way that the model could be modified to describe the spread of a rumour (when someone spreads the message to someone who has already heard it, he realises it is a rumour and stops spreading it).

(Incidentally, I wonder whether David Kendall and I come from the same branch of the Kendall family, as my mother was a Kendall before she married.)

Since then, models of epidemics have become very much more sophisticated, but the essentials remain the same. As I write, the UK government is concerned with the spread of influenza in the population. The Labour opposition claims that the advertising about risk should have been started much earlier. In response, the government have spoken about the need to time the adverts for greatest effectiveness. I suspect that there are O.R. models in the background.

Advertising too long in advance is of limited value -- it will be forgotten. It needs to be at a time when it may affect the behaviour of people, who may be infected or susceptible. So the timing needs to be linked to models of the spread of the current 'flu virus. Hence two models need to be linked -- one about the effectiveness of advertising, the other an epidemiological one. But these models are bound to be in the background and, once again, O.R. is the "hidden science".

Marmalade, seasonality, production planning

It's the middle of January, and this is the time of year to buy Seville oranges. And to make real "English" marmalade, you must have Seville oranges. However, these oranges are only available for a few weeks, from early January to early February. Commercial producers can preserve the fruit and spread the production over the rest of the year, but amateurs have a short window for home production. It is seasonality, but seasonality of supply of raw material, not seasonality of demand.

So yesterday and today we have been making marmalade. Just over 20 pounds of it. (This is one product in the kitchen which we measure in pounds, not in the metric way, because the glass jars we use are "one pound jars" or "12 ounce jars" even though they are labelled 454 grammes, or 340 grammes.) This was two batches in our large jam pan, and my forecast is that it will last us until early 2012. Forecasting demand for twelve months is not generally advisable in industry or commerce, but in our case we know that the rate we use it is about 20 to 24 pounds per year, and we buy a little each year to add variety to the diet, to support charities who sell home-made marmalade, to try other flavours, and because my family know that a jar of "interesting marmalade" will be a welcome present for birthday or Christmas. Given all this, our actual demand for our own marmalade is less than 20 pounds per year, so next year will probably be a "one batch" January. So here is a matter of "make-to-stock" production planning!

The basic recipe can be varied in many ways; extra fruit can be added, in which case the quantity of sugar needs to be increased. This year, for the first time, we have added some fresh pomelo.

Who would have thought that something so mundane could illustrate facets of operational research.

Here's the recipe for a basic batch, which we keep written in one of the cookbooks on an old 80 column punched card!

3lb Seville oranges
2 lemons
5.25 pints water
6lb sugar, which may be mixed granualted and demarara
0.5oz margarine or butter

1: peel the fruit and cut the peel into slivers of the size you like (ours are about 2cm by 2mm [it is easier to give small sizes in metric units])
2: put the peel into 2.25 pints of water and simmer gently for 90 to 120 minutes
3: chop the peeled fruit roughly (we either quarter the fruit or cut it into 4 or 5 slices) and put it all as pith in a large jam pan with 3 pints of water and simmer alongside the peel
4: Drain the pith into a bowl or pan through a colander, and scrape the pith through the colander as well, to give "body" to the marmalade.
5: unless you have two jam pans, now you need to wash the jam pan
6: add the drained liquid from the bowl to the jam pan, add the peel and its liquid, add the sugar and boil steadily ("rolling boil") until a test shows that it has reached setting temperature. (We take a small amount, put it on a saucer, cool it in the freezer for 30 seconds and then see if it wrinkles. Other methods exist.)
7: remove from heat, add the margarine/butter and stir to remove the scum on the liquid. Leave to cool for 6-10 minutes
8: meanwhile, wash your jars, and place in a cool oven to dry and sterilize at about 100 deg C,
9: Carefully fill each jar, and finish off as usual for home-made preserves.

Tuesday, 11 January 2011

The school which was too small

The current INFORMS blogging challenge/theme is about "O.R. and politics". It reminded me of a student project a great many years ago. It was never suitable for a research paper write-up, but a blog is an appropriate place to recount what happened.

The city had expanded, and a large housing estate had been built. Part of the development was a new primary school. However, before the estate was complete, the school became overcrowded. It was too small. Not much could be done to provide more space. The local politicians were embarrassed and the local media were not slow to blame them. The student (B) and I were asked to help the council officers make better decisions in the future.

So we interviewed people, read literature, and did our best to become familiar with aspects of planning. We quickly realised that the whole mess was multi-criteria, and many criteria were non-numerical. One of the attributes of O.R. should be the ability to cut through messes. For simplicity, here, we reduced the problem to a two way table. One dimension was the forecast demand, reduced to “Low”, “Medium”, “High” and the size of school “None”, “Small”, “Medium”, “Large”. In each of the twelve cells we wrote down aspects of the consequence of the two dimensions, and then iterated through meetings in which stake-holders could contribute their ideas. So the table of twelve cells became a tool for thinking with for planners and decision-makers. It could be – and was – used in other new developments in the city and region. Nothing high-tech, but we had helped to make the mess less messy. B went on to a career in O.R. and other messy problems.

Among the gems that we learnt along the way were the following:
(1) It takes about five years from initial ideas to opening a school, so the children who will use the school are being born at about the time of those initial ideas;
(2) Families with pre-school children are much more mobile than others, so it is not possible to forecast demand by local surveys of families;
(3) The forecasts made in the past had gone awry because of world-wide economic upheaval;

O.R. at the blood donor session

When I taught queue models in O.R. at the university I encouraged students to give blood at the regular donor sessions held on campus. It was a good example of queues in series -- arrive -- register -- health check -- give blood -- refreshments, and I urged the students to observe and consider how the system could be improved.

Yesterday when I gave blood, I arrived before the system had reached a steady state and there was little delay. Wonderful! As I lay on the couch, it was possible to watch the donor next to me and the machinery used to shake the blood. The plastic bags holding the donated blood rested on a tray which was programmed to rock. What was odd was that the rocking was intermittent. Up, down, up, down, pause. Repeat. Someone had designed it so that it rocked twice and then paused. Why? Was this an optimal way of rocking the blood? Someone had designed the mechanism, and that design had involved finding a numerical solution to "Rock N times, at rate R per minute, pause S seconds"

Politics in a developing country

Location-allocation problems appear in many settings, and O.R. scientists have been involved in numerous cases. My research student (S) was concerned for the location of primary health-care facilities in his home country. He came equipped with the data about the villages and towns in one province. Populations, location of existing facilities, which villages had suitable infrastructure, distances between the population centres, and the government's policy for expanding health services in their five-year plan. So he set out to study where facilities should be located if one had a blank sheet to start with, given the five-year plan. Then he added constraints, because it would not be politically expedient to close facilities, so these had to remain even if they were not in the optimal solution. He was anxious to develop a system that could be replicated on a PC in his country, and this was part of S's work.

One constraint which had to be imposed was that each sector of the province should have the same number of facilities, and that the expansion plan should ensure that no sector had more than one more than any other. This was to keep local leaders and government staff happy. So the expansion gave each sector two facilities, then expanded these to three. Given the existing facilities, and the uneven distribution of population in the sectors of the province, these constraints meant that the location of facilities would not be as good as it could be.

So S completed his research, and presented it in his thesis and in seminars. At one of these, an astute member of the audience asked how S could be confident that the province would implement the solution. Developing country politics is not always what westerners are used to, and an O.R. solution might not be accepted by politiicians. "Well," said S, "my father works in the provincial governor's office. The governor will take his advice." He had never disclosed this in his research.

This is my first contribution to INFORMS Blog challenge/theme for January 2011 "O.R. and Politics"