The world’s leading publication for data science, AI, and ML professionals.

Donuts & Coffee Meet The City Economy

Mathematical Scaling in Canadian Fast Food Service

If you know Canada, you know there is a peculiar relation to Tim Horton’s: a chain of fast food stores, known for cheap coffee, quick breakfast meals and sinful donuts. There is more to the relationship though than a steady supply of dietary calories. Case in point: a news story about a man punching a cougar attacking his husky in Red Deer, Alberta, is declared peak Canadian only once we learn the event took place at a Tim Horton’s.

To put it simply, this brand of fast food restaurants has a special place in the Canadian fabric.


In what follows I use Tim Horton’s store location data in order to obtain a view of scaling in the urban consumer economics. A rather simple data set, but one that opens a view into the abstract qualities of the economy of the city, and practically can serve as a basis for a proxy for business growth.

Number of Stores and Cities & Provinces

At the time of the writing of this article, there is a total of 4,258 Tim Horton’s locations throughout Canada. With nearly 37 millions in Canada, there are therefore about 8,700 residents per store.

In the graph below the number of stores in relation to the population of census metropolitan areas as of 2017 is shown.

Number of stores in census metropolitan areas; color by province, including pink=Ontario, grey=Quebec, orange=British Columbia, blue=Alberta, green=Manitoba, yellow=Saskatchewan, brown=Nova Scotia, red=New Brunswick.
Number of stores in census metropolitan areas; color by province, including pink=Ontario, grey=Quebec, orange=British Columbia, blue=Alberta, green=Manitoba, yellow=Saskatchewan, brown=Nova Scotia, red=New Brunswick.

The scatter-plot is not revealing much information, other than that there is one very large metropolitan area in Canada, the greater Toronto area, with second and third place going to Montreal and Vancouver, respectively.


It has been generally discovered that metropolitan sizes follow power-law relations, rather than linear relations. That is a mathematical way to say that population sizes relate to each other by repeated multiplication of a common factor, rather than the repeated addition of a common term. For example, the relative size of the population of Vancouver (third largest) to that of Montreal (second largest) is 62%, and at the same time the relative size of Montreal to that of Toronto (the largest) is 65%. In other words, the multiplicative factor is nearly identical.

This illustrates a statistical relation for the collection of metropolitan centres of Canada. The general observation is labelled Zipf’s law. It has been discussed at length [here](https://www.nature.com/articles/srep00812), here, and here, so I will not dwell on it any further.

Instead, the insight of a multiplicative relation can be used to transform with the logarithm the earlier graph into something more informative. The data on the x-axis and y-axis are hereafter transformed by the logarithm, base 10.

Provinces With Different Market Qualities

Now we can start to discern useful relations.

Log number of stores in census metropolitan areas; color by province, including pink=Ontario, grey=Quebec, orange=British Columbia, blue=Alberta, green=Manitoba, yellow=Saskatchewan, brown=Nova Scotia, red=New Brunswick.
Log number of stores in census metropolitan areas; color by province, including pink=Ontario, grey=Quebec, orange=British Columbia, blue=Alberta, green=Manitoba, yellow=Saskatchewan, brown=Nova Scotia, red=New Brunswick.

The plot shows a greater population is associated with more Tim Horton’s locations. Hardly surprising, but with a twist, as described in the next section.

Before that, a data segmentation presents itself. The grey and orange markers in the graph are all clearly below a linear trend line we otherwise can imagine for the other markers. The two distinct types of markers denote the francophone province Quebec and the most westward province British Columbia, respectively. In British Columbia it is known that Starbucks has a bigger market-share, and Quebec is in many ways, intentionally or not, different from the rest of anglophone Canada.

There is something qualitatively different in these two markets as they relate to Tim Horton’s at least. For now, the data is sliced to disregard these markets, but I will return to them.

Observation: Size Discounting

What then remains fits remarkably well to a linear relation (r-squared 0.94).

Log number of stores in census metropolitan areas, Quebec and British Columbia removed; color by province, including pink=Ontario, blue=Alberta, green=Manitoba, yellow=Saskatchewan, brown=Nova Scotia, red=New Brunswick.
Log number of stores in census metropolitan areas, Quebec and British Columbia removed; color by province, including pink=Ontario, blue=Alberta, green=Manitoba, yellow=Saskatchewan, brown=Nova Scotia, red=New Brunswick.

But a twist: The slope is 0.81. The precise equation reads:

The value of the slope says something important.

This is a logarithmic scale, so we should think in terms of multiplications. For example: double the population of a metropolitan area, in other words multiply the N_population by 2, which in the graph is the same as a step of about 0.30 to the right anywhere along the x-axis, and as a consequence, the value on the y-axis increases by about 81%, not the full 100% as straight-forward doubling would have it. There is a constant size discounting.

What is remarkable is that the discounting applies across all metropolitan areas. To put it differently: some underlying quality of the consumer and supply market of which Tim Horton’s is part of, changes between Thunder Bay and Kitchener-Waterloo as much as the same market quality changes between Kitchener-Waterloo and Toronto, such that the number of locations is predictably discounted.

Intentional or Emergent, Special-Case or General?

So have I reversed engineered the equation senior management at the Tim Horton’s headquarters slavishly follows that implies fewer locations per person in more populous urban centres? Unlikely. But I also refuse to believe the senior management is simply throwing darts to settle decisions. At some point, a deliberation have taken place, and an intentional decision about something was made.

The structure in the graph can rather have emerged from an accumulation of multiple individually deliberate economical decisions, and from that aggregated form of intentions, the observed structure appears as if there was an unseeing selective force felt in the city. As urban areas grow organically under pressure to perform economically and sustain their growing and otherwise changing populations, certain qualities of the supply network of products and services proliferate under a host of, but mostly common, limits of any growing Canadian city.

Diverse human activity constrained by present technology, psychological desires, regulation, political and cultural legacy, and sure why not, quantum mechanics, have come together to create something any single instance of deliberation have not intended.

Well, at least with respect to the supply of Tim Horton’s cheap dietary calories. In the last decade, however, similar scaling relations have been studied across other types of urban supplies. Number of gas stations and number of car-dealerships in European metropolitan areas are also size-discounted by about the same exponent as Tim Horton’s locations. Some products and services are instead found to scale in an accelerating fashion with urban population, number of filed patents being one. Additional examples exist in the literature, and after this article we have one more: number of Tim Horton’s locations.

To reuse a cliche: the whole of an urban population is greater than the sum of its parts, but where the whole is increasingly different as more parts are added to the mix.

What is the mechanism for an organizing force like this to appear? That is a matter of causal predictive inquiry. Superbly interesting, but a grand topic for another time.

What About BC and Quebec and Proxy for Market Growth?

British Columbia and Quebec were removed from the earlier consideration on grounds that their Tim Horton’s economies are distinct. Time to bring these provinces back and ask: what would the right number of Tim Horton’s locations be if the company successfully captured the same share of the market as elsewhere in Canada?

First, compute the difference between observed number and the fitted line, second convert the logarithm to number of locations. The table below shows for four metropolitan areas in British Columbia and Quebec how many stores that would have to be observed in order to conclude that an comparable market share has been captured.

If scaling with population was neglected, an incorrect difference between present and target state would be obtained.


A proxy metric for Tim Horton’s ability to maintain market-share can be constructed as well. To illustrate: In the five years between 2011 and 2016, the population of the greater Toronto area grew about 6%. Because of the size discounting, assuming constant market-share and fixed business model, the number of Tim Horton’s locations should have grown by about 4.8%. If actual growth in that time deviated from this number, we could make an educated guess about change in the market. The magnitude of the effects of new legislation, new competition or altered trade-relations can with appropriate population size discounting be discerned from future data.

Because of its special place in the Canadian fabric, relatively simple data on the geography of Tim Horton’s restaurant locations, have in combination with knowledge of power-laws, opened a view into universal qualities of the urban economy in Canada. A meaningful hypothesis, a bit of Data Science, and fun insights can be won.

Claps are currency. If you found this worth reading, be kind and press the button.

Footnotes

Tim Horton’s locations taken from [[here](https://www.goodreads.com/book/show/31670196-scale)](https://open.canada.ca/data/en/dataset/6bbe2840-38ec-446c-875a-a4ae30cfc006). Canadian census population data taken from here. Visualizations done with Tableau. Recommended popular reading on scaling relations here. Disclaimer for the conspiratorial reader, I have no affiliation with Tim Horton’s, its competitors or suppliers, I only eat breakfast there at times.


Related Articles