Sunday, June 20, 2010

Math Series 10 -- Euler's equation

And today we reach the first major milestone in my series: Euler's equation.

Saturday, June 19, 2010

Math Series 9

Antenna analogy

An old fashioned radio without an amplifier.
Image from

How can a radio pull power out of the thin air sufficient to hear a radio broadcast many miles away? And what does this have to do with how bacteria swim? They both require an understanding of antennas.

I've been developing an analogy to with my friend John to help demystify antennas; the analogy is also intended to help my chemist friends see how the concepts of antenna design apply equally to all communication systems -- even biochemical ones.

Imagine a boat out at sea on a moonless night. Suppose there are waves rolling by on the ocean. How could we build a device on the boat to detect the invisible waves? A simple solution is to trap a marble into a slot and attach a switch a either end.

As the boat buoys up and down with the waves the ball will roll back and forth hitting the switches on either end. Consider why this works -- when the wave passes it lifts one side of the boat before the other. This lifting creates gravitational potential energy between one side of the boat and the other. Whenever there's a potential difference, anything free to change state under that potential will do so. In this case the marble will convert that potential energy into kinetic energy (and friction) which is detectable as the marble hits the switch.

There's a few non-obvious aspects of this that are easy to see when using this boat analogy and harder to see when talking about other kinds of antenna. Understanding these subtleties permits one to have much greater intuition for antenna design in other domains be that electrical or biochemical.

Aspect #1) It only works if the boat is rigid. If it was not rigid, say like a inflatable raft, the boat would simply deform to the shape of the wave and the marble could just sit in one place as the wave passes by.

Non-rigid ship.

#2) The length of the boat relative to the wavelength is important. Imagine how our marble-based water-wave receiver system would behave under two extremes: the boat being very short compared to the wave (top picture below) and the boat being very long compared to the wave (bottom).

When the boat is very short compared to the wave length, it hardly feels any potential energy difference between the bow and stern and thus the marble will not respond well to the wave. Similarly in the other extreme. If the boat is so long that many waves can pass under the it at the same time then again there will be little potential difference between bow and stern and the marble will not roll. We can therefore see that there is an optimal length range for our boat-antenna that is approximately equal to the receiving wave-length.

#3) The friction of the marble is important. A marble traveling through a denser medium will be slower to accelerate than will a marble going through a low viscosity medium. Imagine the marble moving through honey so that as the wave passes by it hardly has a chance to move at all before the wave has passed. Obviously this would be a bad detector because the ball wouldn't hit the switches.

Conversely if the ball were able to move too quickly, it would get all the way to the end of the rail very quickly and it would just sit on the switch. Although that might not matter for a simple-minded wave detector that only wished to detect the absence or presence of the wave (a binary sensor), it would matter if you were using the marble's velocity to drive some other system; for example, if we were making a recording of the marble's position to make a picture of the invisible waves. When the marble is able to travel so quickly to the end of the detector that it just sits uselessly at one end or the other it is called "saturation" or "clipping" and introduces a very particular kind of distortion called "clipping harmonics" and can be easily seen in the power spectrum with and without the clipping as seen below.

#4) You don't need a "ground" to detect a wave. The reason that a pilot can use a radio in the air is that that detecting a wave has only to do with detecting the difference in potential between the "top" of the wave and the "bottom". Indeed you need to be careful not to ground yourself in many cases because by "grounding" yourself you're creating an antenna that is the size of the earth!! For example, consider a boat mooring.

If you were to connect your boat to the ground then you'd be detecting the potential difference between ground and any wave even waves the size of the whole earth -- the tides. This can be very dangerous as the potential might be so great that it could destroy a ship. That's why in the picture below you see that boats that are moored to docs have to have rollers on them to isolate them from ground.

If there rollers weren't there the moored boats would be dangling from the ropes when the tide went out or deluged when the tide came in!

All of this stuff about length and friction boils down to a time constant. You need the marble "sensor" to have roughly the same time constant as the wave you're trying to detect. If the detector responds too slow (because it is too long or too burdened by friction for example) then you won't detect the waves very well. If your detector responds too fast (because it is too short or too frictionless for example) then the sensor will saturate.

This analogy demonstrates that an antenna is a "rigid" device that has a tuned response to a changing potential energy. This is true no matter the technology. And this lesson teaches us that antennas of any variety be they electrical, chemical, or anything else must be tuned to respond at a time scale in the ballpark of the speed that the signal of interest changes.

For example, an electrical antenna is a metal rod inside of which there are mobile electrons that are analogous to the marbles. As an electromagnetic field passes by the antenna the front and back of the antenna have different electrical potential so that electrons rush from end to end to try to cancel that potential just like the marbles did. And just as was the case with the boat-and-marble antenna, the length and tuning of detector circuit matters to optimize the response of the system to the wave.

All sensors of any technology are driven by changing potential energy. Consider a beautiful example of a biochemical "antenna" -- the bacterial chemotaxis sensor.

The receptor/sensor is a trans-membrane enzyme complex that undergoes a conformational change when it binds to a ligand of interest. The concentration of the ligand is variable in space and time and thus the bacteria needs to have a tuned antenna that responds at the same time scale. Imagine two extremes. Suppose the kinetics of the receptor enzyme were extremely slow to release the ligand. In that case, the bacteria would believe that the ligand was a high concentration even after it swam somewhere it wasn't. Conversely, imagine that the kinetics of the system were such that the motor was quickly saturated with signal. In that case, you'd get clipping distortion as described earlier. Both situations would reduce the performance of the chemotaxis system thus we'd expect that the bug would have evolved a circuit that is tuned to the time constants in the same rough proportion to the speed at which ligands change in the environment it is searching.

The above argument applies to any and all biochemical reactions. Ultimately every informatic aspect of a cell comes down to communicating information from place to place using diffusing metabolites. Therefore there's a lot to be said for thinking of the kinetics of these systems as "antenna" that are transmitting and receiving chemical messages at particular speeds with tuned circuits to optimize those communications.

[Revision 20 Jun -- thanks to my friend Sean Dunn for pointing out that I had incorrectly used a mass analogy where I should have used a viscosity analogy.]

Thursday, June 17, 2010

Video-wiki documentaries

Although I haven't played with it yet, now that Youtube has cloud editing, I predict that video based "wiki" documentaries will become a very cool new form of media.

I propose that a particularly good genre to start with is History. For example, start with a film of a lecture by an amateur but good historian (I as just talking to my history 7th grade history teacher Jerry Buttrey about this this morning). Others later contribute source material as it becomes availasble. For example, someone might live near a battle site and have footage of it. Someone else might live near a library where they can get images of documents and interviews with associated scholars. Someone else might have artifacts handed down from family members. It's easy to see how a strait-forward talking-head lecture could be edited over time with with more and more cuts to such external video shots with the lecture as voice-over and from there might have the narrative interrupted with other interviews -- mimicking the life-cycle of a typical wikipedia article.

A particularly good company to sponsor such activity would be the exceptionally high quality "The Teaching Company" whose lecture's I've enjoyed for a long time. They might be tempted to view such amateur media as competition to their products, but I think the opposite is true. If they would sponsored such endeavors (for example, by making a call for participation via their existing client base) I bet that they could increase their sales on related subjects as they'd tap into the social network of each project and with some clever marketing they could push their associated wares to a very receptive narrow market.

Finally, the very act of contributing to such a documentary, even if it's just going to a field and shooting a few seconds of video, would be a great way to engage pupils of all ages in history classes. I for one much more enjoyed our field trips than I did sitting in class, and had I had an active reason to collect documentation it would have been even more memorable.

Although I'm probably not going to make any of these forthcoming video-wikimentaries, I look forward to watching them.

Wednesday, June 16, 2010

Math Series 8 -- Velocity of rotating things

Everyone has probably dealt with velocity before, but the velocity of rotating things is a bit trickier. But, it's very important to where we're headed...

Why I hate standardized tests

Image by Peggy Monahan. Thanks Peggy!

One time my friend Bev asked me to help her with the GRE. I told her that I hate standardized tests and assured her that she didn't really want my help. She insisted that I was the only person she knew with math skills so I went over to help.

First question: If one car mechanic can fix a problem in 2 hours and another one can do it in 3 hours how long if the work together?

My head practically exploded at the absurdity of this question. First of all, if two car mechanics try to work together they'll end up drinking, smoking, and bull-shitting and nothing will get done. In the unlikely event that they actually tried to work on the same car at the same time it wouldn't get done faster because car repair is probably one of the least parallelizable tasks imaginable. I mean, what are they going to do -- both pull on a wrench at the same time and extract a nut twice as fast?

Of all the tasks in the world they could have chosen -- painting a wall, canvassing a neighborhood, etc -- they pick a nearly worst-case example. That said, understanding serializable vs. parallelizable tasks is extremely valuable knowledge so I spent 20 minutes explaining pipelining and caching strategies and then Bev understandably fired me exactly as predicted.

Here's another example from a Wonderlic sample test:

I simply abhore this questions and "puzzles" like this one -- it's completely subjective. I can make a case for all 5 of these being unique. 1 is the only one who's longest diagonal is equal to sqrt(2) of its sides. 2 is the only one that can be created by moving a single vertex from a rectangle. 3 is the only one with an anspect ratio greater than two. 4 is the only one that has regular angles greater than 90 and is also the only one with 6 sides. 5 is the only one with 2 acute angles. How is it that number of sides is somehow more important than the other features?

Questions like the two above make me feel that the author is a moron and that fact immediately makes me angry: Where does this moron get off judging me? And that gets me to why I hate standardized testing. It's a game about guessing what the author wants you to say using rules of thumb and pre-described algorithms versus demonstrating that you are capable of independent thought. And in a world full of computers that will slavishly follow endless and complicated pre-describred tasks, we don't need humans to do the same.

I don't merely reject standardized testing as a means of judging people's abilities, I reject the premise that standardized testing demonstrate anything positive -- society does not need more people who excel at slavishly following rules of thumb and formulas as those people's jobs are soon to be replaced by computers if they haven't been already. We need people who understand, who create, who invent now more than ever and this simply is not tested by standardized tests. While it is certainly the case that there are people who do well on standardized tests who are also creative, it is even more so the case that there are people who are very creative who nevertheless fail at standardized tests and unfortunately the tests tell those people "you suck" instead of "you're awesome".

Monday, June 14, 2010

Math series 7 -- complex numbers!

And now we come to one of our first major conclusions: you already understand complex numbers! (Again, if you find these helpful please leave me a note, I'd like to hear some feedback.)

Sunday, June 13, 2010

Math series 6 -- radians

Finishing up with rotations before we move on to something (seemingly) completely unrelated.