Showing posts with label Numberphile. Show all posts
Showing posts with label Numberphile. Show all posts

Thursday, April 9, 2015

How Could We Have Broken Germany's Enigma Code?

I initially set out to write about the German Enigma Machine and how it worked, but as I was doing some research, two things happened: I found a video that explains it better than I ever could, with an actual WWII-era Enigma Machine, and I wound up doing some math that I thought was somewhat interesting.

So to start, I think you should watch this video about the Enigma Machine:



Did you watch it? If not, I'll give you one more chance:


IF THE VIDEO DOES NOT SHOW UP CLICK
 >  HERE  <


Alright, so in the video we saw that the Enigma Machine was a device used to encrypt internal messages in the German military, and has an extraordinary number of possible arrangements, each of which will produce a different code. The Enigma code was broken through a regimented and careful application of cleverness on the part of Alan Turing and his team at Bletchley Park. I got to thinking however, “what sort of team would have to be assembled to solve the Enigma code through sheer human power and luck?”

This rabbit hole was quite fun to descend into. I started with a few assumptions for this scenario. Every person who was working on the code had their very own enigma machine to work with, they could try a new arrangement each 100 seconds, and they could work for 16 hours a day. I also assumed that the infrastructure to feed, house and give them water was in place. Alright, here is the number we started with:

158,962,555,217,826,360,000

159 quintillion. That is the number of possible arrangements the enigma machine could be in, each would output a different code, and only one of which would be correct. Oh, and it changed every single day.

In order to try every combination in the space of 24 hours, you would need to try 1,840,000,000,000,000, or 1.8 quadrillion arrangements per second.

If one person can try one arrangement in 100 seconds, that means it will take a force of 184 quadrillion people to try every arrangement in the space of 24 hours, but that only if we work them 24 hours a day. Adjusting for the workforce working 16 hour days, we can multiply 184 quadrillion by (4/3) to get 245 quadrillion people.

So we have ~ 2,350,000,000 people in the world (in 1945)
We need 245,000,000,000,000,000.

Keen-eyed readers will note that the second number is longer, so we are now moving into a very hypothetical world. As long as we're not bound by reality, lets go ahead and pack in our workforce across the entire land area of earth (minus Germany), and lets pack them in at the population density of current-day Tokyo (we are ignoring small facets like food water, adequate shelter, etc...).


Land area of Earth: 57.53 million km2
Land area of Germany: 137,903 km2
Population density of Tokyo: 1800 people per km2


1800 people per km2 * ( 57.53 million km2 – 137,903 km2)


This gives us a population on our Super-Earth of about 100 billion people.

This means we would need 2.45 million Super-Earths to support our workforce.

It looks like we'll need to drain the oceans to beat the Nazis.

Due to the fact that Earth's surface area is ¾ water, draining the oceans gives us 3x the surface area we had using land alone (minus Germany). We can now fit 400 billion people on each Mega-Super-Earth, and now we need a quarter as many, or a little more than 600,000 Mega-Super-Earths. While that many Earth-Sized objects can orbit many stars, we need to restrict our Enigma team to one star in order to transmit the correct code in time to implement a strategy. The nearest star to us is Proxima Centauri, over 4 light years away. That is not close enough to get information back to central in time to help the war effort.

The question now becomes “Can 600,000 Earth-sized object orbit our sun without bad things happening?” I talked to some astronomers and astrophysicists here at CU Boulder, and the consensus seems to be “no.” When you put a lot of objects in similar orbits, most of the bodies are ejected from the system, most of the rest collide with each other, and quite a few will be engulfed by the star in the middle of the system.



No video?

This is the “Nice Model” of the solar system. About 3.8 billion years ago many Kuiper belt objects were ejected from the system and Uranus and Neptune switched places (at 30 seconds in the video). This area was much more sparsely populated than our scenario would be.

This doesn't happen immediately, so to wrap up, if you’re going to use humans alone to solve Enigma, do it fast, and make it worth it.


There are of course a few problems with this plan:

On average, the code will be broken by midday. Sometimes you will get lucky and solve it early on, and sometimes you wont be so lucky, and it will take until late in the evening to break the code. Even with this workforce, there will only be an average of 12 hours to actually use the information obtained.

If you have 245 quadrillion people united to defeat the axis powers, you probably wouldn't even need to bother with the Enigma code. If each person donated one strand of hair (half a milligram), you could bury Germany in 122 billion kilograms of human hair, which would probably deter them. I wanted to figure out how many feet this would be, but there aren't reliable figures for the packing efficiency of average human hair, so I figured a head of hair (a wig) weighs about 100 grams, and I could stuff one in a one liter bottle giving it a density of 0.1 kg/liter. This means 122 billion kilograms of hair could cover Germany to a depth of ~9 meters, give or take a few orders of magnitude.

So now you know that...

If you’re curious about the Enigma Machine itself, as well as the flaw that turned out to be its undoing, there is another video that describes how Turing and his team broke the code:



Cheers,

    - Scott



If you like my posts, you can sign up for email notifications here:


(I only send one email per post)



LINKSTORM:







Monday, March 2, 2015

Why is Nepal's Flag Strange Looking?

I'm experimenting with email notification. If your'e interested, you can go to 
 https://tinyletter.com/scottsieke 
and enter an email and hit "subscribe." I'll send out a quick notification when I post something, and that's it. They don't share you email with anyone other than me.


To start off with, here is Nepal's flag:


The current flag of Nepal

The first thing you probably noticed was that it is not a quadrilateral like every other national flag on the planet. The second thing was probably either "that is wonderful," or "why would anyone choose that as their state flag?"

To answer the question of why the flag is shaped so distinctly, one must go back quite a ways. In fact to around 800 BC (or much earlier by some accounts) when the Kirat people inhabited the Nepal area. Their flag looked like this:


Image: Danesh Rai



So the answer to the question may be "it is... because it always was." Because that's not very satisfying, at least not to me, maybe learning about the meaning of the flag will help. The two most oft-quoted reasons are that it symbolizes the Himalayan Mountains, and it's representative of the two dominant religions in the area: Hinduism and Buddhism, but these both seem a bit retcon to me.

This site has a much more satisfying answer to both the question of the flags meaning and the reasons behind its shape. Two separate branches of the Rana Dynasty which ruled the area in the late 19th and early 20th centuries had two different pennons (which are the essentially the same as the triangular collegiate pennants) for each branch, and in 1962, when the constitution was written, the flags were combined into the familiar flag we see today

...But how would you go about making it, or writing down that shape? In 1962, they couldn't simply attach a .jpeg to their constitution, so they came up with another way.


<sidenote>
Remember back in high school geometry class when you learned all about geometric constructions? What real world application did that ever have? The answer, it turns out, is basically zero, but not quite zero. As it happens, if you want to create your very own Nepalese flag you'll need to call upon these ancient skills.
</sidenote>

Written into Schedule 1, of the Nepalese Constitution (Scroll to the very bottom) is a detailed geometric construction of the county's flag. This is in fact the only correct way to produce the flag according to the countries law.

Here is a great video produced by Brady Haran at Numberphile that led me to this topic.

After watching this video, I decided to make my own Nepalese Flag and I headed off to the FedEx store. I acquired a poster board and a sheet of brown paper that measured about 6'x5' and went to work. After about an hour, using nothing but a compass a straight edge and a length of string, I came up with this:


My very own Nepalese flag

It looks lovely above the television in my living room.

If, for some reason you didn't get you fill of geometric constructions after the Nepal flag video, this should certainly slake your odd thirst for geometry:

Cheers,

   - Scott



LINKSTORM (I'll add possibly interesting links to the end of each post; just unrelated things I've run across):

Here is a great video of a group that sang the same song though many different genres of Western Music

This is a long video, but to me it's downright therapeutic to watch someone make something from scratch that turns out beautifully

Did you know humans emit visible light??

This is a great map of interconnected flavors
(Here is a high resolution)
(Here is an NPR story about it)

This is just lovely. Back to the Future meets surfing

This is an interactive topography map, and I never knew I wanted one of these.