Blog

Still Going (Daily COVID-19 data update CCCXXIII)

Graphs day 323, pandemic day 330, day 401 since the first cases were diagnosed.

Total cases of COVID-19 diagnosed worldwide: 103,412,282

Total deaths: 2,232,405

Just a very quick update today while I look into some other trends in more detail. Usual graph formats, click for a larger version of each.

Countries that have consistently gotten it right

Countries where COVID-19 was stayed mostly contained throughout the pandemic

Countries where COVID-19 is currently under control(-ish)

Countries where COVID-19 was bad but are now sort of under-control-ish

Countries moving in the right direction(-ish)

Regions where cases are still high but are currently stable

Countries where the pandemic is still awful

Regions where the epidemic is still raging

Fortunately, even in these countries, cases are beginning to decrease; although in the meantime, Spain has moved ahead of the U.S. into first place on this graph in terms of cases per day.

Methods

Sadly, Corona Data Scraper has stopped reporting data in the way I was using it, so I have gone back to using the data from the JHU Coronavirus Resource Center. You can download the data from their GitHub repository. You are welcome to use my Excel spreadsheet (version 9.2).

Bug Parade: When Gandhis Attack

Sometimes we can learn a great deal about how to do things right from the times when things went wrong. Welcome to a new occasional series: The Bug Parade!

Screenshot from Civilizaiton 1: Mahatma Gandhi, leader of the Indians, says "Very well, we will mobilize our armies for WAR! You will pay for your foolish pride!"
Gandhi attacks

The Civilization series is one of the most enduringly successful computer strategy games of all time. The games let you control a human civilization, starting in 4000 B.C. and guiding them into the 21st century. You control all aspects of your civilization, from military expansion to scientific advancement to keeping your citizens happy. Along the way, you encounter other civilizations and their leaders. You can go to war with these civilizations, make peace, manage alliances, and negotiate with their leaders. The series is one of the most incredibly addictive, just-one-more-turn strategy games ever created.

It all started in 1991 with the original game of that name, now informally known as Civ 1, created by legendary game designer Sid Meier. Nearly 30 years later, the original game still has a devoted fanbase, who not only still play the game but also dig deep into the game’s code to create fan mods to play and share.

Creating a game that people still enjoy after 30 years is an amazing achievement on its own, but it becomes absolutely mind-blowing when you realize that the entire game takes up just 2.6 megabytes of space, less than a single song stored in MP3 format.

Size comparison: the entire game (2.4 Megabytes) against a single MP3 (3.4 Megabytes)

Creating such a complex game in such a tiny amount of storage space necessarily meant that many compromises had to be made – and from one of these compromises came one of the most famous software bugs in history.

In 1991, the Internet had yet to penetrate into public consciousness, and so the idea of playing a game online was still new. Meier knew this, and knew that Civilization presented enough of a design and programming challenge already, so he decided to keep it firmly a one-player strategy game. And that meant that the quality of the game would depend on the quality of the player’s computer-controlled artificial intelligence (AI) opponents. If the AI opponents made good decisions, the single human player could respond to the challenges presented with decisions of their own.

But that was the challenge – how could the game developers make convincing AI for opposing world leaders while making the entire game fit into an absurdly low 2.6 megabytes? All opposing leader decisions where based on a set of simple formulas. Will Hammurabi offer a peace treaty? Check the formula. Will Mao Tse Tung launch a nuclear weapon? Check the formula. And to account for differences between leaders, the input to the formula was a simple scale from 1 to 5, ranging from most peaceful to most warlike: Mahatma Gandhi scored 1, Genghis Khan scored 5.

But there was another game design point to consider. One of the things that made Civilization so groundbreaking was that it had multiple ways to win. You can win by conquering the entire world, by winning the space race, or by having the highest score when the game ends in 2100 AD. To reward the player for sticking around for the modern era, – as well as to reflect historical experience – opponents become less aggressive. Specifically, each leader’s aggression rating drops by two.

But if aggression drops by two, what happens to Gandhi, who already had an aggression rating of one? Logically, his aggression rating should drop to -1, making him even more peaceful than he was already. But if logic prevailed, we wouldn’t be talking about this in a recurring series called The Bug Parade.

Remember that with only 2.6 megabytes to work with, programmers were desperate to save space, so they used every strategy they could think of to make their code use memory efficiently. Since they knew the aggression rating went from 1 to 5, they used only one byte of memory to store the value. One byte of memory can store values from 0 (in binary, 00000000) to 255 (in binary, 11111111). You can probably already see the problem with this.

If the program could only store values from zero to 255, and it had to calculate 2-1, what was it supposed to do? The only thing that made any sense at all was for the odometer to turn over, for the calculation to wrap around, and to return the result 255.

Subtracting 1 from 00000000 (equal to zero) gives 11111111 (equal to 255)
Illustration of an integer underflow error

Thus, as soon as the player discovers Democracy, Gandhi’s aggression jumps to 255.

Out of five.

And so as soon as Gandhi gains the ability to launch nuclear missiles, he immediately launches them at everyone on the next turn, and on every turn after that until he is dead or everyone else is dead.

The bug was never caught in testing, but of course as soon as the game shipped, millions of players discovered it, and it became legend. The bug was quickly fixed in the sequel, but by that point “Nuclear Gandhi” had become enshrined in popular culture.

Memes weren’t really a thing in 1991, but “Nuclear Gandhi” was an inside joke among computer gaming fans for literally decades. And as soon as memes became a thing, Nuclear Gandhi memes became a thing too. Here’s a mashup of Nuclear Gandhi with another famous meme, Der Untergang subtitles:

Coding the game in such a way as to allow a variable underflow error wasn’t even really a mistake, just a design decision that had consequences that were unexpected – and hilarious.

But that’s the nature of the parade – the bugs show up when you least expect them.

I hope you enjoyed this light-hearted introduction to where software bugs come from and what they can do – because when the Bug Parade returns, the next one will be pure nightmare fuel.

400 Days Later (Daily COVID-19 data update CCCXXI)

Graphs day 321, pandemic day 328, day 400 since the first cases were diagnosed. That’s right, it has now been 400 days since Dr. Li Wenliang officially diagnosed the first few cases of the new disease now called Coronavirus Disease 2019 (COVID-19). Just over a month later, Dr. Li had died of the disease.

Today’s sad totals:

Total cases of COVID-19 diagnosed worldwide: 102,579,774

Total deaths: 2,206,445

Remember how we said a few months ago that as we get better at diagnosing less severe cases, the case fatality rate (CFR) would get closer to the biological value, which was likely around 2 percent? The case fatality rate is currently 2.2 percent.

Here are the usual graphs, with countries divided into the same categories as on Tuesday. Countries are color-coded and labeled by name. The thickness of the lines and the sizes of the labels correspond to the case fatality rate in the country – thicker lines and larger labels indicate countries where a larger percentage of COVID-19 cases have led to death. Click on any of the images for a larger version.

Countries that have consistently gotten it right

These countries have consistently kept their per-capita cases of COVID-19 at very low levels.

Countries where COVID-19 was stayed mostly contained throughout the pandemic

When we last checked in last Tuesday, Japan seemed to be in a phase of an increased number of cases. Today, it is much clearer that cases are once again declining in Japan, after having peaked at 40 new cases per million people per day about two weeks ago.

Plenty of people have told me they do not believe the case and death numbers coming out of China. That’s fair enough; there are lots of reasons to not believe China.

But do you believe the case and death numbers coming out of New Zealand, Australia, India, and Japan?

Countries where COVID-19 is currently under control(-ish)

Countries where COVID-19 was bad but are now sort of under-control-ish

When we looked on Tuesday, there seemed to be a slight increase in Chile, Peru, and Canada. The daily case load definitely seems to have decreased in Canada, and seems to be leveling off in Chile and Peru.

Countries moving in the right direction(-ish)

These countries, all in Europe, experienced nightmarish COVID-19 disease waves in the fall – some of the worst in the world – bur fortunately for now have seen cases stabilize at a lower level.

Regions where cases are still high but

The good news is that these three European countries seem to be doing well. Cases continue to decrease in Belgium, Switzerland, and Italy.

The bad news is that Italy is experiencing a wave of sometimes-violent protests against the necessary restaurant closings. If the current protests lead to an increase in COVID-19 cases and deaths in Italy over the next two to four weeks. Obviously I hope they will not, but nature cares not for our hopes. I’ll let you know how it goes either way.

Countries where the pandemic is still awful

Lastly, the countries where the pandemic is still infecting and killing lots and lots of people: Spain, the United States, the United Kingdom, France, Sweden, and Brazil.

Regions experiencing a second wave of cases

Fortunately, even in these countries, cases are beginning to decrease; although in the meantime, Spain has moved ahead of the U.S. into first place on this graph in terms of cases per day.

Methods

Sadly, Corona Data Scraper has stopped reporting data in the way I was using it, so I have gone back to using the data from the JHU Coronavirus Resource Center. You can download the data from their GitHub repository. You are welcome to use my Excel spreadsheet (version 9.2).

Get ON with it (Daily COVID-19 data update CCCXV)

Graphs day 315, pandemic day 322, day 392 since the first cases were diagnosed.

Between The Most Important Election Of Our Lifetimes (TM), the holidays, and preparing for my first-ever virtual American Astronomical Society meeting, it’s been months since I’ve kept my promise to create daily graphs of the global COVID-19 pandemic.

COVID-19 has been busy, and the resulting graphs are almost unbearably sad.

Total cases of COVID-19 diagnosed worldwide: 99,725,495

Total deaths: 2,140,073

There is no silver lining here, I might as well just show you the numbers. In the immortal words of Stringer Bell:

Let’s again take a look at how some different countries are handling the COVID-19 pandemic. As a reminder, graphs show the history of the pandemic from late January 2020 to today – just about exactly one year. Countries are color-coded and labeled by name. The thickness of the lines and the sizes of the labels correspond to the case fatality rate in the country – thicker lines and larger labels indicate countries where a larger percentage of COVID-19 cases have led to death. Click on any of the images for a larger version.

Countries that have consistently gotten it right

These countries have consistently kept their per-capita cases of COVID-19 at very low levels.

Countries where COVID-19 was stayed mostly contained throughout the pandemic

Last summer, we were worried about a wave of new cases in Australia, but looking back on it, per capita cases in Australia are barely even visible on this graph. Joining them on this graph are India (happy Republic Day BTW, enjoy your republic while it lasts!), New Zealand, Japan – and China, even Hubei province where the whole pandemic began.

What do these countries have in common?

You already know the answer to that, even if you like to pretend that you don’t.

Countries where COVID-19 is currently under control(-ish)

Countries where COVID-19 was bad but are now sort of under-control-ish

Last spring and summer we were watching things get bad in Qatar, Chile, and Peru, but they all appear to be doing OK right now – although cases are ticking back up in Chile and Peru. Cases were increasing in Canada but they are now decreasing again.

Countries moving in the right direction(-ish)

Regions where cases are still high but

While we were away, the pandemic got very, very bad in Europe, particularly Belgium. Fortunately, cases are headed down, but they are still far higher than they should be.

Countries where the pandemic is still awful

Lastly, the countries where the pandemic is still infecting and killing lots and lots of people: the United States, Spain, the United Kingdom, Sweden, France, and Brazil.

Regions experiencing a second wave of cases

Fortunately, cases are decreasing everywhere except Spain.

I’ll be here again tomorrow. I’ve promised to keep doing this until the pandemic ends. I hope the pandemic ends.

Methods

Sadly, Corona Data Scraper has stopped reporting data in the way I was using it, so I have gone back to using the data from the JHU Coronavirus Resource Center. You can download the data from their GitHub repository. You are welcome to use my Excel spreadsheet (version 9.2).

Guest Post: Giving Thanks for Data Science

Photo of former Dallas Cowboys head coach Tom Landry in his trademark gray felt hat
Not actually Aaron

Guest Post!
One of the joys of being alive is having smart, curious friends to talk with – or to write guest posts for your blog. I’d love to see more of these, especially from friends with perspectives and opinions different from my own – email me your ideas!

Today it’s awesome friend Aaron Price, who is also the Director of Research and Evaluation at the Museum of Science and Industry in Chicago.

Aaron talks about an important question in today’s age of COVID-19: are people actually following the CDC’s advice to avoid large holiday gatherings?

Because I’m a nerd who works in data for a living, I wanted to see what evidence we have for people staying home this Thanksgiving.

In a widely reported prediction, AAA forecasted a 50% drop in air travel but only a 10% drop in overall travel. But, of course, we have to remember it’s the AMERICAN AUTOMOBILE Association that is saying that AMERICANS are robustly driving AUTOMOBILES this holiday. They don’t cite the source for their forecast, other than to say it was based on mid-October “models.” Even if those unexplained “models” are reliable, they still don’t include the impact of the last six weeks of the fall COVID-19 surge – or the whole prediction could be just a bunch of marketers throwing darts at a board.

Anyway, I looked at Google Trends for the word “traffic” a few days before the 2019 Thanksgiving vs. the last few days. Days on which more people search for the word “traffic” presumably are days on which more people are driving their cars. I graphed the results on the same relative y-axis scale, to place them on the same zeropoint – the vertical axis goes from zero percent (the number of Google searches for “traffic” on the day in which the fewest people searched for “traffic”) to 100 percent (the number the day the most people searched for “traffic.”). The graph is below.

Google searches for the word “traffic,” relative to the number of searches on December 1, 2019

The graph does indeed show an almost 50% drop year-over-year.

In the same article, AAA predicts the peak travel time to be the afternoon of the day before Thanksgiving. This is supported by last year’s Google Trends search data, which shows that searches for the word “traffic” did indeed peak on the day before Thanksgiving, which in 2019 came on Wednesday, November 27th.

Relative searches for the word “traffic” in the days before Thanksgiving 2019

Indeed, looking at the traffic over the days leading up to Thanksgiving 2019 does indeed show a jump of about 50% from Tuesday to Wednesday. We could look at the same trends in 2020 – except that at the moment, Google’s data only goes to up to 1 AM ET on Wednesday November 25th. So we’ll have to wait until at least tonight to see how many people searched for “traffic” yesterday (Wednesday). I’ll post an update here later for those of you on the edge of your seats.

I also checked Google Trends for recent searches for “turkey recipe,” with the assumption that in 2020, fewer large group gatherings will mean less turkey being cooked, because people don’t want to cook a turkey for a smaller group – although this could be debated, since four families staying home instead of going to grandma’s could mean four dead turkeys instead of one). The graph below shows the number of Google searches within the U.S. for “turkey recipe” from just before Thanksgiving 2019 to just before Thanksgiving 2020.

Google searches for “turkey recipe” by day, using a relative scale from zero to 100

Indeed, Google Trends shows that turkey recipe searches are down 25% over this time last year. Interestingly, the graph below shows U.S.-based Google searches for “honeybaked ham,” again between just before Thanksgiving 2019 and just before Thanksgiving 2020, again on a relative scale.

Searches for “honeybaked ham” from Thanksgiving 2019 to Thanksgiving 2020 on a relative scale

Searches for “honeybaked ham” are up almost exactly 25% over last year! Does this mean people prefer ham with smaller gatherings? Or that, when no one is looking, we all actually prefer ham over turkey? Count me in that group.

I also looked at searches for “flight status,” and those searches are down about 75% over this time last year.

My prediction

How will these trends hold up over the next few days? And – more importantly – what impact will this week end up having on COVID-19 cases in the U.S. over the coming weeks?

My prediction: overall, automobile travel will be down about 25% over last year and flights down about 50-75% over last year. So, about a third of our country is planning to do less for Thanksgiving than they would typically do. Which would make sense given our political makeup. About 1/3 are very liberal and take COVID-19 super seriously. About 1/3 are very conservative and believe it’s all fake. And 1/3 believe it is real and are concerned enough to make small to medium changes in lifestyle, but not enough to make major changes in lifestyle such as skipping a traditional Thanksgiving gathering.

Thus, we should see a surge in cases starting around December 6th. If I’m right, it may start out at about a 30% jump over this week’s pre-Thanksgiving rates… before the increase goes exponential.

Your Vote Matters, Now and Forever

I closed Monday’s review of my House predictions with an observation that I amazingly haven’t seen anyone else make: the Republicans actually came very close to capturing control of the House of Representatives. How close?

The current seat count in the U.S. House of Representatives is Democratic 220, Republican 202 – likely to go up to Republican 205 once the final three seats are decided. That means that if eight elections had gone Republican instead, the count would be Republican 213 Democratic 212.

The table below shows the eight closest races in which the Democratic candidate won. Adding up all the margins gives the minimum number of extra Republican votes that would have been required to give control of the House to the Republicans – provided of course all the votes had come in exactly the right places.

DistrictDemocraticD votesRepublicanR votesMarginPct
margin
IL-14Underwood203,195Oberweis197,8185,3771.3%
IA-3Axne219,205Young212,9976,2081.4%
VA-7Spanberger230,893Freitas222,6238,2701.8%
PA-17Lamb221,547Parnell211,9519,5962.2%
WI-3Kind199,870Van Orden189,52410,3462.7%
MN-2Craig204,031Kistner194,4669,5652.4%
MI-11Stevens226,128Esshaki215,40510,7232.4%
TX-15V. Gonzalez115,594De La Cruz-Hernandez109,0056,5892.9%
The eight closest races with a Democratic winner

The final count: 66,674. That’s not very many voters.

Lesson: Your vote matters. VOTE!