Pages

Showing posts with label Time. Show all posts
Showing posts with label Time. Show all posts

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:
Wikipedia
We can make a table of the segments used for each digit:


abcdefg
0
1




2

3

4


5

6
7



8
9

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.

Sunday, April 21, 2019

Zoned Out

This past week, I flew back to the US with Marika and Lorna to visit family. I'm back in France now, but the jet lag I've been suffering from has put timezones on my mind. The idea behind timezones is pretty simple: We use time (meaning the value read on a clock, not the duration between two events) to measure the progress of a day, which is connected to the rotation of the Earth. Every point on the Earth has a different angle with relation to the Sun, so in the most precise sense, every point has a different time. That would make things difficult to keep track of though, so instead we divide the planet into zones, usually every hour.

It would be inconvenient to simply draw straight lines though, since that might put a small corner of one state or country in a different zone from the rest, so instead we define the zones to follow borders:
Wikipedia
Some of these are pretty misshapen, and it made me wonder about the extremes in the difference between position on the planet, and designated local time. I found there are a number of handy Python packages for dealing with timezones, so I put together a script to get some statistics.

The main thing I wondered was in which timezone was it possible to get the farthest from the "true" time, determined by the rotation of the Earth. This is equivalent to the zone that covers the greatest longitude. When I tried to get that with my script, it gave me Antarctica, which has a timezone covering the full 360°! That's not really an answer to my question though, so I had it exclude points in the Arctic/Antarctic circles, where there can be 24 hour days/nights. With that done, I found the widest timezone was UTC+1, covering Ireland, parts of Africa, and importantly, Iceland, which gives it the extra width to beat China, at least measuring by angle. The northern latitude of Iceland means there's less distance in every degree of longitude. This timezone is nearly 45°, or 3 hours wide.

The narrowest zone, on the other hand, is UTC+6.5, covering the Cocos Islands. If you zoom in on the map above, you can see it just above the label for the Indian Ocean. That zone spans just half a degree, or about 2 minutes. It made me curious though about timezones that don't fall on an hour. The full list is America/St_Johns, Asia/Colombo, Asia/Kabul, Asia/Kathmandu, Australia/Broken_Hill, Australia/Eucla, Australia/Lord_Howe, Indian/Cocos, and Pacific/Chatham. I was surprised not to see North Korea on this list, since I thought I remembered they had a 30-minute offset, but it turns out they just got rid of that last year.

I'm still a bit jet-lagged, so I'll stop here, but if you take a look at the code you can see an attempt to find where you can get the biggest time change in the shortest distance (and maybe fix it yourself).