<p>So yeah I was bored and I started wondering about the Fascist propaganda that you should always cross the street directly and not at an angle (I’ll formalize this later). Anybody else ever hear that? Well I decided to try to work out whether this is good information or not.</p>
<p>So here’s the setup. Let’s consider a simple case for now. You have a one way street and a car at the end of the road. Let’s say he takes up the whole road so that if you’re in the road at all when he tries to go by you will get hit. Let’s say the car will move down the road with constant speed u.</p>
<p>You’re standing a distance D down the road from the car. Say the road is L wide. You want to choose an path across the road so that you make it before the car hits you and such that the distance between you and the car is as large as possible.*</p>
<p>What path do you take?</p>
<ul>
<li>We could ask other optimization problems, and I encourage you to formulate and solve your own and see which, if any, lead to different conclusions. Once we’ve come to a consensus on this we can talk about the n-lane one-way case as well as the n-lane multi-way case.</li>
</ul>
<p>Isn’t the ideal path dependent on the relationship between the rate of the car and the pedestrian’s walking rate?</p>
<p>If car is faster than person, it wouldn’t matter because the shortest way would be a path perpendicular to the road.
If person is faster than car, then walk parallel to the road in the same direction the car is travelling.</p>
<p>AeroEngineer:
- Yes, sorry. It does depend on the person’s walking speed as well. You can assume a constant walking speed of v. We’ll also assume 0 < v < u, because otherwise the problem doesn’t make much sense, as noted by the subsequent poster.</p>
<p>aisgzdavinci:
- If the person walks faster than the car, I agree with you. But the surprising thing is this: if the person walks slower than the car, my answer is that it is not optimal to walk straight across, at least in the sense that I’m talking about above - it doesn’t maximize the distance between person and car when the person reaches the other side. That’s what I found, anyway. Your mileage may vary.</p>
<p>P.S. I worked out the result for the multi-lane one-way case today and the answer really isn’t so surprising. It’s not as elegant but it gets the job done and is pretty straightforward. I always like sharing little problems like this that I just randomly get the inspiration to solve and see if other people get the same answers as me…</p>
<p>Answer:
The pedestrian will have to walk at an angle (to the direct-path-line, away from the vehicle) of arcsin(v/u), where v is the speed of the pedestrian and u is the speed of the vehicle.</p>
<p>Approach:</p>
<p>CONSTANTS
D - initial distance from vehicle to pedestrian
L - direct-path line of pedestrian (i.e., width of street)</p>
<p>VARIABLES
u - speed of vehicle
v - speed of pedestrian</p>
<ul>
<li>The vehicle is assumed to take up the width of the street.</li>
</ul>
<p>EQUATIONS USED
distance = rate*time</p>
<p>STEPS
- The distance traveled by the vehicle in the time it takes for the pedestrian to cross the street will be equivalent to** D + L<em>tan(θ) - (v/u)</em>L*sec(θ)**. Computed using basic trigonometry and algebraic substitutions.</p>
<p>2) Calculate the single-variable derivative of the function with respect to θ and set it equal to zero. Computed using basic calculus and the associated algebra.</p>
<p>3) Solve for θ. Computed using basic algebra.</p>
<p>^ Interesting huh? I had always heard that you’re supposed to walk directly across to avoid being hit. It looks like that’s not necessarily true…</p>
<p>Lol, it is interesting. But we’re probably told to walk directly across to compensate for our inability to walk at the optimal angle. There’s a relatively small range at which the angle would increase the distance between the two, and the distance gained is relatively tiny compared with the total distance.</p>
<p>^ That’s true, and when the speeds are different by more than a factor of two, the angle is close to zero anyway. I guess perpendicular is usually pretty close and easier to remember than D + L<em>tan(θ) - (v/u)</em>L*sec(θ).</p>
<p>Perhaps a more interesting question… and one which I haven’t worked on yet, but will soon… would be the following:
- Imagine two cars are playing chicken. Same basic scenario as before, but now the two cars are approaching each other at speeds u and w and at distances a and b from the pedestrian. Same optimization problem as before, but now you want to maximize the minimum distance between you and either car.</p>
<p>I’m not sure how much harder this will be (if at all) or if it will have some of the nice properties as the last solution: no dependence on the distances or width of the road, and the path is a straight line. Of course, the path should be a straight line for all values of parameters if and only if the answer doesn’t depend on distances… I’ll be interested to see how this one pans out.</p>
<p>NOTE: if you want to just minimize the sum of distances, it suffices to cross perpendicularly. That should be pretty obvious. I don’t think this one is so obvious, but it might be, particularly in light of the solution to the last problem.</p>
<p>EXTRA NOTE: Another problem, of course, more similar to the first but harder, would be to cross an N-lane road with N-cars traveling at N-speeds and maximize the minimum distance between the pedestrian and each car along the way. These problems can get kind of fun, and I’ve done some work on this one… and although seemingly impractical, these don’t have to be about pedestrians and cars… applications in path planning for AI come to mind.</p>
<p>^ I might have a solution to the chicken game and it turns out not to be too hard either, if I’m doing it right.</p>