Friday, 11 September 2015

September's silly statistic

News item in the property pages today:

Letting agent Rentify has estimated that the 240-bedroom Buckingham Palace would come at a rental cost of £303,340 per month.  

Not, you may think, a round £300,000, but a splendid £3340 per month more. 

However, the estimate is not quite as crazy as it appears, just the way it has been expressed.  Rents for property are usually round sums, either per month or per week.  And this monthly rent is a nice round estimate of £70,000 per week - but someone felt that it would sound better as a monthly amount.  On the Rentify website, the figures are given per month, and you have to make the conversion yourself when some figure looks odd.

Moral - if a figure is an estimate with one set of units, don't change the units!

Wednesday, 2 September 2015

Car park layout - what is good, what is best?

The magazine of the Institute of Mathematics and its Applications (Mathematics Today, August 2015) has an interesting and amusing article about optimising the layout of car parking spaces in a car park.  Tina and I have found several car parks at supermarkets and motorway services where the layout of spaces strikes us as sub-optimal.  (Mind you, the way that drivers negotiate such car parks is also sub-optimal.) 

So, what does the article consider?  It focuses on those which are on one level, not multi-storey.  Most car parks have a rectangular pattern with corridors for cars, and parking spaces at right angles, creating a rectangular pattern.  What happens if you have the spaces at an angle, creating a herringbone pattern?  Or if alternate corridors have traffic moving in opposite directions, so you can have a diagonal pattern?  The corridors can be narrower, because cars do not need so much space to turn.  So, you can have more corridors.  But possibly fewer spaces per corridor.

This problem has been examined in more detail by mathematicians at Bristol University(report here)

In Mathematics Today, the problem is treated as an optimisation problem with the fixed parameters length of bay, width of bay and turning circle of car, and one decision - the angle of the bay.  The car park is assumed to be infinite (as some car parks appear to be).  Taking the fixed parameters of a Rolls Royce Phantom, the best angle is about 36 degrees - but the optimal solution is insensitive to small changes so one could suggest either 30 or 45 (easier to measure).

Car users are very conservative, so it is unlikely that many car park designers will change to increase the capacity of their creations in this way.  But there is scope for designers to think about the likely flow of vehicles to try and achieve designs which are efficient and work.

For a completely whimsical discussion about the possibilities of an irregular layout of markings on a car park, Ian Stewart's book "Another Fine Math You've Got Me Into" has a chapter (The Thermodynamics of Curlicues) where the author imagines someone laying out a car park following Dekking and Mendes-France curves. 

Tuesday, 21 July 2015

Regular road maintenace

How often should a road be completely resurfaced?  What criteria should be used to decide whether to repair damaged surfaces or not, and whether to resurface the whole road?  Interesting questions for operational research. 

Devon has an extensive network of roads, from the motorway (M5) through dual carriageways to minor roads which run through quiet parts of the county.  Each one needs to be cared for.  Finance for the repairs is limited, though it comes from different sources, depending on the importance (load) of the traffic on that road.

Tina and I were walking in South Devon last week.  To get to the starting point we used several minor roads, and part of our walk took in a mile or so of single track roads.

We joke that we enjoy driving on roads where there is grass growing in the centre, a consequence of the fact that the centre of the road is never touched by the wheels of vehicles in such roads. However, one consequence of the growth of vegetation is that the road surface is damaged by the roots.  The surface is also affected by the water which runs off to the road-side. 

In the walk, we noticed a contrast between the minor roads that run through woodland and those that run through farm fields, with hedges or fences.  The latter dry out much more quickly than the former, as they catch the sun.  But, more significantly, any debris on the road surfaces dries and can blow away; it doesn't accumulate.  On the other hand, minor roads in woodland accumulate wet woody debris which doesn't dry out; and then water running off these roads is forced into the road-side where it erodes the surface. 

So, thinking of these observations made me consider those questions of repair or resurfacing, especially for those single-track minor roads.  I suspect that the answer is that nobody has models for it, and work is simply carried out on the basis of inspections and reports from road users.  But there is a student project here for someone.

Optimal portfolios and "diworsification"

Among the mathematical techniques that Operational Research scientists use is Quadratic Programming (QP).  It isn't often included in introductory courses, partly because it is hard to devise simple examples for classroom use.  I suspect that most courses including QP use portfolio optimisation as their introductory example.  This assumes that an investor has a finite sum to invest, and can divide it between a set of investments.  A great deal is known about these investments; the expected return on each, and the variance of each return, and the covariance of the returns between the investments.  Given these data, the expected return of the portfolio is a linear function of the decision variables (amount put into each investment).  The variance of that portfolio is a quadratic function of the same variables.  Then the simplest model is to minimise the variance subject to a constraint on the return.  Since this model was put forward in the research literature in the mid-20th century, it has been widely copied, criticised and developed.  The assumptions have been questioned, particularly the belief that one knows so much data about the investments, and the belief that the distribution of returns follows a normal distribution.

I read somewhere that the proponents of these models do not use their models in their investment holdings; does anyone know if this is so? 

Recent studies by financial analysts have looked at theoretical investments to investigate the effect of the number of alternative investments on the variance of the return, and - as one might expect- the more possible investments, the smaller the variance.  For variance, read "risk".  But, and this seems intuitive, the variance tends to a limit, so that adding one new investment to a choice of five has much more effect than adding one new one to a choice of fifteen, and that in turn has more effect that adding one to a choice of twenty-five.  The phenomenon has been named "deworsification", a portmanteau word combining diversification and worse. 

Analysts claim that once a stock portfolio reaches 20-30 holdings, there is little additional benefit to be gained from adding even more holdings.  Furthermore, a financial manager would like to have the chance to switch holdings, so as to grasp "investment opportunities", and the size of a holding in  a larger portfolio would not be enough to do this.  So there is another psychological advantage to this composition of holdings. 

Discovery of the term "deworsification" made me wonder whether specialists in QP had been involved in the studies mentioned above.  One of my memories of QP models of portfolios is that the optimal solution often occurs at a flattish region of the objective function, so the optimal mix can be varied from the theoretical optimum without significant effect on the "risk", and this phenomenon ties in with the idea of "deworsification"; changing one decision variable from its optimal value to zero (taking it out of the model) has little effect on that measured "risk". 

For many small investors, unit trusts are the way  to start.  Most unit trusts have more than 30 holdings, so they probably could have fewer holdings without serious effect on performance.  But, would a small investor be willing to put money in such a unit trust?  I wonder.

Friday, 29 May 2015

Operational Research, psychology and bus fares

Tina and I use the bus service of Devon to travel several times a month, sometimes when we shop in the city centre, sometimes when we want a walk and the bus is a convenient means of transport.  In the UK, there is a concessionary bus travel scheme, so that we have free passes on most bus services after 9:30am on weekdays and at any time at weekends. 

This is not the sort of bus that we use, in Devon or anywhere else. 
We were waiting for a bus in Somerset (county town Taunton) earlier this week, when we noticed an advert for the local service "go anywhere" tickets.  And we were fascinated by the prices charged.  Clearly, somebody had done some calculations about how to encourage bus use by making the offers attractive.  Behind the figures are some models and some adroit psychology.  So, here are the figures.

Go anywhere for one day: Adult £10, Child £5, Family (2 adults and as many children as the parents want to look after) £20
To interpret these a little more, no return bus fare in Somerset can exceed £7.50, even if the journey needs changes of bus service.  Within Taunton, return fares on one bus service cost £3 maximum.  And one needs to know that the bus services radiate outwards from Taunton

Go anywhere for one week: Adult £15, Child £7.50, Family £30
Go anywhere for one month: Adult £55, Child £27.50

So a go anywhere ticket for one day has been priced at less than the maximum of two return journeys.  It is likely to appeal to someone starting in Taunton who needs to make two or more journeys out of the county town, or to someone who likes bus rides.  The appeal to the holidaymaker or shopper is small; such a customer will probably only make one return trip per day ... but the price may encourage the faint-hearted to take the bus and save on fuel for a car and car-parking charges

But a go anywhere ticket for a week has been priced to encourage commuters and holidaymakers to use the buses.  Commuters (five days per week or less)  within Taunton will not get an advantage, but those from outside will do so.  Holidaymakers and shoppers will be able to use the bus service on two or more days and benefit (even more if fuel and car park charges are considered), and the family ticket has been priced to treat all sizes of family equally. 

The clientele for the go anywhere monthly ticket is likely to be regular users of the service, so the price has been set to give a small discount over the price of four weeks' weekly tickets.  Holidaymakers don't stay for four weeks.

How does the bus company benefit?  Once the bus timetable and route has been set, income from passengers is mostly marginal income.  The cost of running an empty bus from A to B is a little less than running a full one, so the company benefits from every ticket sold.  So it is in their interest to maximise the number of passengers, and offering incentives such as the weekly ticket, and (less so) the daily and monthly tickets, will increase the number of customers.
Nor is this a local bus in Devon or Somerset
I have identified three customer types: commuters, shoppers and holidaymakers and they have different behaviour and needs, and hence the psychology of charges will differ for them.  I wonder if there were three models (even mental models) or more?  However many, I salute "the buses of Somerset" for their work, their financial O.R. and their psychology.

Monday, 18 May 2015

Modelling a yacht race

English schoolchildren these days are assessed in examinations at the ages of 15-16 and 17-18, now known as GCSEs (General Certificate of Secondary Education) and "A"-levels.  In my youth I was examined by "O"-levels and "A"-levels (Ordinary and Advanced).  I remember very few aspects of these examinations  One exception is a question in mathematics, as it was thought-provoking.  "Assuming that a yacht's sail deflects the incoming wind as in a mirror, explain why the angle of the sail affects the speed of the yacht"  Quite obviously it was a matter of vectors of force from the wind against the sail and the resistance of the water on the hull.  But this question was different from the usual questions in books, where the forces were acting on idealised objects ("a pendulum on a rod of negligible mass ... ", "a perfectly smooth bead is on a wire ... ")

I hope that the examiner realised that this question would make the examinees pause and think, and allowed extra marks for the time that this might take; and I wonder if other students can remember the question so many years later.  (I have two other memories of that year's examinations - one that I realised ten minutes after a mathematics paper that I had subtracted 530 from 600 and got the answer 50;  the other that in a physics practical involving the cooling of water, I had poured my water away before measuring the volume - so I quickly measured the warm portion of the container, refilled it to the same depth with cold water and measured that, thus getting an answer which was "near enough".)

In the May issue of the Journal of the Operational Research Society, Robert Dalang, Frederic Dumas, Sylvain Sardy, Stephan Morgenthaler and Juan Vila describe how they modelled the forces acting on a racing yacht to determine the optimum course for that boat in the America's Cup races in 2007.  It was rather more sophisticated than my few lines on the "O"-level script in the 1960s. 

Stochastic optimization of sailing trajectories in an upwind regatta appears in the Journal of the Operational Research Society(2015) volume 66, pp 807–820,doi:10.1057/jors.2014.40 (abstract: In a sailboat race, the navigator’s attempts to plot the fastest possible course are hindered by shifty winds. We present mathematical models appropriate for this situation, which use statistical analysis of wind fluctuations and are amenable to stochastic optimization methods. We describe the decision tool that was developed and used in the 2007 America’s Cup race and its impact on the races.)

As the abstract points out, the winds are not constant in direction or strength.  Therefore, the model needs analysis of the past variation as well.  One simplification (realistic) was to model the first upwind leg of the race, as the yacht that leads at the first turn is likely to stay in the lead.  In the paper there are diagrams "Boat polars" which would have been useful in the "O"-level; they show the velocity of a selected boat in a wind of given speed and with the course set at a given bearing.  These lead to the optimal bearing for the wind speed.  The paper discusses tacking (changing the direction of the boat when going upwind) and the choice of whether to start on a left-hand tack or right-hand tack.  And then this feeds into an optimisation model which uses a discrete space for the progress of the yacht.  

Boat polars for a given speed of wind showing (on the right) the optimal course to maximise speed against the wind (from the cited paper)

All well-worth reading.  Towards the end of the paper there is a wistful comment:
Given that the Swiss team implemented our strategy software into their onboard computer system, trained to use it, and finally actually won the 2007 America’s Cup race, we can consider that stochastic optimization techniques were useful to the team. However, since a typical team’s budget is on the order of 100 million dollars, it is clear that a team of a few mathematicians only makes a small contribution to the overall effort.

With hindsight, how much should the mathematicians (O.R. scientists) have charged for their services?

Thursday, 7 May 2015

Comparing apples with oranges

Long ago, teaching a course on the statistics of surveys, I reminded my classes, repeatedly, that they should make sure that the comparisons that they made between results were rigorous.  If not, the saying goes, you are in danger of "comparing apples with oranges".  The point is that the underlying populations, and the measurements on them, should be comparable.  Apples and oranges are different fruits, grown in different countries, and their agriculture is different.  So, to be ridiculous, one could not measure the cost of producing one orange with the cost  of producing one apple, because one could not grow oranges in an apple orchard and vice versa.

So, today, an advert on a bus in Exeter caught my eye.  "More people see bus advertisements than use social media daily".  Apples=People see an advert on a bus in the course of ... how long?  The text suggests "in a day".  Oranges=People using social media daily.  Measurement in both cases=total number. 

My interest was aroused.  Not everyone who sees an advert on a bus will read it.  Very few will have gone out of their homes saying "I really must read a bus advertisement today".  But people are purposeful when they use social media.  Measurements on apples are not measurements on oranges.  I managed to find estimates of the number of daily users of social media in the UK.  It is roughly 20 million but may be as high as 25 million.  So how many people see a bus - let alone a bus advert - daily?  Guesstimating that number suggested that a figure between 15 and 25 million would be about right, knowing the population of the UK, and the working population who would be commuting and might see a bus.  So the two numbers are in the same ballpark - if the bus advert figure is for daily sightings. 

That was when my search found the website of the company making the claim.  There I found the claim:
30 million people have seen advertising on the outside of a Bus in the last week  - See more at:
30 million people have seen advertising on the outside of a Bus in the last week  - See more at:

 30 million people have seen advertising on the outside of a Bus in the last week

Aha!  the time scale for apples is now a week.  (And why write "Bus" with a capital "B"?)  My guesstimate is reasonable, since one can assume that in seven days, some people will see adverts on several days, while others will see them on one.

I hope the thousands or millions who see the advert that I saw this morning will recognise that you can't compare random exposure to an advert on a bus in one week with purposeful use of social media.  If they don't, then they shouldn't be entrusted with buying apples; they might buy oranges, or grapes, or tomatoes!
30 million people have seen advertising on the outside of a Bus in the last week  - See more at:
30 million people have seen advertising on the outside of a Bus in the last week  - See more at:
30 million people have seen advertising on the outside of a Bus in the last week  - See more at:
30 million people have seen advertising on the outside of a Bus in the last week  - See more at: