No matter how good your cameraman, or the equipment he's using, it's impossible to create the illusion of depth on a television. You might be able to tell some things are further away than others, but they won't ever look truly 3-D the way the real world does when you have two eyes open.
On the other hand, a mirror can give you a perfect illusion of depth (I am not using "perfect" in a technical sense here). A mirror image world is just as depth-rich to your binocular vision as the genuine article.
So why is that? Why can't a television gives depth perception? And what can a mirror do that a television can't?
Thursday, September 18, 2008
Tuesday, September 16, 2008
Meditation
A lot of people have asked me about my vipassana meditation retreat last month. The only ones who've received answers are the people who asked me in person, since they're much harder to shirk.
The meditation camp was a psychologically intense experience. It was important enough to me that if I want to explain it, I think I should put the effort into explaining it well.
I think it will take me about two weeks to write up all my thoughts as a memoir of my time there. I'll post the entire story at once when I'm done. In the mean time, thanks to everyone for your interest - it shows me that putting the effort into writing the story will be worthwhile.
The meditation camp was a psychologically intense experience. It was important enough to me that if I want to explain it, I think I should put the effort into explaining it well.
I think it will take me about two weeks to write up all my thoughts as a memoir of my time there. I'll post the entire story at once when I'm done. In the mean time, thanks to everyone for your interest - it shows me that putting the effort into writing the story will be worthwhile.
Monday, September 15, 2008
Answer: Circling Bugs
The mathematical answer to yesterday's problem about the circling bugs is much prettier than the previous one about the demon and lake. We might as well just solve the problem for "n" bugs, then let n=4 for the square. It is a bit of a special case, though, which you might be able to solve completely by intuition.
We'll let n bugs be distributed uniformly around a unit circle, and set the units of time so their walking speed is one. Each begins chasing its nearest neighbor. Because the situation is exactly the same for every bug, the shape cannot distort. If it starts out a square, it stays a square. It can only get larger or smaller, translate, or rotate.
Also by symmetry, it can't translate. Which way would it go? If you let it translate in the direction of one bug, you're being unfair to all the others, but the problem is perfectly equable.
The shape will rotate and change size. Begin by imagining the case of infinitely many bugs, all point-sized, that form a complete circle. Then if they chase the bug in front of them, they'll simply march around the circle without it ever changing size at all.
If there are finite bugs, the shape must shrink as it rotates. In the case of a circle, the bug can never get any closer to the next guy he's chasing, because whoever he's chasing is running directly away from him at the same speed. But for a finite-sided object, the chased bug isn't running directly away any more. He's running at an angle, so the distance between the bugs decreases. Hence, the shape shrinks.
Down to business: find the equation for the motion of a bug.
Let's write an equation for its velocity in polar coordinates. If the position of the bug is (r,&theta), then the position of the next bug is (r,&theta+2&pi/n). Skipping a step or two, the velocity of the bug is (-sin[&pi/n],cos[&pi/n]). You get that by taking the geometric fact that the exterior angle of a regular n-gon is 2&pi/n, and noticing the deviation of the bug's path from a pure circular motion is exactly half that.
The bugs all start a distance of one from the center, so they will all meet there after a time (and distance walked) 1/sin(&pi/n). If there are lots of bugs, we can make a small-angle approximation to get n/&pi. More bugs, longer to meet.
Integrating the velocity above (and remembering that things are a little more complicated in polar coordinates, because d&theta/dt = v&theta/r(t)), we have, for a bug that begins at (1,0)
p(t) = (1-sin[&pi/n]*t,-cot[&pi/n]*ln[1-sin(&pi/n)t])
A logarithmic spiral.
For the case n=4, our formula says the bugs will walk a distance 21/2 before colliding. In this special case, the motion of the bug "running away" is at a right angle. He isn't running away at all, so much as trying to execute a circular orbit. So, from a bug's perspective, the distance between the bugs shrinks just as fast as it would if the one he were chasing were simply stationary.
We'll let n bugs be distributed uniformly around a unit circle, and set the units of time so their walking speed is one. Each begins chasing its nearest neighbor. Because the situation is exactly the same for every bug, the shape cannot distort. If it starts out a square, it stays a square. It can only get larger or smaller, translate, or rotate.
Also by symmetry, it can't translate. Which way would it go? If you let it translate in the direction of one bug, you're being unfair to all the others, but the problem is perfectly equable.
The shape will rotate and change size. Begin by imagining the case of infinitely many bugs, all point-sized, that form a complete circle. Then if they chase the bug in front of them, they'll simply march around the circle without it ever changing size at all.
If there are finite bugs, the shape must shrink as it rotates. In the case of a circle, the bug can never get any closer to the next guy he's chasing, because whoever he's chasing is running directly away from him at the same speed. But for a finite-sided object, the chased bug isn't running directly away any more. He's running at an angle, so the distance between the bugs decreases. Hence, the shape shrinks.
Down to business: find the equation for the motion of a bug.
Let's write an equation for its velocity in polar coordinates. If the position of the bug is (r,&theta), then the position of the next bug is (r,&theta+2&pi/n). Skipping a step or two, the velocity of the bug is (-sin[&pi/n],cos[&pi/n]). You get that by taking the geometric fact that the exterior angle of a regular n-gon is 2&pi/n, and noticing the deviation of the bug's path from a pure circular motion is exactly half that.
The bugs all start a distance of one from the center, so they will all meet there after a time (and distance walked) 1/sin(&pi/n). If there are lots of bugs, we can make a small-angle approximation to get n/&pi. More bugs, longer to meet.
Integrating the velocity above (and remembering that things are a little more complicated in polar coordinates, because d&theta/dt = v&theta/r(t)), we have, for a bug that begins at (1,0)
p(t) = (1-sin[&pi/n]*t,-cot[&pi/n]*ln[1-sin(&pi/n)t])
A logarithmic spiral.
For the case n=4, our formula says the bugs will walk a distance 21/2 before colliding. In this special case, the motion of the bug "running away" is at a right angle. He isn't running away at all, so much as trying to execute a circular orbit. So, from a bug's perspective, the distance between the bugs shrinks just as fast as it would if the one he were chasing were simply stationary.
Sunday, September 14, 2008
Circling Bugs
Here's another problem I liked from "How Would You Move Mount Fuji". I'll state the original problem, then the generalization, and hope that when I try to solve it tomorrow I can do a little better than I did yesterday with the boat and demon. I think this one is actually a famous problem.
There are four beetles located the the four corners of a square. At the same moment, they all start crawling directly towards the next beetle clockwise around from them. That beetle they're aiming for is also crawling, so each beetle continually adjusts its course so that it aims straight towards the next beetle.
Will they collide in finite time? How far will they walk before they collide?
Generalizations: Let there be "n" beetles at the corners of a regular n-gon. Same questions. Also, if you drew a path marking the route of a single beetle, how many degrees around the center of the square would it subtend (i.e. how many times does the beetle wrap around the center)? What is their exact path?
There are four beetles located the the four corners of a square. At the same moment, they all start crawling directly towards the next beetle clockwise around from them. That beetle they're aiming for is also crawling, so each beetle continually adjusts its course so that it aims straight towards the next beetle.
Will they collide in finite time? How far will they walk before they collide?
Generalizations: Let there be "n" beetles at the corners of a regular n-gon. Same questions. Also, if you drew a path marking the route of a single beetle, how many degrees around the center of the square would it subtend (i.e. how many times does the beetle wrap around the center)? What is their exact path?
Saturday, September 13, 2008
(Kind of) Answer: Lake and Demon
This post is about yesterday's problem. I have to admit - the question is tougher than I thought it was (it's another of those I asked before solving). The question in the book is simply, "Imagine the demon goes four times as fast as your boat, how can you escape?" That question is purely conceptual. I'll answer it, then go as far as I can right now towards, "what is the minimum ratio of the speed of your boat to speed of the demon for you to be able to guarantee escape?" (Obviously less than 1/4).
I'll set the units of distance so the radius of the lake is 1, then set the units of time so the speed of your boat is also 1. The speed of the demon is D.
At first glance, you can realize that if D < Pi, you can just shoot for the shore opposite of where the demon is standing, and you'll get there first. But you can escape even if your ratio is worse than this.
Qualitatively, here is the plan: You start rowing in the direction directly away from the demon. He picks a direction and starts running that way, anticipating where you'll land. But it's to your advantage to keep the demon 180 degrees around the lake from you - as far as possible. To do this, just angle your boat a bit so whichever way the demon runs, you stay directly opposite him.
As long as you're still close to the center of the lake, this is easy to do. Your angular speed can be quite high because it's a small circle around the center. The demon's angular speed is low because he's so far out. Hence, you can keep him 180 degrees away from you.
What's the maximum distance from the center of the lake where you can still force the demon to be 180 degrees away from you? That happens when your maximum angular velocities match, which is at a distance 1/D.
After that, you still have to be able to make it to shore. If you were going on a straight shot, your speed would have to be great enough so that the time for you to get to shore is less than the time for the demon to run halfway around the lake. Algebraically,
(1 - 1/D) < Pi/D
D < 1 + Pi
The new strategy takes us from D < Pi to D < 1+Pi (slightly greater than 4), but is there something even better? Maybe it's worth your time to curve away from the demon despite the fact you can't keep him a full 180 degrees away from you.
A moment's thought will tell you undoubtedly yes - you can do better than moving out to the cutoff circle and then sprinting straight for shore. Suppose you are making that beeline for shore. The demon has picked a direction and is running towards your expected landing spot. If you turn your heading a very slight amount away from his side of the lake, you now have two components to your velocity - a "radial" component towards the edge of the lake and a "circumferential" component around in a circle. By the Pythagorean theorem, the squares of these speeds add up to the maximum speed of your boat. So if the component of circumferential speed is small, the change in the radial speed is second-order. Explicitly:
Sr2 + Sc2 = 1
Sr = (1 - Sc2)1/2
using the binomial theorem, for small Sc, this is
Sr = 1 - 1/2*Sc2
So you can pay a very small price to your radial velocity in return for some circumferential velocity. Losing radial velocity means it takes you longer to get to shore, while gaining circumferential velocity means it takes the demon longer to get to your landing spot. There's a positive effect to veering off course, and a negative effect. But since you can make the ratio of the negative effect to the positive effect arbitrarily small, it'll always be worth your while to veer away from a straight shot to shore at least a little bit, assuming your goal is to land with the demon as far away from you as possible.
Let's go back to the beginning and try a more quantitative approach.
If we want to escape the demon, we should always go at full speed. The demon's strategy is simple - he also goes at full speed in whatever direction takes him closer to you. If both directions are equal (because you're 180 degrees apart), he picks one at random. So the only thing we have to choose is our bearing, based on our current location and the demon's current location. What should the criterion be? I don't have a proof this is optimal, but if your goal is to land on shore as far from the demon as possible, let's make the criterion:
Choose the heading that maximizes the quantity:
(dI/dt) + (dr/dt*I)/(1-r)
Where "I" indicates the distance from the demon's position to the "intercept point", the point on the shore closest to your boat, and "r" is your distance from the center of the lake.
I derived this criterion with the following reasoning:
Imagine you were going to make a beeline to shore from wherever you currently are. If we divide the demon's distance to the intercept point "I" by his speed "D", we get the demon's expected time to intercept, I/D. On the other hand, your expected time to get there is just your distance from shore, 1-r, because your speed is 1. Finally, if we divide those two times by each other, we get a ratio I/(D*(1-r)). If that ratio is bigger than one, you've made it - you could escape with a bee-line trajectory now. Unfortunately, if D>Pi, that ratio at the beginning of the problem is less than one. But by choosing a clever trajectory, we can try to push that ratio up to one, and then escape. So at every moment, we're going to choose the heading so that this ratio is as high as we can get it a short time "dt" from now. To do that, just take the derivative of the ratio with respect to time and maximize it.
If you take the derivative, you'll noticed I dropped the constant "1/(D*(1-r))". This yields the condition above. As long as the derivative of that ratio is positive, we'll assume you still have a chance. Once you can't push the ratio any higher he's got you, since if you were going to escape, the ratio would go to infinity right before you got away, and if he's going to catch you, the ratio goes to zero.
Choose "@" to be the angle between your heading and the heading straight for shore. I'll let you work through the calculus for yourself should you so desire. The goal is to get "@" as a function of "I" and "r". That is, choose the best course whatever the current situation is. I found:
tan(@) = (1-r)/(I*r)
Reality check: I expect that as you near the shore, you should aim more and more towards it. As r->1, @->0.
I have to be careful with this formula - it only applies when the demon is NOT directly opposite you. If he's directly opposite you, then angling your boat brings him closer no matter which way you turn - a factor not accounted for in my calculation. So this formula only applies once the boat is already past the cutoff circle and racing for shore.
Now we've worked out a strategy, all that's left is integration. Unfortunately, the integration isn't very easy. We'll start things off by introducing a polar coordinate system (r,@). The center of the lake is (0,0). The demon starts out at (1,0), and the boat, having already completed the first stage of its maneuvers, begins at (1/D,Pi).
Let's say the demon chooses to run up towards the top of the circle (increasing @). Then his position as a function of time is (1,D*t).
Your position is trickier. It depends on your bearing, which depends on both your own position again and the demon's position. If you write out these equations, you'll see that they're pretty hopelessly coupled. I get
dr/dt = I*r/((1-r)^2 + (I*r)^2)^1/2
d@/dt = (1-r)/(r*((1-r)^2 + (I*r)^2)^1/2)
where I = @ - D*t, and "@" and "r" are your polar coordinates as functions of time.
So from there, I'm basically analytically screwed. If you'd like to do the numerical analysis and figure something out, please let me know what you find.
The sad part is, even doing the integration doesn't actually find an upper bound for D. It only finds an upper bound assuming my particular strategy is the best possible strategy. Just because it seems like a good one in my head doesn't mean there isn't one that's better, and I honestly have no idea how to go about proving either:
A) such-and-such a strategy is optimal for escaping the demon
B) no strategy can do better than such-and-such
Moral: These toy problems, though simple and well-defined, can be tougher than they look when you actually start to bite into them. I was originally just attracted to the little trick of realizing you could force the demon away from you by making small circles about radii close to the center of the pond. But after I got that I naturally wanted to go a step further. Turned out the next step was biting off more than I could chew.
I'll set the units of distance so the radius of the lake is 1, then set the units of time so the speed of your boat is also 1. The speed of the demon is D.
At first glance, you can realize that if D < Pi, you can just shoot for the shore opposite of where the demon is standing, and you'll get there first. But you can escape even if your ratio is worse than this.
Qualitatively, here is the plan: You start rowing in the direction directly away from the demon. He picks a direction and starts running that way, anticipating where you'll land. But it's to your advantage to keep the demon 180 degrees around the lake from you - as far as possible. To do this, just angle your boat a bit so whichever way the demon runs, you stay directly opposite him.
As long as you're still close to the center of the lake, this is easy to do. Your angular speed can be quite high because it's a small circle around the center. The demon's angular speed is low because he's so far out. Hence, you can keep him 180 degrees away from you.
What's the maximum distance from the center of the lake where you can still force the demon to be 180 degrees away from you? That happens when your maximum angular velocities match, which is at a distance 1/D.
After that, you still have to be able to make it to shore. If you were going on a straight shot, your speed would have to be great enough so that the time for you to get to shore is less than the time for the demon to run halfway around the lake. Algebraically,
(1 - 1/D) < Pi/D
D < 1 + Pi
The new strategy takes us from D < Pi to D < 1+Pi (slightly greater than 4), but is there something even better? Maybe it's worth your time to curve away from the demon despite the fact you can't keep him a full 180 degrees away from you.
A moment's thought will tell you undoubtedly yes - you can do better than moving out to the cutoff circle and then sprinting straight for shore. Suppose you are making that beeline for shore. The demon has picked a direction and is running towards your expected landing spot. If you turn your heading a very slight amount away from his side of the lake, you now have two components to your velocity - a "radial" component towards the edge of the lake and a "circumferential" component around in a circle. By the Pythagorean theorem, the squares of these speeds add up to the maximum speed of your boat. So if the component of circumferential speed is small, the change in the radial speed is second-order. Explicitly:
Sr2 + Sc2 = 1
Sr = (1 - Sc2)1/2
using the binomial theorem, for small Sc, this is
Sr = 1 - 1/2*Sc2
So you can pay a very small price to your radial velocity in return for some circumferential velocity. Losing radial velocity means it takes you longer to get to shore, while gaining circumferential velocity means it takes the demon longer to get to your landing spot. There's a positive effect to veering off course, and a negative effect. But since you can make the ratio of the negative effect to the positive effect arbitrarily small, it'll always be worth your while to veer away from a straight shot to shore at least a little bit, assuming your goal is to land with the demon as far away from you as possible.
Let's go back to the beginning and try a more quantitative approach.
If we want to escape the demon, we should always go at full speed. The demon's strategy is simple - he also goes at full speed in whatever direction takes him closer to you. If both directions are equal (because you're 180 degrees apart), he picks one at random. So the only thing we have to choose is our bearing, based on our current location and the demon's current location. What should the criterion be? I don't have a proof this is optimal, but if your goal is to land on shore as far from the demon as possible, let's make the criterion:
Choose the heading that maximizes the quantity:
(dI/dt) + (dr/dt*I)/(1-r)
Where "I" indicates the distance from the demon's position to the "intercept point", the point on the shore closest to your boat, and "r" is your distance from the center of the lake.
I derived this criterion with the following reasoning:
Imagine you were going to make a beeline to shore from wherever you currently are. If we divide the demon's distance to the intercept point "I" by his speed "D", we get the demon's expected time to intercept, I/D. On the other hand, your expected time to get there is just your distance from shore, 1-r, because your speed is 1. Finally, if we divide those two times by each other, we get a ratio I/(D*(1-r)). If that ratio is bigger than one, you've made it - you could escape with a bee-line trajectory now. Unfortunately, if D>Pi, that ratio at the beginning of the problem is less than one. But by choosing a clever trajectory, we can try to push that ratio up to one, and then escape. So at every moment, we're going to choose the heading so that this ratio is as high as we can get it a short time "dt" from now. To do that, just take the derivative of the ratio with respect to time and maximize it.
If you take the derivative, you'll noticed I dropped the constant "1/(D*(1-r))". This yields the condition above. As long as the derivative of that ratio is positive, we'll assume you still have a chance. Once you can't push the ratio any higher he's got you, since if you were going to escape, the ratio would go to infinity right before you got away, and if he's going to catch you, the ratio goes to zero.
Choose "@" to be the angle between your heading and the heading straight for shore. I'll let you work through the calculus for yourself should you so desire. The goal is to get "@" as a function of "I" and "r". That is, choose the best course whatever the current situation is. I found:
tan(@) = (1-r)/(I*r)
Reality check: I expect that as you near the shore, you should aim more and more towards it. As r->1, @->0.
I have to be careful with this formula - it only applies when the demon is NOT directly opposite you. If he's directly opposite you, then angling your boat brings him closer no matter which way you turn - a factor not accounted for in my calculation. So this formula only applies once the boat is already past the cutoff circle and racing for shore.
Now we've worked out a strategy, all that's left is integration. Unfortunately, the integration isn't very easy. We'll start things off by introducing a polar coordinate system (r,@). The center of the lake is (0,0). The demon starts out at (1,0), and the boat, having already completed the first stage of its maneuvers, begins at (1/D,Pi).
Let's say the demon chooses to run up towards the top of the circle (increasing @). Then his position as a function of time is (1,D*t).
Your position is trickier. It depends on your bearing, which depends on both your own position again and the demon's position. If you write out these equations, you'll see that they're pretty hopelessly coupled. I get
dr/dt = I*r/((1-r)^2 + (I*r)^2)^1/2
d@/dt = (1-r)/(r*((1-r)^2 + (I*r)^2)^1/2)
where I = @ - D*t, and "@" and "r" are your polar coordinates as functions of time.
So from there, I'm basically analytically screwed. If you'd like to do the numerical analysis and figure something out, please let me know what you find.
The sad part is, even doing the integration doesn't actually find an upper bound for D. It only finds an upper bound assuming my particular strategy is the best possible strategy. Just because it seems like a good one in my head doesn't mean there isn't one that's better, and I honestly have no idea how to go about proving either:
A) such-and-such a strategy is optimal for escaping the demon
B) no strategy can do better than such-and-such
Moral: These toy problems, though simple and well-defined, can be tougher than they look when you actually start to bite into them. I was originally just attracted to the little trick of realizing you could force the demon away from you by making small circles about radii close to the center of the pond. But after I got that I naturally wanted to go a step further. Turned out the next step was biting off more than I could chew.
Friday, September 12, 2008
Lake and Demon
This is a slightly-modified form of one of the most interesting problems from a book I just finished, called How Would You Move Mount Fuji? The book is about using such problems in job interviews, but the context is irrelevant to how clever the problem is. So without further ado:
You're on a boat in the middle of a circular lake. On the outside edge of the lake is a demon who wants to kill you to death. He is bigger than you and has pointy teeth. With poison on them. Death poison. He can't go in the water, so he runs around the edge of the lake, waiting to intercept you when you land.
If you can make it to shore without the demon being right where you land, you'll be okay. You're fast enough over land to run away and escape. But if the demon is right exactly there when you hit shore, you lose. Your wife and kids grieve. Your life insurer goes broke.
Assume the demon and your boat both have a maximum speed, which they can maintain indefinitely. What is the minimum ratio of the speed of your boat to the speed of the demon for you to have an infallible strategy for escape? What is that strategy, and how long does it take you to get to the edge of the lake evading the demon (as a function of the ratio of your speeds, and the ratio of your speed to the size of the lake)?
You're on a boat in the middle of a circular lake. On the outside edge of the lake is a demon who wants to kill you to death. He is bigger than you and has pointy teeth. With poison on them. Death poison. He can't go in the water, so he runs around the edge of the lake, waiting to intercept you when you land.
If you can make it to shore without the demon being right where you land, you'll be okay. You're fast enough over land to run away and escape. But if the demon is right exactly there when you hit shore, you lose. Your wife and kids grieve. Your life insurer goes broke.
Assume the demon and your boat both have a maximum speed, which they can maintain indefinitely. What is the minimum ratio of the speed of your boat to the speed of the demon for you to have an infallible strategy for escape? What is that strategy, and how long does it take you to get to the edge of the lake evading the demon (as a function of the ratio of your speeds, and the ratio of your speed to the size of the lake)?
Interview with Brian Greene
Brian Greene gave me a half hour interview earlier this week. I asked him some obligatory questions about his new book, Icarus at the Edge of Time. After reading the book (twice. It's very short.), I think Greene is a bit out of his league in writing fiction. Nonetheless, he gave some good insight on the relationship between thinking like a scientist and thinking like a writer, and how one could do both.
I was nervous enough during the interview to have a hard time afterwards remembering exactly what we had talked about (I recorded it, of course), but not so nervous as to be completely incapable of creating follow-up questions on the spot after getting his answers to my prepared ones.
What's more - Brian Greene appeared a little bit nervous, too. His tapped his foot throughout the interview and began every single response with the word "well" (which I deleted from the transcription, along with about two hundred of my own "um"s, "uhh"s, and "so"s.)
This should come out in the school paper, in some shorter form, once the new school year starts, but for the time being check out the link to Ideotrope at the top of the post.
I was nervous enough during the interview to have a hard time afterwards remembering exactly what we had talked about (I recorded it, of course), but not so nervous as to be completely incapable of creating follow-up questions on the spot after getting his answers to my prepared ones.
What's more - Brian Greene appeared a little bit nervous, too. His tapped his foot throughout the interview and began every single response with the word "well" (which I deleted from the transcription, along with about two hundred of my own "um"s, "uhh"s, and "so"s.)
This should come out in the school paper, in some shorter form, once the new school year starts, but for the time being check out the link to Ideotrope at the top of the post.
Subscribe to:
Posts (Atom)
