GeekDad Puzzle of the Week Solution: Back to School Bugs

Geek Culture

Everyone has had that dream that wakes you up in the middle of the night. You know the one, where you suddenly remember that you are not only still enrolled in school, but it is also finals time, and you have to take a test on a book that you have never read? The one where something that you should have done is unfinished, or simply slipped through the cracks?

As I sat down to brainstorm new puzzles for this week, it dawned upon me that the winning entry for the previous week (Back to School Bugs) was never revealed. I would like to blame this on actually being sick from a bug, but as the solution shows, it is definitely not the case that with the parameters given that I could possibly be sick for quite that long a period. Here is the puzzle as originally posted:

After some 104 days of summer vacation, Max and Nora are back in school. One of the big things that my wife Allison and I are concerned about is the fact that most schools are “breeder reactors” for coughs, sniffles, and stomach bugs. Case in point: Max’s third day of school this year was a sick day. As I was putting Max back to bed on Thursday evening, the question hit me: just how “contagious” would a stomach bug have to be to impact a majority of students in Max’s class?

For purposes of this puzzle, Max’s class has 18 students, and they sit at six tables of three students each. Each table is a “work unit,” where the kids share schoolwork, ideas, and basic biologicals. There is no table-to-table conversation or sharing. Kids sit at random tables for the morning session, and then pick brand new tables in the afternoon. Any given child has the same odds of picking something up from the outside and bringing it to the classroom, and each kid at a table has the same chance of picking it up as any other child at that table. Kids are “contagious” for 2 days before they actually succumb to the bug, and are out just one day when it hits. Absent students’ seats are randomly assigned, and both completely empty tables and having single students at their own table is possible.

If we pick a child-to-child transmission rate of 30% and give any individual child a 10% chance of picking something up from the outside and bringing it into the classroom, what are the odds that more than half of the class will be out during a given day? If it can’t happen, how would these rates need to be change to make it happen within a reasonable timeframe?

The winner of this (past) week’s puzzle solved it the same way that I did: a simulation. After writing a small bit of code to simulate 18 students and follow them through a few weeks of school, I received answers that were really quite close to those sent in by several puzzlers. This week’s winner is Blaine, and he also included several graphs describing the situation in Max and Nora’s class over time, such as the chart depicting the odds of 1/2 of the class being sick over time, shown below.

With the parameters originally in the puzzle, it turned out to be the case that there was never really a time when there were good odds that more than half of the class would be ill. In fact, my instance of the code required me to ramp up both the transmission rate and the infection rates well over 50% to have this happen. Thank goodness that these types of bugs are rare!

Once again, congratulations to Blaine, the winner of last week’s $50 ThinkGeek gift certificate. For those of you under the weather from a bug of your own, sitting home shopping at ThinkGeek, please feel free to use the discount code GEEKDAD81AD for $10 off an order of $50 or more.

Liked it? Take a second to support GeekDad and GeekMom on Patreon!
Become a patron at Patreon!