Tuesday, August 12, 2008

End of the Problem-of-the-Day Contest, On to New Adventures

The problem of the day contest ended one week ago. Our winner at camp was Lucas Brown, followed closely by Jonathan Lilley. Tyler Fitzgerald and Ben Zinberg were third and fourth. Fantastic prizes were awarded to all.

Now that I'm going on to new things and new ways of life, the problem of the day will probably become the "occasional problem when I see an interesting one, supplemented by other various things that are on my mind". That's sort of what the blog was intended for anyway. It covers various things I'm thinking about, but only has a one-arcsecond window on the breadth of human experience.

My next adventure is to travel to the California Vipassana Center in North Fork, to learn a certain form of meditation. It's a ten-day course that involves a rather extreme schedule of 10 hours of meditation a day, no talking, reading, writing, exercising, doing physics, looking at females, contacting the outside world, or in general doing anything that would distract from the task at hand (you wouldn't want to be distracted from doing nothing, would you?) So I'll be completely off the radar until Aug 25 or so.

Friday, August 8, 2008

Answer: Square Root Calculator



Pick a number. Set the ball at that number on the ramp and let it go. Watch where it falls. The number where it falls is the square root of the number on the ramp.

This works because the velocity of the ball as it leaves the ramp is proportional to the square root of its kinetic energy. Its kinetic energy comes from the potential energy it originally had while sitting on the ramp. That's linear in the height.

Incidentally, not all the ball's initial potential energy gets converted into kinetic energy of translation. Some is also converted into kinetic energy of rotation. However, the fraction of kinetic energy that goes into rotation is constant, so this doesn't affect our ability to build a calculator. It just means the marks on the landing zone have to be closer together than they would for a frictionless, sliding ball.

The thing about the square root calculator is that it uses two linear scales. That's why it's a great machine - it doesn't take any difficult work to decide where the marks go. The laws of physics do the actual computation.

There were a variety of answers to the challenge to create your own analog calculator. Most of them missed the mark of what I was shooting for.

For example, an abacus can do multiplication. It's a physical system, as well. So I suppose it's a physical system that does a useful computation. But it's not interesting from a physics perspective. It's interesting only from a logical perspective. The abacus is probably made of wood, but doesn't depend essentially on the properties of wood to work. I could make the abacus out of stones sitting in from of me, or fancy metal rings, or little holes that I dig or fill in with sand at the beach. The abacus only cares about the positional relationship between its parts, not their physical interactions. I could even, if my powers of imagination were strong enough, picture an abacus with all its beads in my head, move them around mentally, and do abacus-style multiplication completely inside my head. If you imagine a different universe, in which the laws of physics work differently, the abacus wouldn't care. Multiplication would still be the same, and you could still do it with any device whose pieces could move in relation to each other the same way they can in an abacus.

So slide rules are out, too. Electronic computers can certainly compute useful quantities and solve differential equations numerically, and they are physical systems. But again, the magic of the computer is in its logical gates rather than its physics. Some other answers, like tree rings and sundials counting the passage of time, were not really doing a mathematical computation.

If you're good at circuit analysis, you could build an analog computer to calculate all kinds of interesting things. In fact, people used to do this all the time before digital computers got so good. So I won't talk about circuit analysis.

Instead, here's a fairly simple system to do multiplication. It's a tube of dilute gas, say argon. There's a piston allowing you to change the volume to whatever you want. The volume is marked off on the sides like it is in graduated cylinders or Nalgene bottles. You adjust the piston up or down with a stack of weights. If you want the cylinder to have less volume, stack on more weight. By counting the weights you have on there, you can get the pressure. There's a thermometer inside the tube positioned so you can easily read it. Finally, there's a bunsen burner and some cold packs lying around, so you can add or remove heat at will.

To a good approximation, the gas obeys the equation of state PV = nRT. So choose the amount of gas in your cylinder, along with your units pressure, volume, and temperature, so that nR = 1. Then PV = T. You can now do multiplication. Start by setting the weight stack so that the pressure inside is the first number you want to multiply. If the volume is lower than the second number you want to multiply, add heat. If it's greater, suck heat out. Keep adding or subtracting heat until the volume is equal to the second number you want to multiply. Now read off the temperature from the thermometer, and that is the multiple you sought.

The above machine is also a division machine, because you could equally well set the pressure to the denominator, add/subtract heat until the temperature is the numerator, and read off the volume using V = T/P. Similarly the square root calculator is also a square calculator. Take a guess at the square of a number, drop the ball from there and see where it lands. If it lands in front of the number you're squaring, drop it from higher. Repeat until you find the number on the ramp such that when you drop the ball from there, it hits your target number on the landing zone. That's the square.

Any system that satisfies the differential equation df/dx = a*f is a potential logarithm/exponential calculator, since its solution is f = e^ax = (e^a)^x. An example is a system whose friction is proportional to its amplitude. This occurs in the viscous flow of a fluid, for example. A runaway chemical reaction might obey this law, at least over some regime. Population growth of organism does this. The expansion of the universe due to a nonzero vacuum energy does this, since the rate of growth is proportional to the amount of vacuum, but growth is itself the change in vacuum.

Trig functions come from any physical system that obeys d2f/dx2 = -a*f, where "a" is positive. A mass on a spring is the canonical example, all sorts of things will exhibit this same behavior. The reason is that particles will minimize their potential energy. When you're near a potential energy minimum, you can expand the potential as a Taylor series, but the constant term is not physically relevant, and the linear term will be zero because you're at a minimum. Then the quadratic term dominates over a certain regime, and in that regime the system obeys the differential equation for trig functions.

Tuesday, August 5, 2008

Answer: Lifeguard
New Problem: Square Root Calculator

Lifeguard
Let the guard be a distance "b" from the edge of the beach, a horizontal distance "h" from where the drowning guy is, and let the drowning guy be a distance "d" from the shoreline.

Finally, let the lifeguard run to a point "x" on the shore before entering the water. See picture:













Then the time it takes him to get out there is






We want to find "x" that minimizes this time, so take a derivative and set it equal to zero.









Now take another look at the geometry of the problem. The expression above can be rewritten as





which is our answer: Snell's Law. Notice that all the actual distances fall out - only two of their proportions matter.

Square Root Calculator
The Exploratorium in San Francisco has a device they call a "square root calculator". It's just a ramp, a ball, a jump, and a landing zone, like this:

How is this a square root calculator? How does it work? Can you suggest another simple physical system that would operate as an multiplication calculator, logarithm calculator, trigonometric calculator, etc?

Monday, August 4, 2008

Answer: To Swim or Not to Swim
New Problem: Lifeguard

To Swim or Not to Swim
The lake is a hyperbola.
Actually, it's a section of a hyperbola on one side of the axis of symmetry, then the mirror image of that section on the other side.

This is good knowledge to have if you're building optical equipment. Light follows paths of stationary time, so light passing through a lens is very similar to this problem. Most lenses are built with edges that are sections of sphere, not hyperbolas. This is just because it's easier to manufacture them that way. Then if you're doing some fancy optics, you'll have to correct for the "spherical aberration" of your lens.

Proving the the hyperbola is straightforward, but algebra-y. Just set up a coordinate system where the middle of the lake is (0,0) and the edge of the lake is given by x(y). Then the edge of the make must be long enough to satisfy the condition
((d-x)2 + y2).5 + 2x = c
where c is some constant, equal to (d2 + (w/2)2).5.

I got this by letting "y" be the height at which you cross the lake. Then I counted the distance to the point where you enter the lake, and the twice the distance to the axis of symmetry (since you go twice as slow in water). This must be equal to the same number for all "y" by the specification of the problem. If it is, the rest of the problem (you're going from A to B, not A to the axis of symmetry) follows because the second half is the same as the first half backwards, and also takes time "c".

The equation you get is a hyperbola. This makes some sense. Consider the limit as the width of the lake is much greater than your initial distance from it. Then in that limit, the additional path length added by crossing the lake one unit higher is one unit (for a trip to the axis of symmetry). So in that same limit, the width of the lake must be directly proportional to height of the lake, so that it slows you down the right amount. That's what a hyperbola does - goes asymptotically to a line. Ah well, I just realized that random babbling probably doesn't get the idea across very well. But I also don't care that much because if you're reading this I'm sure you can figure it out for yourself anyway. I just thought it was neat.

Also, note that you can quickly get into situations where the lake extends back behind your starting point, so if the lake is too wide, it's impossible. It'll be faster to swim across. This happens when (w/2)2 + d2>4d2. If that happens, you'll need the start farther away from the lake, or make it out of something that's harder to swim through.

New Problem: Lifeguard
Today's and yesterday's problems were inspired by Feynman's popular book "QED", which in turn is based on these lectures.

You're a lifeguard who sees a swimmer drowning somewhere off shore. You need to get out to the swimmer by a combination of running on the beach and swimming in the water. See the picture:

One particular path is fastest. Assume you run at speed n1 and swim at speed n2. You take the fastest path. What is the relationship between the angle of your path on the beach relative to the normal, and your angle into the water relative to the normal?

Saturday, August 2, 2008

Answer: Square Wheel
New Problem: To Swim or Not To Swim

Square Wheel
Sorry to be lame, but I'm not going to prove this one. It's a catenary.

To Swim or Not to Swim
There's a lake in the middle of the field, as shown. You want to go from point A to point B as quickly as possible. You can go over land or over water, but you're twice as slow in the water as one the land.

Assume (or prove) the best strategy is to head straight to some spot on the shore, swim straight across, and then head on from the far shore to point B by land. The shape of the lake is such that it doesn't matter where you choose to enter - all paths take the same amount of time. What is the shape of the lake?

Assume: points A and B are equidistant from the center of the lake. The lake is symmetric about a vertical line through its center.

Friday, August 1, 2008

Answer: Hourglass
New Problem: Square Wheel

Hourglass
It's hard to say exactly what the plot would look like, if you try to account for things like the varying pressure on the sand, the varying height of the pile in the bottom of the hourglass, etc. We can say generally what the weight-vs-time graph looks like by finding an important property. Start with

F = dp/dt
Fdt = dp

Integrating, we find that the total force-seconds is equal to the change in momentum. But the hourglass has zero momentum when the sand is all up top, and again zero when the sand is all in the bottom. So the integral of force over time for the whole experiment must be zero.

The force on the hourglass is from gravity and from the scale. Because the force of gravity isn't changing, that means the force read on the scale must, on time-average, be equal to the weight of the hourglass. Any "bumps" in the scale's readings must be canceled out by "valleys".

That tells us about the entire outline of the plot. As for the details, it depends on the acceleration of the center of mass of the hourglass (F=ma). Just as the sand starts falling, the center of mass is certainly accelerating down. The force of gravity is stronger than the force exerted by the scale, and so the reading goes down for a time. When the sand hits the bottom, it accelerates up. If the rate of sand flowing were constant, and all the sand fell the same distance, and the sand in the top weren't sinking, then the total acceleration of the hourglass would be zero. There are complications so that while the sand is falling, the center of mass might have some nonzero acceleration, but it would be small.

As the last bits of sand fall, the acceleration of the center of mass must be upwards - it's going towards a state where it's no longer falling. So the basic idea of the outline should be something like this:















Square Wheel
A square wheel rolls on a bumpy road smoothly, and without slipping. What is the shape of the road?