Using Christopher Wolfram’s virus program to show kids some ideas about how a virus spreads through a network

Yesterday we looked at a very simple model of how a virus spreads through a network – the assumption was that everyone infects everyone they are connected to. In that (obviously simplified model) the structure of the network affects the structure of the spread:

Today we are looking at another model – still simplified, but not as much as yesterday. This model (and the code we used today) was created by Christopher Wolfram and is here:

In Christopher Wolfram’s model, we use Mathematica to make a network and then study how the virus spread through the network by varying the average number of connections per day that people in the network have. The surprise (that we discuss mostly in the last video) is here the different network structures seem to behave in nearly identical ways. So the result today is very different than yesterday’s result.

I introduced today’s idea by asking the boys to think about how to build a more realistic model of how a virus spreads. The first network we looked at was a simple 2d grid:

Now we looked at a 3d grid:

Next up was a Delaunay triangulation:

Now we looked at a pure random graph network:

For the last two we looked at two graph networks that look a lot like connections in the “real world.” First up was a Watts-Strogatz graph:

Finally we looked at a Barabasi Albert Graph. This graph looks like the pure random graph we looked at, but you can see in the video that the degree distribution is really different. At the end of this video the boys talk about some of the surprises in this project and what they learned.

I think Christopher Wolfram’s program is one of the best I’ve seen for helping students understand some of the difficulties in modeling how a virus spreads. It seems like a big surprise that all of these networks seem to behave the same way, but understanding why it maybe isn’t a huge surprise helps kids see some of the key ideas in these simple models.

Using an idea from Stephen Wolfram to show kids how a virus can spread through different kinds of networks

This week I watch an interesting live coding video from Stephen Wolfram:

Right at the beginning of this video Wolfram shows how to use some simple Mathematica commands to make a simple model of how a virus spreads through a network. I thought it would be fun to share this idea with the boys for several common networks.

I introduced the idea on a 2d grid:

Then we moved to a 3d grid:

Then we moved to a type of network called a Delaunay triangulation:

Now we moved away from these relatively simple graph networks and looked at a completely random one:

With these examples out of the way, we moved to two types of networks that more more commonly used to model a network of human interactions. The first was a Watts-Strogatz network:

Finally we looked at a Barabasi-Albert graph:

This was a really fun project and I was really excited to hear how the boys thought about the different types of networks. The math to properly describe what’s going on in these networks is over my head but I am really happy that Mathematica makes it so easy to explore.

Finally, the idea for looking at these 6 different graphs comes from Christopher Wolfram’s fantastic agent based modeling example. In that program he dives into these different networks much more deeply than we do here – this program is definitely worth checking out if you’ve not see it already:

Having my older son work through Christopher Wolfram’s agent based virus modeling program

A few months ago I saw an amazing program from Christopher Wolfram showing how agent based modeling works for modeling the spread of a virus:

We did a project with Wolfram’s idea back in May:

Since the boys have been learning more about programming in Mathematica this summer, I thought it would be fun to review Wolfram’s program again. My older son spent the week looking through the notebook. Tonight we talked about some of the things he thought were interesting.

The first thing that caught his eye was how the average number of interactions per time step affects the spread:

The second thing that caught his attention was how Wolfram was able to model how the virus spread across different kinds of graph networks:

Finally, he thought the “network of networks” model was really interesting and Wolfram’s graph of how the number of connections between the individual networks changed how the infection spread, in particular, caught his eye.

I think that Wolfram’s work here is one of the best examples I’ve seen that makes virus modeling accessible to students. I also really love that there are many different areas to explore further in Wolfram’s work. Definitely interesting for my son to play around with this program a bit more.

Having the kids talk about some corona virus data presentations

100+ days into the pandemic and I’ve found several sites producing data and data presentations that are helping me track the spread of the corona virus. There is also, obviously, lots of bad information. For our math project today I wanted to share a few visualizations with the boys to (hopefully) help them understand the pandemic better – especially in the US.

We started by looking at Apple’s mobility tracking site:

This site is terrific for seeing how people from all over the world have changed their travel behavior. Here’s what the boys had to say:

Next we looked at the site:

I learned about this site relatively recently. It does a great job collecting and presenting data in the US. Here’s what the boys thought of the various presentations:

During the conversation in the last video my younger son said that he was surprised to learn that deaths in the US from the corona virus had been declining until recently. To help him understand why that was happening we looked at the data presentation on the FT’s website:

Finally, we looked at two presentations that I made this morning playing around with the data mapping tools in Mathematica. I’m still very much a novice when it comes to making these presentations, but I still thought it would be interesting to hear how the boys interpreted these presentations:

Talking through different kinds of corona virus visualizations with kids

Yesterday Jordan Ellenberg posted a really good thread about a different viral twitter thread about the corona virus:

Inspired by that thread, I decided that we’d talk through several different corona virus visualizations. The pandemic has hit different parts of the US (and different parts of the world) so differently, so I was really interested to hear what the boys thought of the various graphs and presentations.

First we looked at a county by county comparison of the pandemic in Massachusetts and Texas. We looked at cases and deaths per 100,000 people from January through June in each county:

Next we looked at a more traditional data presentation with graphs of total cases by state

Now for a different perspective on the cases in each state, we looked at the graphs of cases over time weighted by population. I think the difference in the total cases graphs and the population weighted graphs are easy for adults to understand, but the differences were a little harder for the kids to interpret:

Finally we looked at a data presentation that I think I’d never seen before the pandemic. Mathematica calls this presentation a Matrix Plot – I don’t know what these plots are usually used for.. These plots were hard for me to understand when I first saw them, but they made a bit more sense to the kids this morning:

I think that showing kids data about the corona virus helps them get a better understanding of what’s going on. Talking through different kinds of presentations is an important exercise, too, as kids will often see ideas in these presentations that are different from what you were expecting them to see.

Revisiting Mads Bahrami‚Äôs corona virus mapping project with the boys

Back in May, Mads Bahrami made a terrific map of how the corona virus spread in the US:

We did a project based on Bahrami’s work back then:

and today seemed like a good day to revisit it. This project needs Mathematica to do yourself, but I think it is also really interesting to hear what the kids have to say about the maps.

Here’s their first reaction to an animation showing total (population adjusted) cases in the US over time:

I wasn’t happy with the color scheme I chose for the first map, so the main work we did for the project today was making a new map with an improved color scheme. That work required us to look carefully at the data and study the distribution of the population weighted counts by US county. Here’s the new map and how the boys described that work:

This project was a nice way for kids to think about how to present and interpret data. Thanks to Mads Bahrami and to Wolfram for making the original work public.

Talking through one of the Wolfram programming challenges with my kids

One of our projects this summer is working through some of the Wolfram programming challenges. I’m not a particularly good programmer, but am excited to try to help out the kids as best I can.

One of the challenges we worked on this week was really interesting:

A quick summary of the challenge is here:

This challenge was difficult for the kids and took about 3 days working for roughly 30 min each day to complete. I think that part of the difficulty came from having to think about a list of lists, which is a new idea for them (programming or otherwise).

For today’s project I wanted them to talk through their approach to the problem and eventually discuss the solution. We started with looking at the problem statement and talking a bit about what made this challenge a little difficult:

Next we talked about some of our initial ideas about the program and how we thought about the problem with an even number:

Now we discussed what was different (maybe surprisingly different) about the case with odd numbers:

Two wrap up we looked at the program the boys wrote and they talked through the code:

I’m really excited about working through more of these challenges. Some seem absurdly hard and I’m sure won’t be able to solve all of them, but I think we’ve got a fun summer ahead of us!

A not-so-great attempt to talk about virus superspreaders with kids

One of the most interesting ideas I’ve seen about the spread of the corona virus this week is discussion about the role that superspreaders play. I thought the topic could be made accessible to kids following a plan similar to what we did last week with Christopher Wolfram’s virus spread model:

I also want to be clear that the code we are playing around with here is from Wolfrman’s project which you can find in the link below. Other than really minor modifications for this project, none of the code is mine and this project wouldn’t have been possible without Wolfram’s work:

Today’s project didn’t go nearly as well as I hoped, though, But even with things no going so well I wanted to share the project.

My idea was to show the boys the distributions of outcomes when a virus spreads through a network. So, unlike last week when we just looked at one simulation for each network, today we looked at 1,000 simulations per network. Then, as a really simplified way to look at the idea of superspreaders, we’d look at how the infection spread through the network when the starting point had different numbers of initial infections.

So, we started by looking at one of the networks from last week and talking about the ideas we learned from that project:

Since simulating 1,000 different runs through a network takes a long time I prepared several graphs ahead of times so that we could just talk about the results. Fortunately I prepared two different visuals for each simulation because the first graph I made ended up being extremely confusing for the boys:

We spent a lot of time in the last video making sure that we understood the visualization of the simulations I was running. It turned out that the histogram was the easiest one for the boys to understand.

With the boys hopefully understanding what the histograms meant now, we looked at how the spread of a virus through a network changes as the interaction between nodes of the network changes. What we looked at specifically was how the spread changes from almost nothing to spreading through the entire network quite suddenly.

Having looked at the change in spread based on the average number of interactions in the last two videos, here we changed to looking at how the spread changes based on the number of initial infections. By changing the number of initial infections from 5 to 10 to 15 to 25 to 100 (out of 1,000 nodes) we saw very different spreading patterns in the network.

This way of looking at spread through a network was my guess for an easy way for kids to see / understand the role of superspreaders.

Definitely not my best executed idea ever, but still hopefully something that helped the boys get a bit more understanding of some of the important ideas in virus models.

Using some Mathematica code from Diego Zviovich to help kids see how the corona virus spread in different states in the US

Yesterday I was trying to understand why the corona virus hit Massachusets so differently than it hit Georgia and Diego Zviovich shared a really nice bit of Mathematica code with me:

In case the graphs don’t so up show well from Twitter, here are the graphs of new positive cases in Massachusetts and Georgia since March (per 100,000 population)

Screen Shot 2020-05-18 at 7.17.34 PM

Screen Shot 2020-05-18 at 7.17.57 PM

Zviovich’s code was so easy to use that I made a gif of the charts for all states and territories. It wasn’t working well with WordPress, but you can see it on twitter here:

Tonight I asked me kids to look at the graphs from the different states and territories and pick out 4 that caught their eye.

My older son picked out Washington D.C., Louisiana, Nebraska, and South Dakota

My younger son picked out Kansas, Nebraska, New Jersey, and South Dakota

I thought this was a nice exercise for kids. Both to see how you can use computer programs to sift through lots of data, and also to see how to read and interpret graphs.

Sharing Mads Bahrami’s project on how the corona virus spread through the US with kids

I saw this neat project from Mads Bahrami shared by the Wolfram twitter account last week:

My younger son had thought it would be neat to see how the map looked scaled by population, so I spent a little bit of time trying to figure out how to do that. I’m a total novice when it comes to using Mathematica, but I was able to figure out how to make the new presentation for my son last night.

We started our project today by looking at the original map that Bahrami made:

Next we took a look at Bahrami’s code. The goal here wasn’t to understand the details, but rather to see that making a visualization like this in Mathematica is actually not nearly as hard as it seems . . . if you know what you are doing!

Finally, we took a look at Bahrami’s map scaled by county population. I didn’t do as good a job with the colors as I should have – the darkest colors are 3 cases per 1,000 people in the county. Still, it was interesting to hear what the boys thought of this map vs the original one.

Even though fully understanding the underlying code is a but much to ask for kids in a 30 min project, I think Mads Bahrami’s project is a great one for kids to see. It give kids a chance to see how data visualizations are done, and also gives them an opportunity to understand and talk about the data. I really like sharing this project with my kids.