Induction and the Coronavirus

Coronavirus Update

Starting on March 27 the Santa Clara Department of Public Health began publishing a graphic showing the number of cases of COVID-19 in the county. Along with that graph, the county website also has a number of other demographics about the populations affected by the disease. Since one reason I started this blog was to publish a graph of the history of daily cases, I will not be updating my graph so frequently.

One statistic that the county’s website does not publish is any projection of the future number of cases. I think this is a good idea as it is difficult to forecast future cases, and any forecast would be based on a probabilistic model. Furthermore, with a favorable projection, the public may become more lax in their measures to protect themselves and the community which could lead to a flare-up of new cases.

I will still provide my projections just to see how they track with what actually occurs. In my last post, I noted an increasing slope in the linear trend of rate of increase of daily cases. The trend was a decreasing trend, so I am adding a projection based on a logarithmic decrease instead of a linear decrease. Since a logarithmic rate decreases more slowly than a linear one, this might fit the actual data trend more closely.

Here is the graph for the daily cases with both the linear and logarithmic trends.

Surprisingly, the logarithmic and linear trends have a very similar projections for future cases. Using a 2-week moving average of the daily cases though shows a more pronounced difference:

It is encouraging that the actual number of cases is tracking these projections, and that the number of daily cases peaks in early to mid-April. However, one must keep in mind that I am trying to fit a curve to data, with no underlying reason why that curve should be the one the data follows. An epidemiologist would be more qualified to suggest likely curves to use to forecast the number of future cases.


This type of reasoning, using data for the past instances of an event to predict future outcomes, is called inductive reasoning or induction. The problem with using induction with data which seem to fit a pattern to predict subsequent values is that, even if the actual outcomes of a series of events form a number pattern, there are an infinite number of patterns that begin with any given pattern. Of course, some patterns are more common or more recognizable than others, but frequency or familiarity of a pattern does not mean that the pattern is the pattern of the actual data.

The prototypical math problem where matching a pattern to a subset of cases of a problem fails to produce the correct results for the general problem is this:

Place n points on a circle and draw all the line segments that connect any two of the points. The points are placed such that no three of the segments intersect at a single interior point. Into how many regions do the segments divide the circles interior?

For example, if n=4, then the picture would like the diagram below, and the answer would be 8 regions.

If you start to tabulate the answers for small values of n, you find:


Can you fill in the missing answers?


Hoarding and the Prisoner’s Dilemma

Santa Clara County Coronavirus update

With a few more data points, instead of using a 5-day moving average, I will be using a 2-week moving average to project future cases.

With that said, here is the latest graph of the daily rates of change in the number of cases each day:

One important and dangerous sign is that the red line has become more horizontal since my last post. If the red line is horizontal, the daily rate of change is constant meaning an exponential growth in the number of cases.

The green line shows the trend in the 2-week moving average. The hope is that this is closer to the future daily rate of change. The effect of the red line being nearly horizontal vs. the slightly faster rate of decrease of the green line, scan be seen in the projections shown in the graph below.


With many stores running out of supplies such as toilet paper, hoarding has become a problem. Assuming that there is a reduced but sufficient supply, then hoarding may cause an actual shortage and result in an insufficient supply. Fear that others may be hoarding toilet paper may cause you to be a hoarder too. The choice of whether to hoard toilet paper or to buy your normal quantity is akin to the problem known as the prisoner’s dilemma.

In the classic prisoner’s dilemma two persons working in partnership are caught committing a crime and arrested for it. The police do not have enough evidence to convict both for the maximum penalty of five years in prison, and without a confession from one of the prisoners, the police can only convict the prisoners for a lesser offense with a prison term on two years.

So the police offer each prisoner a plea deal where if he rats on his partner and his partner stays quiet, i.e. does not rat on him, the prisoner will be set free while his partner will be sentenced to the maximum five year sentence. If both rat on each other, then they will both be sentenced to three years. This offer is made to each in secret and the prisoners are unable to communicate.

From the point of view of the prisoner, if he stays quiet and does not rat on his partner, he will be sentenced to two years if the other prisoner also remains quiet, or five years otherwise. If he rats on his partner, he will be set free if his partner stays quiet, but will be sentenced to four years otherwise.

This can be shown in a payoff matrix:

PrisonerQuiet2 years5 years
Rat0 years3 years

The prisoner can reason that if he rats on his partner, he will be better off no matter what his partner does. He therefore rats on his partner.

However, his partner reasons the same way and they both end up ratting on each other. This results in each receiving three year sentences. But if both had remained quiet, both would have spent only two years in prison Thus, even though each prisoner chose the best option for himself, both did worse than they could have had they chosen their other option!

How is this related to hoarding toilet paper? Assume that when you shop for toilet paper you buy a two-week supply. You might imagine if the rest of the world or at least a large number of people are hoarding toilet paper, you may not be able to get any. So when you find toilet paper, you may either buy your usual two-week supply, or you may become one of the hoarders. Being a hoarder means that you go out earliier than you need to and buy more than you need, say a four-week supply. If the rest of the world is buying their normal supply, then there will be enough for you to buy four-week supply. If the rest of the world is hoarding the paper, you may have to search many stores and at best, a one-week supply.

The payoff matrix may look like this:

Rest of the World
Normal BuyHoard
YouNormal Buy20

Just as in the prisoner’s dilemma, you can reason that if you hoard toilet paper, you are always better off than if you buy normally. And like you, the rest of the world can reason the same way resulting in everybody hoarding toilet paper. The end result is that while some people may succeed in building up a four-week supply (the early hoarders), you and many others end up with a one-week or smaller supply. And if everybody stuck with their normal buying pattern, everybody would have a two-week supply.

This is obviously an oversimplification of the problem, but I think it lends some insight into why instances of toilet paper hoarding has been popping up during the pandemic.


A Glimmer of Hope

If you’ve been following this blog, you’ll know that I am tracking the daily number of cases of COVID-19 in Santa Clara county and showing the results graphically. Now that I’ve tracked the number of cases of COVID-19 for about three weeks, I am going to base my projections of future cases on the trend of the rate of increase rather than on the most recent daily rate of increase. This is more realistic than assuming that rate of increase will continue unchanged over time.

Here is a graph of the rates of change of the number of daily cases of COVID-19 that shows the trends in these data:

The blue line in the graph tracks how the rates of new COVID-19 cases changes daily, while the gold line is the 5-day moving averages of the daily rates. One of the reasons for computing the moving average is that it “smooths” out the data; in this case it makes it easier to see a downward trend in the rate!

If, and this is a bigif, we assume that the rate changes approximately linearly (i.e. follows a line), we can use a linear regression to estimate what that line is. The line for the moving average is shown in green, while the daily rate’s line is shown in red.

In the graph below I use the trends and the assumption of approximately linear change of the rates to project the number of future cases:

Notice that if we can keep up the trend in the 5-day moving average, the curve is noticeably flattening! While this model depends on the assumption of approximately linear change in the daily rates of change and does not predict future results, it does show one possible future outcome.

If we can only continue this trend…


A Good Read for a Mathematician Caught in a Pandemic

Before I talk about today’s topic, here is today’s Santa Clara county Coronavirus update:

The 5-day moving average of daily new cases remains about 1.5%.


During the shelter-in-place hours at home, I have been catching up on reading. In order to perk up my spirits I’ve been doing more light reading than I usually do. I’m currently reading Plato and a Platypus Walk Into a Bar… by Thomas Cathcart and Daniel Klein. It’s a highly entertaining exposition of topics in philosophy exemplified through jokes. Philosophy topics often overlap with mathematics. I have been interested in not only the common areas of philosophy and math, but in philosophy in general. Although I haven’t studied philosophy to any great depth, I enjoy reading about philosophy and pondering its many questions and answers. For me, this book’s light approach to philosophy make it the perfect read during these uncertain times.

One of my favorite jokes in the book comes in the discussion of free will versus determinism. I finish today’s post with the joke (taken verbatim from Cathcart and Klein) and hope it brings some cheer to your day:


Hello from the Fun Math Club!

With the onset of the Coronavirus pandemic, I find myself in the office (my home) with time to do things I haven’t had time to do before. Although a blog was very low on my to-do list, I decided to start one so that I can eventually talk about Fun Math Club plans, thoughts, and other math-related topics. However, the primary motivation for starting this blog arose a few days ago. I was trying to find out how fast COVID-19 was spreading in our community, Santa Clara county, but I couldn’t find a source on the web that historically tracked the data. So I searched for posts over the last month and pieced together data starting from Feb 28. The chart below shows the status as of today, Mar 22.

The projection is based on the most recent 5-day moving average of percent daily increase in COVID-19 cases (as reported by the County of Santa Clara Public Health Department). This graph is a grim reminder of the absolute urgency to flatten the curve. If you’re not convinced by the graph above, consider this: at the current rate of increase by end of April, there would be more than 50,000 cases in Santa Clara county. On the brighter side, the data may also overstate the growth rate due to a lack of testing. I certainly hope so.

Since I haven’t seen this graph for Santa Clara county, I decided to start my blog to provide a medium to share the graph on a regular basis (daily or as time/memory permits) so that others can see how our community is doing fighting the pandemic spread.

I end today’s post with two pleas and a wish: follow shelter-in-place guidelines, social distance, and stay healthy.