Curious Cook: The maths behind eating


When a favourite place persistently disappoints, it risks a downgrade on the Gittins Index (Gindex). — WILD LITTLE THINGS PHOTO/Pexels

This year’s first column begins with the candid admission that my annual predictions about dining trends have often missed the mark. Far from eating more insects as suggested a few years ago, people remain mostly turned off by bugs, even today.

So, this year I offer an investigation of some mathematics that influence our dining choices. Maths in dining applies to you probably more than you know, even though you may be an individual with uncommon tastes and dining priorities. It is also fun to understand how and why people make certain food choices, and by knowing this, it may even be possible to sway the dining choices of others.

Decision theory

Choosing a meal is an example of decision theory in action. It is certain many professional restaurants apply various decision theories in their marketing and menus, and the theory most used by professional food venues may be something called the Gittins Index (GIndex).

Picking a dinner menu may seem far removed from the stochastic (or indeterminate pathways) mathematics used for estimating the GIndex, but it will make sense, if you bear with me.

Decision issues

In 1979, John Gittins wrote a seminal paper titled ‘Bandit Processes and Dynamic Allocation Indices’ where he expounded on two basic issues involved in making decisions, which are namely (i) the scheduling problem, and (ii) the multi-armed bandit problem. Note that in food terms, the rewards are always positive dining experiences, and not monetary payouts as used by Gittins.

In dining, the scheduling aspect considers factors like ambiance, location, and service quality – essentially everything that contributes to a pleasant dining experience, apart from the food itself. Meanwhile, the multi-armed probability focuses on the menu variety and ingredient quality that determine your enjoyment level.

The data from both the scheduling and multi-armed probabilities are used to create Dynamic Allocation Indices (DAI) where the enjoyment probabilities become clearer the more times each venue and/or dish are visited. From the DAIs, the GIndex is calculated for each venue/dish once sufficient data is available.

And this is when things can get a bit weird.

Venues and dishes with high success rates have correspondingly high GIndex values, naturally. People would normally prefer to return to their favourite restaurants to eat their preferred dishes, and this is no maths secret.

However, if a previously good venue or dish disappointed, especially several times in a row, then what happens next is curious and not necessarily intuitive. The reason is that a venue or menu which one has fancied but NEVER tried always starts out with an assumed GIndex which is HIGHER than the mean GIndex based on past experiences in ALL other places.

A menu which one has fancied but NEVER tried always starts out with an assumed GIndex which is HIGHER than the mean GIndex based on past experiences in ALL other places. Photo: FAKHRI BAGIROV/PexelsA menu which one has fancied but NEVER tried always starts out with an assumed GIndex which is HIGHER than the mean GIndex based on past experiences in ALL other places. Photo: FAKHRI BAGIROV/Pexels

This is because there is little or no data to derive a proper GIndex for new venues and menus. The higher-than-mean estimation follows the assumption that, given a choice, one would not choose to eat anywhere which is expected to be worse than the average GIndex of all past experiences.

As such, a favourite venue which persistently disappoints risks a GIndex downgrade quite quickly, which then confirms its losing status. This then opens the door to other competitors, even ones which may never have been tried because less information means a higher probability of winning, whereas the old venue is now a definite loser.

Exploitation vs exploration

At all times, professional restaurants constantly promote revamped/upgraded services and menus, and new restaurants may flaunt fancy decors and advertise using references to inventive dining choices. These strategies capitalise on pushing new/innovative services and menus where a GIndex has not been set for many people.

The weird part is that even where the GIndex of a venue is relatively high, say, over 70%, a new untried venue or menu would often score higher than that. This is because of the “exploit” and “explore” nature of dining.

In normal circumstances, one may be inclined to exploit known venues and menus where the GIndex is high, as such options are safely satisfying. However, humans are often keen to explore new unknown food experiences, and a well-advertised or heavily recommended choice may prove irresistible when the mood is to explore. It is similar to the idea that the “grass is always greener on the other side”, and that is always persuasive until we find out for certain.

Gittins’ limits

The GIndex is dependent on a sizable amount of data to become statistically relevant, so it is usually of limited utility with idiosyncratic personal information or a limited number of assessments. It is also affected by other factors such as price.

A venue or menu which has increased prices past a tolerance threshold would automatically cause a drop in the GIndex. Reading numerous negative public reviews or complaints would also likely influence the index.

Fewer regrets

To overcome the data-heavy requirements of computing a Gittins Index, two mathematicians, Herbert Robbins and Tze Leung Lai, devised simpler algorithms based on the concept of “minimalisation of regret”.

It is a clever strategy and is based on three main assumed points. The first point is the total sum of regret will never stop increasing even if you picked your optimal GIndex options. This is because there is always the possibility that even better options exist. Second point is that regret increases at a slower rate if you had originally picked the best options – this is self-evident. The third and final point is the minimum possible amount of regret would increase at a logarithmic rate.

This third point is significant, because logarithmically increasing regret means that we make as many mistakes, for example, in the first month as in the next nine months, and we make as many mistakes in the first year as in the rest of the decade. In real life, this is not always true but according to a regret-minimising algorithm, the assumption is we would expect to have fewer regrets over time. And this matters a lot.

Confidence intervals and upper bounds

When data is analysed, it is common for statisticians to define “confidence intervals” or the widest range a data sample can have relative to some metric. In food terms, this range measures the relative enjoyment or otherwise of a meal at a venue.

As more data arrives, such confidence intervals will shrink into tighter bands to reflect more accurate assessments. So, a restaurant that had satisfied one out of two times would have a wider confidence interval than a restaurant that has satisfied 10 times out of 20.

The probability of a good meal is the same for both, at 50%, but the “Upper Confidence Bound” (UCB) of the restaurant with just two tastings will be higher as it has the “potential” to be better than the other restaurant.

Even based on probability of good food, with only two previous tastings, a third good meal there would raise its good dining probability to 66.66%, a jump of over 33% in one visit. The impact of another good meal in a restaurant with 20 previous tastings is much less.

In mathematical terms, it can be said newer venues appear more promising simply because there is less data to confirm that they may be bad.

Therefore, in a logarithmic regret-minimising world, the chances of a restaurant getting “worse” after many samples becomes less likely as one would naturally not choose to eat bad food, especially at the beginning.

But such venues would also be bound by tighter better-known confidence intervals which fluctuate less over time due to their logarithmic nature. Note that if all venues are well-known, people will gravitate only to places with the highest confidence levels because that minimises regret.

However, when a restaurant is relatively new, the UCB is higher, because there is insufficient data to assign relevant confidence intervals. In short, the UCB reflects “optimism in the face of uncertainty”, and if data remains skimpy, people will base their choices on higher UCBs because there is always hope the food would be better. It is a uniquely human expression of culinary optimism or adventurism.

Venue and dishes with high success rates have high Gindex rates. — DBALER/PexelsVenue and dishes with high success rates have high Gindex rates. — DBALER/Pexels

Note that culinary optimism also applies to food cooked at home too, as nobody sane would ever choose to shop and pay for ingredients to cook a bad meal at home.

Using a regret-minimising strategy is much easier than computing the data-intensive GIndex because all one has to do is note the number of times various venues have provided a good time and/or served good food. As these are personal, idiosyncratic assessments, it should be relatively easy to persuade other dining partners to choose a preferred venue by appealing either to their sense of optimism (and adventure), or their perceived confidence levels.

So, maths can explain why we gravitate toward familiar food options, even while our curiosity and optimism are also compelling us to try newer experiences. Understanding these dynamics helps us appreciate and even enjoy the intricate dance between familiarity and exploration in our culinary choices. A comfortable dinner at a favourite restaurant – or being a fickle food lover – can both be delicious, and now we know why.

Example of using the maths

Make a grid on a piece of paper or spreadsheet and list all the restaurants you have tried or would like to try on the left-hand column. Then on the right-hand side, in more columns, list the scores or rankings of each restaurant you have tried. Whenever you feel like it, total up all the scores and divide this by the number of times you dined out to derive the mean.

Now review the restaurants you have not tried or tried only infrequently. For each such restaurant, estimate whether it can potentially score higher than the mean. If so, you should naturally be curious (or optimistic) enough to try it. The “normal” dining choices will always be the existing ones with the highest scores.

The views expressed here are entirely the writer’s own.

Follow us on our official WhatsApp channel for breaking news alerts and key updates!

Curious Cook , Chris Chan , dining choices

   

Next In Food For Thought

Enjoy the health benefits that come with a cup of coffee or tea
Curious Cook: Unwrapping Christmas
Curious Cook: Iron-rich culprits
Curious Cook: Ageing and the citrate connection
It’s how you consume sugar that affects your heart
Curious Cook: Seedless watermelons and other stories
What’s so good about oatmeal?
Curious Cook: A tale of two vitamins
Why is eating healthy so difficult?
Curious Cook: Chocolate, but not as you know it

Others Also Read