Tuesday, April 7, 2020

By Hook or By Crook

[Title from the opening of The Prisoner.]

Marika and I are back at her parents' house until we move to my next postdoc, and I've noticed something about the clock/timer on their stove. If I stand too close, the curve of the front cover blocks the tops of the digits:

Generally I'm able to read the time while only seeing the bottoms of the digits, and it got me wondering about the amount of information carried in each segment.

Digital clocks use 7-segment LEDs, which are laid out like this:
We can make a table of the segments used for each digit:








Now we can imagine removing one or more columns from that table, and see which digits are still distinguishable. I put together a Python script to try out all the possibilities, but I struggled to find a good way to show all 126 of them. I settled on an animated GIF:

You can think of the red cells as ones that are known to be blocked, or burnt out. The list at the bottom shows the digits that remain unique. Interestingly, the lower-right cell is used in all digits except 2, so as long as that one works and is off, we know the digit is 2.

Turning to the situation above, the available digits are fairly slim:
However, since this is a clock/timer, we know the digits will be changing sequentially. For half of the possible digits, we only need to wait for at most the next one to be on a known value.

Saturday, March 28, 2020

Exponential Exposé

With Michigan and most other places in the world sheltering from COVID-19, I thought it might be interesting to talk about exponential growth, and how it relates to disease spread. Disease is transferred from one person to others, so the number of new people who get a disease is related to the number who have it now. We can write that as a differential equation:
N is the number of people with the virus, and the dot indicates the change in time. τ is a time constant that tells how quickly the disease spreads. Solving this equation gives
At t = 0, we have one case, and after every τ, the number increases by a factor of e (= 2.71828).

A couple days ago, the blog Hack-a-Day (which I've mentioned before) had a post about getting realtime data about COVID-19 statistics. I wrote up a Python script to pull the data we're interested in, and make some plots. First, we can look at the total number of US cases over time:
According to the equations above, if we look at the increase from day to day, it should be linearly related to the number of cases on that day. Plotting gives
There's some variation, but overall it's fairly close to the fit line. According to that fit, we have τ = 4, meaning the number of cases increases by e every 4 days. To put that in more relatable terms, that's doubling the cases every 2.8 days!

Looking at the US cases compared to the global total,
we can see that the global rate is beginning to taper off compared to the US, suggesting we should do more to limit the spread!

Friday, March 20, 2020

You Can't Take the Sky from Me

[Yes, I recently rewatched Firefly.]

With social distancing on my mind this week, I started thinking about taking it to an extreme: interstellar travel. Specifically, I wanted to try some calculations with the Tsiolkovsky rocket equation, which applies to any space ship that moves by using conventional rockets.

The idea is this: To get moving, you need to push off of something. On the ground, you can push off the ground or the air, but in space your options are more limited. Rockets accelerate fuel out the back, which pushes the payload forward:
via Wikipedia
The problem is that the more mass you carry, the more fuel you need, but more fuel means more mass. If you work out the particulars, the equation you (or rather, Tsiolkovsky) get is:
This says that the more change in velocity you want, the more fuel you need, but there are diminishing returns.

When my parents were shopping for a camper van, they described their ideal as a "Russian space capsule", so let's take them at their word and imagine attaching rockets to their 2000 Chinook Premier. The manual gives the loaded weight as 10,700 lbs, or 4,853 kg. This is m in the equation above. For the exhaust velocity, ve, we can use the numbers for the (now retired) space shuttle: 4,447 m/s. If our target is the edge of the Solar System, we can relate the travel time to the fuel required:
The dashed line shows the mass of the camper, so to get there in under ~2 months, we need more fuel than cargo.

Of course, there's not much to do at the edge of the Solar System, so how long does it take to get to our nearest neighbor, Proxima Centauri, 4.2 light years away? If we want to get there within a reasonable time, we need to go pretty fast, so we'll use the Special Relativity version of the rocket equation:
Relativity says that as you get closer to light speed, it takes more energy to go any faster. Using the same exhaust velocity from before, the curve looks like this:
For reference, the mass of the Earth is around 6 x 10^24 kg, so burning the entire planet could get our camper there in under 10,000 years!

This is the reason other propulsion techniques have been proposed, like the LightSail I mentioned a couple weeks ago, or Project Orion, which involved accelerating the spacecraft by exploding nuclear bombs behind it. I think I prefer to associate my name with the new shuttle replacement, rather than something that leaves a trail of fallout...