Hacker News new | past | comments | ask | show | jobs | submit login
If a mathematician wants to cross a road (matthen.com)
92 points by robdoherty2 on May 20, 2013 | hide | past | favorite | 34 comments



I really like how the code + images enhance the post, but I think this model is a little simplistic for how analytical minds actually cross roads. The post assumes that my discomfort level is a constant, but in reality I become more comfortable the further across the road I've walked (as I become more confident that I'm not going to be flattened by a car). This leads to a smoothed curve on the latter half of the street.

Does Fermat's principle allow for variable refractions?


Does Fermat's principle allow for variable refractions?

Yes, and a common example is how light from the sky can bend to run through a layer of hot air right over hot sand, causing a mirage.

However Fermat's principle is a local rule. That is, there should be no way to improve the path by adjusting it a little bit, but it might not be a global minimum. The classic example demonstrating this is a mirror. The light bouncing off the mirror often had a shorter path available (just go directly there), but there was no local variant of the path which was better than the one that it took.

Fermat's principle holds for different things for different reasons. For instance light follows the principle because of how the wave front expands. Ants follow the principle because ants that followed a faster path tend to lay a fresher scent trail. But my other comments remain true regardless of why it holds for any particular type of thing.


"Does Fermat's principle allow for variable refractions?"

Yes, and that's where is gets interesting! Light will take a curved path through a tank of salt water, because the salinity, and through that the index of refraction, will not be constant but will be a continuous function of the depth.


I believe in the curve: as fur as there is no car in the road, I curve my trajectory to walk less (and stay a little longer in the road). The curve should have something like: given "St" the securityTime, at any time t, v(t) * St is located on the other side of the road. With v(t) the vector velocity witch is not constant (the angus changes, not the speed).


At this point you may very well not have analytical solutions anymore. But that's fine, you could do a numeric simulation and thereby obtain your maximum-comfort curved trajectory. :)


So my friend’s grandfather was hit by a car while jaywalking. His widow, who was in operations research said: “he died of premature optimization."


I think that by writing the article this way around (crossing the road -> refraction of light in glass) the author has rather unfortunately invited the kind of criticisms in this thread, that his "model is flawed" etc.

As a contrived scenario to help more intuitively understand refraction, it's nice, and I think that was what he was going for. It's how I read it.



There was a similar problem involving a dog attempting to get to a thrown ball into a lake. The dog wants to minimize its time to the ball, but has a slower swimming speed than running speed.

http://www.maa.org/features/elvisdog.pdf


My high school math teacher once asserted that, if you try this experimentally, the dog will in fact take something very close to the optimal path. Therefore, he said, dogs can do calculus.


Watch a toddler intercept a ball thrown along a parabolic trajectory. Toddlers can do calculus too!


I think this model is flawed.

It tries to boil the problem down to a 'discomfort' level, where what really matters is how long I think I can comfortably stay on the road, how fast I can cross the road, and how long I expect to wait to cross the road.

Let's assume all sections of the road are equally good for crossing (no pedestrian crossings etc). The road will then have a 'maximum angle of attack' which is a function of how fast I am travelling and how long I can stay on the road. I will walk in roughly the same pattern as in the link HOWEVER I will never cross at an angle greater than the maximum and I will potentially cross earlier or later depending on gaps in the traffic; it's faster to keep walking then to wait for a gap in traffic.

The main shortcoming in the model is that there is no upper limit on the angle of attack, and so it is easy to find example situations that are unrealistic.


I frequently cross the road near a highway. There is a light in the distance that works in busy times and it tends to be a busy highway around the time I usually cross. When the cars stop for the light I just cross in between them, giving me a straight across path. Otherwise there is too much traffic to attempt to cross while it's moving. I just walk along the road until the cars stop.

Also I never cross in a straight line. Most of the time I cross in an s-curve shape, meaning the road itself has a variable index of refraction for me.


When I lived in West Philly, I had to walk 10 blocks east and a few blocks north to reach school. Just before campus I had to cross a busy N/S street with a light, but most of the other intersections were just stop signs. I thought all the time about whether I should go straight east to the busy street or take the prettier route by cutting north a couple blocks first.


> I think this model is flawed.

Because you're thinking "physics like" not "math like"

In physics, yes, you have the refraction factor, etc, and this calculation works.

But it also works (from the math point of view) saying that light will take the path that takes the least amount of time for it to cross between two points.


I'm not sure what you are trying to say here.

Light will travel in the fastest way possible under a certain set of well known constraints. I think trying to apply this same model to how 'mathematicians' cross the road is flawed, although it is a good approximation when the start and end point are not displaced too far along the road.

As a simple counter example, think of a laser pointing along the length of a very long piece of glass. If you angle the laser slightly down, so that it hits the glass at a very small angle of attack, the laser will travel for a long distance inside the glass before exiting. It will not travel straight through the glass, but neither will it 'cross' to the other side very quickly. Regardless of the difference in the refractive index of the air and glass, you can always point the laser at an angle that causes the laser beam to travel for an arbitrary length of time in the glass.

Compare this to a mathematician walking along a very long highway. The time they will take to cross the road is NOT dependent on JUST how far they are walking. If it has heavy traffic then they will cross just as soon as their is a suitable gap. Extending the length of their journey (equivalent to decreasing the angle of attack for the laser) does not continue to increase the time they take crossing the road unboundedly.

The model is flawed for this obvious counter example, but it is flawed in simpler situations as well, mostly because the reality is that every section of road and every moment in time are not as ideal as each other for crossing the road.


Yes, it doesn't work for a road analogy, especially a "real road" one


hmm, i don't think you can model this without a possible random distribution of cars and their and my respective speeds. i actually cross the street in a curved manner, sometimes dangerously close to passing cars. it also depends on my estimate on when the nearest light turns green.

So yeah, I agree that it's oversimplified. Yes, it doesn't consider pedestrian crossings, but what about the cars, their acceleration, and the lights at those crossings?


Actually some "real" results in Mathematics use the laziness of light. For example http://en.wikipedia.org/wiki/Brachistochrone_curve#Johann_Be...


Does the angle of the crossing change as the distance between the two points gets larger? I'm curious because this seems to mimic the way most of us cross if we're not at a crosswalk (i.e. slightly toward the destination, but mostly perpendicular to the road), but that doesn't really change if the destination is a lot longer down the road. All things equal, you still won't want to spend that long in the road.


The edge case of this problem where the ratio is infinity, i.e. you want the crossing perpendicular to the street/river edges makes a nice kids math puzzle. It's usually formulated as "place a bridge over river so that the road between two houses is the shortest".


I remember listening to a lecture on quantum mechanics which said by suitably exciting your molecules, you would be able to walk through walls. I imagine we could take the shortest path, walking 'through' the traffic if this were possible


I would say that this is how most people would instinctively cross a road (a low traffic road with no crossing and with one's destination along the road on the other side, as in the model). A mathematician tries to find a proof for it :)


I've always thought very carefully about my paths' efficiency (despite not being a mathematician). I walk in a similar way except I'm okay with spending more time in the street.


If you're crossing the road and there's traffic coming, should you walk diagonally away from the oncoming cars, or walk straight across (perpandicular to the pavement)?



I do remember my high school physics teacher mentioning this during optics... he used an example of the most optimal path for a lifeguard.


Wasn't this a standard math quiz puzzle in a high school? Except it was phrased in terms of a horseback rider needing to cross a river.


Unlike the mathematician, the light doesn't know where the other side of the glass is. There's no guarantee that it's 'taking the shorter path' - for example, light hitting the edge of a glass cube that refracts into the cube will be taking a longer path than not refracting in the first place.

Not that light could have a motive anyway, but this strikes me as more of a passing fancy than a rationale.


You may want to read up further on Fermat's principle.

Your response is a little bit ill-formed because Fermat's principle is about the time to travel between two points. You assert that light is not "taking the shorter path", but in doing so you are changing the destination point or else leaving it undefined. Instead, pick a start point, pick an end point, and see how light travels between those two points, with respect to your cube of glass.


> "... but in doing so you are changing the destination point or else leaving it undefined."

That's kind of the point I think, because photons don't 'pick' a destination point before travelling.


From the perspective of their own frame, photons don't travel. They are everywhere along their path at once. From our perspective, a photon goes through A first, then B. From the photon's perspective, that is not how it is.

So the concept of a photon 'picking' a destination point, or not, is mired in an assumption that isn't true (that there would even be anything to pick).


So, the thing is, there are alternative ways of looking at the laws of physics that take a time neutral view and look at the entire system and do take the view that the entire system and use exactly this kind of reasoning. In such an approach the ray of light doesn't start at one point en route to the other, and it's more legitimate to see the system as a whole and see some kind of minimization like this - minimizing the time the light spends in the slower medium.


You might want to read up on the principle of least action. Light takes the shortest path, not because it "knows" or anything silly like that, but because that path's action is a minimum (actually it need only be a stationary point). From a quantum mechanical perspective (see Feynman's lectures about QED), light takes all paths, but the sum tends to the classical path, which is the shortest.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: