Main      Site Guide Re: Physilophical rain
Posted By: gremlinn, on host 98.212.130.10
Date: Friday, October 19, 2012, at 22:59:09

This is an update/reply to a post in the old forum, which I can't do there, so I'll copy the text here for continuation.

(Previous post: http://www.rinkworks.com/rinkforum/view.cgi?post=31334 )

> > Like Don, I'm confused about what happens at the border case of rain falling straight down. It doesn't make logical sense to me that if the rain is falling at you at 90.00000001 degrees, that you should run infinitely fast, while if the rain is falling behind you at 89.99999999 degrees, you should only walk at what would be a snail's pace, because there would be VERY little horizontal rain speed.
>
> Yeah, you're right, that doesn't make sense. The error I made was in choosing values of the rain angle which were too large, and not even checking small angles. What I did this time was to do a 3-D plot of the total rainfall as a function f of both V and A, in the case where the rain is angled in your direction. I graphed the ENTIRE range of A, from 0 to pi/2 (if A is bigger than that, the rain is moving upward, which isn't a realistic condition). I could send you a .gif of the plot, if you'd like.
>
> It turns out that for A less than pi/4, f(V,A) looks just like the case for the rain angled backward, as V increases, the rainfall decreases, so you want to go as fast as possible. But when A hits pi/4, the graph flattens out, and for A between pi/4 and pi/2, f(V,A) has a global minimum at V = R Sin(A). The border case, A = pi/4 is interesting in that it is *perfectly* flat for V bigger than R Sin(A). That means that if the rain speed is 10 m/s at exactly a 45 degree angle and hitting your back, you get less and less total rainfall (for a fixed travelling distance) as you increase your speed up to 5 sqrt(2) m/s, and then for any speed above 5 sqrt(2) m/s, you get exactly the same total rainfall, no matter how fast you go.
>
> So if the angle of the rainfall from the vertical is 44.999 degrees, you run as fast as possible. If the angle of the rainfall from the vertical is 45.001 degrees, you go at the horizontal velocity of the rain. If the rainfall is exactly 45 degrees from the vertical, you go at LEAST as fast as the horizontal velocity of the rain, and it doesn't matter how far past that you go. [As velocity increases, the tradeoffs between getting hit with more rain per second and having a shorter travel time exactly balance.]
>
> In terms of asymptotes, if you leave off all the constants and units, f approaches 1 as v approaches infinity, for all angles A. For A less than 45 degrees, f approaches the asymptote from above, and has no global or local minima. For A equal to 45 degrees, f decreases until it hits 1 at V = R Sin(45 degrees) = R/sqrt(2), and then lies on the asymptote for larger V. For A bigger than 45 degrees, f decreases, dips slightly below 1 at V = R Sin(A), and then for larger V increases toward the asymptote at 1.
>
> In a check of the limit case A = pi/2 (horizontally moving rain), the local minimum is at V = R Sin(pi/2) = R, with a value of f = 0. You move at the rain's speed, and don't get wet at all.
>
> Corrected final analysis (I hope):
>
> If the rain is coming in from ahead, or coming in from behind at less than a 45 degree angle from the vertical, go as fast as you can.
>
> If the rain is coming in from behind at more than a 45 degree angle, go at the horizontal speed of the rain.

Okay, so there are two interesting things to say about this problem, years later. First, as background, I had used Mathematica to analyze the rain problem above. Last year I applied for a job at Wolfram Research (makers of Mathematica) and I thought it appropriate to include in my application materials what I wrote in this thread as a writing sample of sorts and, among a few other things I used to design puzzles/images in SOAT, an example of what I'd done in Mathematica.

I was offered (and I took) a job working in QA for Wolfram|Alpha (the computation engine built on Mathematica code). W|A has a wide variety of formulas which can be queried to compute results based on the user's input values. Of all things to see coming along in development a couple of weeks ago, there's now a formula for this exact real-world problem of calculating how wet one gets when running through the rain, at various speeds and rain angles.

I'd almost suspect they got the idea from my interview last year, but I don't think the right people could have known about it.

Because (and only because) of having solved this problem in the past, I noticed a subtle bug in the results, which will be corrected in the next weekly W|A code release (in 4 or 5 days, probably). But go ahead and take a look at it now. It's very interesting to me how things have come full circle with this rain problem and its relation to Mathematica.