The Enigma machine used a “rolling substitution cypher” which means that it was essentially a (much more) complicated version of “A=1, B=2, C=3, …”. The problem with substitution cyphers is that if parts of several messages are the same then you can compare their similarities to break the code. Enigma was broken in part because of German formality (most messages started with the same formal greeting). Even worse, since some letters are more common than others (e.g., “e” and “g”) you can make progress by just counting up how often letters show up in the code (or even get an idea of what language the code is written in without breaking it!). Substitution cypher are so easy to break that some folk do it for fun. *Rolling* substitution cyphers can use a set of several encoding schemes and cycle through which code is used or make the scheme dependent on the previous letter, but this merely makes the code breaking more difficult. Ultimately, all substitution cyphers suffer from the same difficulty: similar messages produce similar looking codes.

Modern cryptography doesn’t have that problem. If any part of a message is different at all, then the entire resulting code is completely different from beginning to end. That is; if you encrypted a message, you’d get cypertext (the encoded message) and if you were to encrypt the exact same message but misspelled a single word, then the cypertext would be *completely* different.

If your messages were “Hello A”, “Hello B”, and “Hello C”, then a substitution cypher might produce “Tjvvw L”, “Tjvvw C”, and “Tjvvw S” while RSA (the most common modern encryption) might produce “idkrn7shd”, “62hmcpgue”, and “nchhd8pdq”. In the first case you can tell that the messages are nearly the same, but in the second you got nothing.

Enigma was very clever but is shockingly primitive compared to modern crypto techniques. If anyone in WW2 had been using modern (1970’s or later) encryption, then there is no way that anyone would have been able to break those codes (and Turing would have to settle for being famous for everything *else* he did).

There’s a post here that talks about the main ideas behind RSA encryption. The really fancy stuff is some of the only math that isn’t publicly known. Scientists have a whole thing about openness and the free exchange of information that governments and corporate entities (for whatever reason) don’t.

]]>The quickest way to see why is to imagine a slightly different way of drawing straws. Instead of drawing straws, draw cards where all but one are black (for example). *Everyone* takes a card and afterward everyone turns their card over; the one red card is the “short straw”. In this case it should make sense that no person is more or less likely to get the red card for the same reason that it’s no more or less likely for any particular card to be any particular place in a deck. The fact that when drawing straws we pull one at a time and generally stop halfway through (whenever the short straws appears) makes it fell like the situation is different, but it’s not.

Say you’ve got N peeps (people). The first person to draw a straw is the least likely to draw the short one (1/N) and the last to draw is the most likely (1/2). However! While the later people are more likely to draw the short straw, they’re also less likely to pull *any* straw since it’s more likely that the short straw has already been drawn. In movies they almost always draw every straw because of drama, but in practice, you draw until the short one shows up and then you stop.

The early people are least likely to draw the short straw while the later people are least likely to draw at all. If you write down the math you find that the effects balance out exactly. So here’s the math written down:

You’ve got N peeps named One, Two, Three, etc. (probably siblings).

The first person has N straws to choose from and their probability of getting the short one is . Easy enough. The second person has N-1 straws to choose from, so you might expect that their chance of drawing the short straw is . But that’s not the probability that counts. What counts is the probability of drawing the short straw *given* that it hasn’t been drawn already. That probability is . $\frac{N-1}{N}$ is the probability that the first person did not already draw the short straw.

By the time it’s the Jth person’s turn there are N-J+1 straws remaining. The probability that the short straw is among them (the probability that it hasn’t been drawn already) is . And if it hasn’t, then the probability of drawing it is . So, all in all, the probability of the Jth person drawing the short straw is .

Finally, the last person to draw is the person who cut the straws. This person’s choice is random because everyone else’s choices were random: knowing which straw is which doesn’t change that.

]]>A tube from the ground to space would fill with air of about the same density and pressure as the air around the straw, decreasing as you go up until eventually you have a straw full of nothing surrounded by also nothing (in space).

What holds the atmosphere to the planet is gravity, so if a patch of air tries to drift off into space it literally falls back. A straw alone wouldn’t change that. On the other hand, if you attached some kind of pump to the bottom of the straw to make it have a higher pressure than sea-level, then you could pump air up the straw and have some kind of massive space-fountain of air (the air coming out would fall back to Earth just like water in an ordinary fountain). In fact! There is a situation very close to that happening on Saturn’s moon, Enceladus.

Whenever air or water or whatever travels up a straw it’s being pushed by pressure from the bottom (there’s no such thing as sucking), and one atmosphere of pressure can only push so far. For something like liquid mercury that’s about 76cm, which is why the “1 atmosphere” of pressure is often expressed as “760mm of Mercury”. If a closed tube is taller than that, then the pressure (here on Earth) isn’t great enough to push the mercury to the top which leaves nothing at the top.

Same idea with air. If you have a long tube full of air with the top open to space and the bottom pressurized to one atmosphere (or 760mm Hg), then the column of air in the tube will be as tall as the atmosphere.

A straw doesn’t provide an “escape route”; our air is free to try to leave whenever. The atmosphere stays where it is because it’s made of mass and the Earth has gravity. It’s a little sobering to realize that there’s nothing between you and a profound nothing (space) but a thin layer of air held down by its own unimpressive weight.

The barometer picture is from here.

]]>When someone says “we live in the third dimension” what they should really say (to be overly-precise) is “the universe we inhabit has three spacial dimensions”. There are a few ways that you can tell that you live in a three dimensional world. The easiest is to try to come up with as many mutually-perpendicular directions as you can; you’ll find three without too much trouble, but you’ll never find a fourth.

If you’re feeling terribly clever, you’ll find lots of other examples that demonstrate the three (and not two or four) dimensionality of our universe. For example, if you can tie a simple knot then you definitely live in three or more dimensions (no knots in 2-D) and if you can make a Klein bottle then you definitely live in four or more dimensions.

A dimension is a direction. Living in more dimensions means having more directions you can move in. There are many weird physical consequences to living in more dimensions, but the one you’d notice first (if you were somehow to suddenly to appear in a 4-D universe) is immediate death.

If a paper doll (two-dimensional being) were suddenly brought into three dimensional space all of its innards would become outtards. Similarly, there is nothing whatsoever supporting your body in a fourth direction, so if you were to find yourself with a few extra dimensions your insides would follow the path of least (zero) resistance and fall out. It would be super gross, but would make no more of a mess than an infinitely thin oil slick. Any local 4-D critters probably wouldn’t even notice.

]]>When you first start doing trigonometry the choice between radians, degrees, turns, or hexacontades is a matter of personal preference. Most people use degrees because most other people use degrees (and other people seem pretty on the ball). But when you get to calculus using radians is the most natural choice; anything else is just a headache waiting to happen.

To see why you have to get to know the unit circle.

Start with a unit circle with a horizontal line through it and a radius (“a radius” means a line from the center to the edge somewhere). The *definition* of sine and cosine of the angle between the radius an the horizontal line are in the picture above. SOH CAH TOA is easy in this case because the hypotenuse is 1.

When you use radians you’re describing the angle by using the length of the arc it traces out on the edge of the unit circle. The circumference of a circle or radius R is 2πR, so (since R=1 on the unit circle) the full circle is 2π radians around. That is: 2π radians = 360 degrees.

You’ll notice that when the angle is very small (and measured in radians) the value of sin(θ) and the value of θ itself become very nearly equal. Not too surprisingly, this is called the “small angle approximation” and it’s remarkably useful.

So for small values sin(θ)≈θ or .

In fact, in the limit as the angle approaches zero they *are* equal, or in mathspeak: . When someone says “in the limit as ___ approaches ___” it means they’re about to talk about calculus (and true to form…). All of the calculus around trig functions can be based on the fact that . For example, one of the more important things in the world (that’s not *quite* sarcasm) is the fact that .

The derivative of a function is , so:

That doesn’t look like a big deal, but keep in mind that all of trigonometry is just a rehashing of sine. For example, and .

If it weren’t for the fact that (when using radians) we wouldn’t have .

It’s not the end of the world if you try to do calculus with trig (it’s close), it’s just that the result is multiplied by an inconvenient constant. For example, if you’re using degrees: . Same thing happens when you differentiate cosine or tangent or whatever. It’s a lot easier to understand why if you look at a graph.

Clearly when using degrees the slope (derivative) of sine at zero is not 1, it’s much smaller (it’s 2π/360 in fact). If you don’t want any weird extra constants, then you need to use radians. But if you don’t mind them, then you be you. You can certainly use degrees or whatever, but you need to be careful with all those extra 2π/360’s.

* This is a trigonometric identity.

** That isn’t obvious:

]]>Where M_{P} and A_{P} are the mass and acceleration of a planet, M_{S} is the mass of the Sun, R is the distance between them, and G is a universal constant. What this rather bold statement says is “if you exist near the Sun, then you are accelerating toward it”. Each of the planets, moons, grains of dust, etc. all say the same thing, it’s just that with 99.86% of the mass in the solar system, the Sun says it loudest.

A force, like gravity, *accelerates* the object it acts on. So to understand what a force does it’s important to understand acceleration. Velocity describes how fast your position is changing, while acceleration describes how fast your velocity is *changing*.

“Velocity” is different from “speed” because velocity is a description of how fast you’re going *and* in which direction; “10 mph north” is a velocity, while “10 mph” is a speed. So you can have an acceleration that changes your velocity by changing your speed and/or by changing your direction.

Imagine you’re in a car (your velocity points forward):

If you accelerate forward, you speed up.

If you accelerate backward, you slow down (“decelerate”).

If you accelerate to the right or left, you turn in that direction but maintain the same speed.

Notice that when you talk about acceleration this way, suddenly the same push you feel into your seat when you step on the gas is the same as the push you feel into your seat belt when you brake and the same as the centrifugal force pushing you to the left when you turn right.

With planets the same rules apply. A planet moving around the Sun in a circular orbit always has the Sun about 90° to the side of the direction they’re moving. This means that the planet is always turning, but always moving at about the same speed. The planets are moving so fast that by the time they’ve turned a little, they’ve moved far enough that the Sun is in a new position, still 90° to the side.

So that’s how a planet can accelerate toward the Sun forever without getting any closer. The sideways motion of planets is due to the fact that if a planet were not moving sideways, it would find itself in the Sun in short order. In fact, the Sun is nothing more than a massive collection of all the matter from the formation of the solar system that wasn’t moving sideways fast enough (which is nearly all of it).

*Why* things end up in circular orbits is a more subtle question. The quickest explanation is that things in not-circular orbits run into trouble until either their orbit is sufficiently round or they’re destroyed. It’s not that circular orbits are somehow better, it’s just that other orbits carry more risk of serious impacts or gravitational interactions (e.g., with Jupiter) that may lead to short, unfortunate orbits.

Assuming that an orbit is stable, then it will be an ellipse (there’s a post here on *exactly* why, but it’s a a whole thing.). A circle is the simplest kind of ellipse, but ellipses can be extremely stretched out. For example, comets have very elliptical orbits (like Sedna in the picture below). In these orbits the comet is mostly moving toward and away from the Sun, so for them the Sun’s pull *mostly* changes their speed and changes their direction less.

There’s nothing special about the orbits the planets are in. The eight (or nine or more) planets we have in the solar system aren’t the only planets that formed, they’re the only planets left. When things are in highly elliptical orbits they tend to “drive all over the road” and smack into things. When things smack into each other one of a few things happen; generally they break or they don’t. When we look at our planetary neighbors we see craters indicating impacts right up to the limit of what that planet or moon could handle without shattering. Presumably there *should* be impacts bigger than a planet can stand, but (not surprisingly) those impacts don’t leave craters for us to find.

So objects with extremely elliptical orbits are more likely to get blown up. But even when two objects hit each other and merge, the resulting trajectory is an average of both objects’ original trajectories, and that tends to be more circular. This is a part of accretion, and Saturn’s rings provide a beautiful example of the nearly perfect circular orbits that result from it.

Given a tremendous amount of time, a big blob of material in space tends to condense into a ball (with most of the matter) and a thin disk of left over material traveling in circular orbits around it.

]]>