I got quite the challenge from my father in law. The problem is well defined, but I’m having difficulties finding a meaningful answer. The reason why he asked me is because I’m an engineering student and he is in the windmill industry.

Before they attach the actual mill on the concrete foundation, it has to be absolutely leveled. If not, a tall mill would be quite offset even with a very small angle. To tackle this, they use two angle gauges and measure in two directions. The angle gauges are connected and you know the angle between them, their mutual angle. I’m supposed to find a way to convert these 3 inputs (angle 1, angle 2 and mutual angle) to find 2 outputs (the steepest angle and in which direction this is relative to the gauges).

**Physicist**: This is a gorgeous question that leads through some pretty math and ends with an elegant answer. If you’ve taken a class or two that used lots of vectors, then this is a cute exploration of what you can do with surprisingly little. If you’ve never taken a class or two that used lots of vectors, then please do: it’s fun stuff. You get to draw pictures and everything.

So you’ve got a flat slab that isn’t quite level. Two angle gauges (with plumb lines or bubbles or whatever) are placed on the slab in two directions. Define and as the directions of the two gauges on the ground and as up. These may as well be unit vectors, so: they are.

Define the angle between and as and the angle between each each of the levels and as and .

Measuring the angles between these vectors means that we know sine and cosine of these angles, and knowing that means that we know the dot product and magnitude of the cross product, since and .

Finally, since the windmill will be built perpendicular to the slab, it will be built perpendicular to both and . When a physicist (hell, even a mathematician) hears “I need a vector perpendicular to two other vectors” they convulsively respond “cross product those mothers”. If is the windmill’s “up”, then . If you were standing on the slab where the tails of and meet, then would be on the right and would be on the left (that’s the right hand rule).

If we project onto the , plane, the result will be pointing in the direction opposite the direction of the windmill’s lean. Define this projection as . The direction of is the direction that the windmill needs to be “leaned” so that it will stand straight.

The questions (way back at the top of this page) now boil down to:

1) What is the angle between and ?

2) What is the angle between , and and ?

For #1, it turns out that the cross product is easier to work with. Define as the angle between and .

We also know that:

And therefore:

In the event that (and honestly, why wouldn’t you want your gauges perpendicular?), then this simplifies a lot:

For #2 we find the projection, , and dot it with and . The projection onto the slab is . That is; it’s the up direction minus whatever component points in the direction of the windmill.

In that last step you know that since the tower, , and any direction on the slab it’s on, like , are perpendicular.

Defining as the angle between the projection and ,

Again, in the event that , this simplifies:

Similarly, .

So, if you’ve got the inclinometer readings, and , then you can find the lean of the tower, , and the direction you should push it so that it doesn’t lean, and from and respectively. This is a beautiful example of math leading to a cute, relatively simple solution that you probably couldn’t guess.

The windmill picture is from here.

]]>**Physicist**: There are absolutely different degrees of entanglement!

The degree you usually hear about are “maximally entangled states”, but basically everything is a little entangled. Not because of the big bang, but because every-day interactions generate and break a little entanglement all the time. Entanglement has a lot in common with correlation: if you know something about one thing, you’ll know something about the things it’s correlated with.

Correlations crop up all the time when things interact. For example, if you leave your car in a parking lot and come back to find a dent with a little red paint in it, then you know that somewhere nearby is a red car with another dent. The random things about your dent (the height above the ground, the severity, etc.) will be similar to those properties of the corresponding dent on the other car. You and a damnable ne’er-do-well have correlated cars because looking at the dent on one tells you something about the dent on the other; not because they have a spooky cosmic connection, but because they physically ran into each other. Entanglement is a little more subtle (what with all the quantum mechanics), but not a hell of a lot more subtle. Nothing fancy.

Just to be over-precise, when we say that things are entangled what we really mean is that some of their *properties* are entangled. For example, the polarization of two photons might be entangled while their positions are not, or vice versa.

The homogeneity of the universe (the “more-or-less-the-same-everywhere-ness” of the universe) is often cited as evidence that all the matter in the very early universe briefly had a chance to mix around, but that doesn’t have too much of an impact on entanglement. There’s something called “monogamy of entanglement” that says that maximally entangled qubits only appear in pairs, and maximally entangled states are the ones that really do interesting things. This can be generalized a bit to say “the more entangled two things are, the less they’re entangled with anything else”. Unfortunately, in order for such a pair to persist until today it would need to be left almost entirely unharrassed by everything else for billions of years. However, if the universe is anything, it’s old and messy. The entanglement we (people) create on purpose requires careful isolation and control of the stuff in question.

Even *worse*, if you have access to only one entangled particle, there’s no way to tell that it’s entangled. All of the fancy effects you hear about entanglement *always* require both, or at least most, of the entangled particles.

So you (every bit of you) can be entangled with other stuff in the universe (you kinda have to be). Entanglement is generated and broken by interactions, so you’re more entangled with stuff that’s nearby (in an astronomical sense). But most importantly, it doesn’t matter; random atomic-scale correlations are a lot like random atomic-scale noise.

Even less exciting, if you (personally) are the thing that’s entangled, your experience is entirely ordinary; the thing you’re entangled with will always be in a single state (from your point of view). All of the fancy experiments we do with entangled particle always involve particles being entangled with each other, because when they become entangled with the person doing the experiment it looks like “wave function collapse” (suddenly it appears to be in only one state) and that’s boring. Similarly, if you and a distant alien are entangled it does not mean you have a spooky connection (groovy, spiritual, or otherwise), it means that they will already be in a single state (from you mutual points of view) before you ever meet each other.

Which is exactly the sort of thing you’d never notice.

]]>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.

]]>