-
[RESOLVED] Help with math algorithm
Hi,
I recently applied to a job and took a programming test. I didn't hear back, so I'm assuming I didn't get the position. I was able to answer all of the questions except one. I'm trying to find out what the answer is because its been bugging me, but I'm not having any luck. The question is a math calculation.
A man is standing in the middle of a long dry riverbed when he sees a wall of water heading towards him. If the water is moving at 8 times the speed at which the man can run, then he’ll have the best chance of escape by running:
A) Straight toward a river bank
B) Toward a bank, but at a slight angle away from the water
C) Away from the water, but at a slight angle toward the bank
Give a short explanation of your reasoning. Establish your answer mathematically.
Does anybody know what exactly needs to be done to find the optimal path? Is there an exact equation to use?
Thanks for any help you can offer.
regards
-
Re: Help with math algorithm
Here is a hint...
The shortest distance between 2 points is a straight line...
-
Re: Help with math algorithm
But aren't all of the options a straight line? I'm assuming you mean answer A) head straight for the river bank? But wouldn't you have a better chance running at a slight angle away from the water so you increase your distance from the encroaching water as you run?
-
Re: Help with math algorithm
Since the water moves 8 times faster that you can run, running in the same direction as the water, even a small angle, would be wasting time.
-
Re: Help with math algorithm
They were probably more interested in how you would logically approach the problem than an answer to the problem...
You would need to know 3 variables first....
distance to the water...
distance to the riverbank...
the speed you can run... (can get speed of the water from this)
With these known variables it is just a time/speed calculation.
-
Re: Help with math algorithm
Quote:
Originally Posted by
Vanaj
Since the water moves 8 times faster that you can run, running in the same direction as the water, even a small angle, would be wasting time.
Running at an angle is not a waste if the extra distance from the water compensates for the extra time it takes you to run a longer stretch.
If x is the shortest distance to the bank and y is the distance along the bank between the point you are running to and the point on the bank closest to you (meaning you are running away from the water y distance), then the distance to reach the bank is sqrt(x^2 + y^2). The time you gain is y/8. So if sqrt(x^2 + y^2) - y/8 <= x, it's better to run at this angle then straight towards the bank. That solves as 0 <= y <= 16*x/63. Since its quadratic, the minimum will be at y = 8*x/63.
-
Re: [RESOLVED] Help with math algorithm
Thanks guys,
I think I understand it now!
-
Re: Help with math algorithm
Quote:
Originally Posted by
D_Drmmr
the minimum will be at y = 8*x/63.
It depends on what you're optimizing. I've looked at minimizing w which is the distance between the runner and the approaching water when he starts running. For a given y and x this formula gives the w for which runner and water arrive at y simultaneously,
w = sqrt(x^2 + y^2) * 8 - y
The square root is the distance the runner runs to get to the riverbank a distance y downstream. Runner and water arrive at y at the same time but the water has travelled 8 times longer to get there hence the 8. Finally y is subtracted to give w, the distance between water and runner when he started to run.
In my view it makes most sense for the runner to aim for the y which gives the smallest possible w. W is the point of no return really. If the water gets closer you won't make it regardless of how you run. By running towards the y that puts w the closest to you will give you the best chance of making it regardless of how far away the water actually is when you start.
So what y gives the smallest w? Well according to my calculations it's y = x/sqrt(63). This differs from the y = 8*x/63 that D_Drmmr got so lets set x=1 and calculate w for the two y values.
w (1/sqrt(63)) = 7.937253933
w (8/63) = 7.937257808
Amazingly the results differ only after the fifth decimal. But mine is smaller so it's more optimal :).
-
Re: [RESOLVED] Help with math algorithm
here is another pov ( IMO a more correct solution ). If w is the riverbed width, v the runner speed, d > 0 the distance of the water front from the runner at time 0 and p the angle giving the runner direction, as measured CCW from the (0,-1) versor, we have
the trajectory of the runner: ( w/2 + v*t*sin(p), v*t*cos(p) )
the trajectory of a water front point: ( 0, 8*v*t - d )
then the runner will escape iff the following equation has no solution
v*t*cos(p) = 8vt-d and w/2 + v*t*sin(p) <= w
that is if
w/d < 2*sin(p)/(8-cos(p))
so the best chance of escaping ( cosidering that he may not be able of estimating w/d with sufficient accuracy ) si attained by maximizing the rhs: this gives p = arccos(1/8) ~ 83°. Hence the correct answer is B.
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
superbonzo
this gives p = arccos(1/8)
Adapting my solution to that I get this,
p = arctan(sqrt(63))
which doesn't look at all what you have but I consulted an old math handbook and,
arctan(sqrt(63)) = arccos(1/sqrt(1 + sqrt(63)^2)) = arccos(1/8)
so our solutions are in fact identical! (although our approaches differ a lot)
Quote:
Hence the correct answer is B.
I wouldn't be at all surprised if we're actually genetically programmed to make the right choise here. It feels so natural to run straight for shore but slightly away from the roaring white water front. I wonder how many poor apemen it took to firmy established those genes in our genome :).
-
Re: Help with math algorithm
Quote:
Originally Posted by
nuzzle
So what y gives the smallest w? Well according to my calculations it's y = x/sqrt(63). This differs from the y = 8*x/63 that D_Drmmr got so lets set x=1 and calculate w for the two y values.
I redid the math and my first answer was wrong. It should be y = x/sqrt(63) indeed. :thumb:
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
nuzzle
so our solutions are in fact identical! (although our approaches differ a lot)
yes, but it's not obvious why one should minimize the no return point to maximize the escape chance ... indeed, note that if the runner can exactly estimate the <riverbed width>/<water front distance> ratio then any angle satisfying the disequation in post #9 will maximize the escape probability ( = 1 ). Moreover, a correlation between the estimation errors of that ratio and the angle ( for example, due to parallax effects ) could render the optimal expected angle different from our calculations; in any case, the relevant equation to solve would be that in post #9, at least for the straight motion case.
Quote:
Originally Posted by
nuzzle
I wouldn't be at all surprised if we're actually genetically programmed to make the right choise here. It feels so natural to run straight for shore but slightly away from the roaring white water front. I wonder how many poor apemen it took to firmy established those genes in our genome :).
note that if the <water speed>/<runner speed> ratio is less then sqrt(2) then the C answer becomes the right one, with no optimal angle for the ratio = 1 limit case ( unless we consider being trapped forever in the riverbed an "escape" ). So, for slow moving water ( like a tide ) or fast moving trasnport ( like a car ) the correct behavior would be reversed.
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
superbonzo
yes, but it's not obvious why one should minimize the no return point to maximize the escape chance ... indeed, note that if the runner can exactly estimate the <riverbed width>/<water front distance> ratio then any angle satisfying the disequation in post #9 will maximize the escape probability ( = 1 ).
I don't quite follow your argumentation here. How does the riverbed width enter the picture? As I have it the optimal escape strategy is independent on both riverbed width and waterfront distance. At least if you assume the water front is advancing as a straight line, and you always aim for the closest riverbank, and the water is faster than you. Under these circumstances you want the point of no return to be as late as possible.
Quote:
note that if the <water speed>/<runner speed> ratio is less then sqrt(2) then the C answer becomes the right one, with no optimal angle for the ratio = 1 limit case ( unless we consider being trapped forever in the riverbed an "escape" ). So, for slow moving water ( like a tide ) or fast moving trasnport ( like a car ) the correct behavior would be reversed.
I don't understand this either. If the waterfront hasn't reached the point of no return when you start running, the optimal single y splits into an interval of opportunity with two endpoints y1 and y2. And sure, y1 can be upstream from where you stand. These endpoints could be called dare-devil points. If you aim for them you'll arrive at shore exactly when the water just misses you. If you aim for somewhere in-between you'll arrive safely before the water.
-
Re: [RESOLVED] Help with math algorithm
You don't need alot of complicated trigonometry to answer this. Since the question is how to maximize the PROBABILITY of the man escaping, it is obvious that running away from the water wall at a slight angle to the bank will afford the maximum probability of escape. This is a general solution of what is essentially a problem in differential calculus, but a specific solution is not possible because we don't have the actual speed of the water, the width of the river bed, and how close the water is to the man to start with (initial conditions). So no matter what those conditions are, running at an angle away from the water gives him the best chance, but does not guarantee that he will escape.
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
Mike Pliam
You don't need ........
You're wrong.
I agree that the instinctive response is what you indicate namely to head straight for shore slightly downstream but that doesn't make it obvious. The question asks for an informed explanation backed up by math, not mere guessing and handwaving. This is perfectly possible and the math is not complicated.
You're claiming that the problem is under-determined but it isn't. With the information given it's possible to establish how to optimally run to have the best chances of escaping the water. It's been shown in this thread already.
And the optimal angle is arctan(1/sqrt(63)) radians. That's approximately 7.2 degrees (downstream from running straight to shore). And it's regardless of the width of the river and where you stand on the riverbed and where the waterfront is when you start running. The only thing you need to know is how much faster the river is than you and in this case it's 8 times. This angle gives you the best chance of survival because it lets you make it dry to shore with the advancing river front the closest to you.
-
Re: [RESOLVED] Help with math algorithm
@moderator: if you like, it may be the time to move this thread to the algorithm section, as it has nothing to do with vc++ ...
Quote:
Originally Posted by
nuzzle
I don't quite follow your argumentation here.
do you agree that the trajectories of the runner and ( of a point of ) the water front are those in post #9 ?
if yes, then
1) you must agree that there's a dependency on the river bed width, or more specifically, of the ratio of that width with the water front distance at time 0; just consider that you cannot escape from an infinite river bed if the water ( approaching you at a finite distance ) is faster than you ... unless your "optimality" criterion does not depend on the ability of escaping or not; in this case, see 2)
2) you must agree that the probability of escape is given by the disequation in post #9, or more generally: w/d < 2*sin(p)/(q-cos(p)) [1] where q is the ratio of the water/runner speed. So you must agree that the question "to maximize the escape probability" is equivalent to maximizing the probability that [1] holds true.
now, if the runner knows all parameters of the problem exactly ( i.e. w/d, q and p ) then the escape probability can be either 1 or 0, being the former when [1] is satisfied; hence, in this case, the solution of the problem is trivially <any> angle satisfying [1] ( there's no single "optimal" value ).
otherwise, if there is some amount of uncertainty on the parameters ( the runner is just estimating them based on some partial knowledge ) then we need to maximize the probability that [1] is true where w,d,q and p are random variables.
This is easy when q and p are fixed ( as implied by the OP problem statement ): the resulting probability is maximized exactly when p is arccos(1/q).
But in general the result will differ arbitrarily depending on the joint probability distribution of the problem variables.
Quote:
Originally Posted by
nuzzle
I don't understand this either.
if q < sqrt(2) then the optimal angle is less than pi/4 ( ie away from the water front ); hence, in this case the answer C ( or at least to run at ~45° from the water front ) will give a better chance of escape.
Quote:
Originally Posted by Mike Pliam
but a specific solution is not possible
true, but a simplified model ( in this case, linear water front, straight motions, etc... ) can give insights on the qualitative structure of the solution, for example:
Quote:
Originally Posted by Mike Pliam
it is obvious that running away from the water wall at a slight angle to the bank will afford the maximum probability of escape
as said above, this is false when the runner is sure that the water front is slower than ~1.4 times his speed ( as in those action films, the runner could find a motorbike or a ferrari just in the middle of the river bed :); of course, keeping in mind that for p going to 0 the escape time goes to infinity, posing a limit on the escape time would mean posing a bound on the optimal angle towards 0 ) ...
-
Re: [RESOLVED] Help with math algorithm
actually you all are assuming variables not known...so I will do the same
if the water is 5 miles up stream then you can walk directly to the riverbank...else go directly to the riverbank as the delta for running away from the water, you would have to run the delta faster than the water is flowing which is 8 times what you can run...not possible....as an examiner I'm more interested in the logic used to solve the problem than trying to do trig in my head with killer water flowing at me at 8 times the speed I can run.
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
Vanaj
actually you all are assuming variables not known...so I will do the same
yes, and we can perfectly manage those "unknowns" using statistical methods, there's nothing to assume or guess.
Again, using a simplified model does not mean obtaining wrong results. On the contrary, most successful physical models work ( both theoretically and practically ) by approaching a problem via successive approximations, the reason being that the very idea of "true model" is (nearly always) meaningless theoretically , and often useless or counterproductive in practice. This is especially true when many unknowns of different nature are present and hence the qualitative structure of the solution, rather than the actual numerical values, are important.
Quote:
Originally Posted by
Vanaj
.as an examiner I'm more interested in the logic used to solve the problem than trying to do trig in my head with killer water flowing at me at 8 times the speed I can run.
nowhere the problem statement states that the decision ( including the logic behind it ) must be taken by the runner while waiting the water, that would be a totally different problem ( and heavily underspecified, being dependent on non trivial previous knowledge of the runner ... ).
If that was the real intent of the examiner then it would be a bad posed problem ( and I wouldn't work for him :) ).
Quote:
Originally Posted by
Vanaj
if the water is 5 miles up stream then you can walk directly to the riverbank...else go directly to the riverbank as the delta for running away from the water, you would have to run the delta faster than the water is flowing which is 8 times what you can run...not possible....
again, all this can be proven false, and so what ?
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
superbonzo
1) you must agree that there's a dependency on the river bed width, or more specifically, of the ratio of that width with the water front distance at time 0; just consider that you cannot escape from an infinite river bed if the water ( approaching you at a finite distance ) is faster than you ... unless your "optimality" criterion does not depend on the ability of escaping or not; in this case, see 2)
I don't agree.
It's true that the runner's starting point is defined in relation to the river width (the task says he starts in the middle of the river or at w/2 in your variables). But since the solution is independent of where the runner stands when he starts it will also be independent of the river width. The runner can start wherever he wants including in the middle but that doesn't matter for the solution. There's one optimal runner's angle regardless.
This is easy to see if one changes the problem slightly. Imagine instead the river is very narrow and you're standing at a distance from it. It's dry now but water is coming and you must cross it before it's too late. Essentially that's the same problem with the same solution only it becomes obvious now that the river width doesn't matter.
Further more, I think the problem has a probabilistic component but only in a conceptual way. And the solution supports that. It tells you how to run to have the best chance of survival regardless of how wide the river is, where you stand and where the river front is when you start running. But you won't be able to pin a probability on it so you won't know the likelihood of making it. What you do know is which angle postpones the moment of no return as much as possible. That is you know which angle allows the water to be closest to you and you'll still make it if you run for it. That's the optimal angle to always go for.
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
Vanaj
actually you all are assuming variables not known...so I will do the same
if the water is 5 miles up stream then you can walk directly to the riverbank...else go directly to the riverbank as the delta for running away from the water, you would have to run the delta faster than the water is flowing which is 8 times what you can run...not possible....as an examiner I'm more interested in the logic used to solve the problem than trying to do trig in my head with killer water flowing at me at 8 times the speed I can run.
As I've mentioned you don't have to do trigonometry in your head because evolution has hardwired the optimal strategy into our genes. At least that's what I think. You run straight to shore slightly downstream away from the approaching water without even thinking.
But even if the water is 5 miles upstream you still may not make it. It's because the water front may have passed the point of no return for you even if you run for shore at the optimal angle.
If the water hasn't yet passed the point of no return you'll have an interval of opportunity. It will be defined by two end-points on shore. The end-points will be dare-devil points, one upstream and one downstream. If you aim for one of them you'll arrive exactly when the water does. If you aim for a point in-between you'll arrive on shore with a margin before the water.
There will be a distance to the water at which your interval of opportunity shrinks to just one point. That's the optimal point to always aim for because it allows the water to come as close to you as possible and you'll still make it. If the water comes closer it passes the point of no return, the interval of opportunity shuts down and turns imaginary, and you can no longer get in safely.
If I were the reviewer that's the insight I would be looking for together with some quite straightforward high-school math & physics reasoning and calculations.
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
nuzzle
the task says he starts in the middle of the river or at w/2 in your variables
no, the middle of the river has x coordinate 0 in the model of post #9
Quote:
Originally Posted by
nuzzle
The runner can start wherever he wants including in the middle but that doesn't matter for the solution.
really? so, a runner standing at the river bank would have the same chance of survival ( and hance take the same decision ) of a runner standing in the middle of the river bed :confused: ?
Quote:
Originally Posted by
nuzzle
Essentially that's the same problem with the same solution only it becomes obvious now that the river width doesn't matter.
no, it's not the same problem; in this reformulated problem the variable w would be equal to 2*d where d is the distance of the runner from the narrow river bed center at time 0.
Quote:
Originally Posted by
nuzzle
That's the optimal angle to always go for. It's independent on your chances of survival.
... uhm, if the "optimal" angle is indipendent on your "chances" of survival, then I wonder what do you mean by "optimal" or "chance" because that looks like a manifest contradiction ...
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
superbonzo
no, the middle of the river has x coordinate 0 in the model of post #9
Okay. That explains the dependency on the river width in your model. The only way to change the distance from the runner's starting position to shore is to get oneself another river. That's a pretty tight coupling isn't it.
Quote:
really? so, a runner standing at the river bank would have the same chance of survival ( and hance take the same decision ) of a runner standing in the middle of the river bed :confused: ?
Not really. A runner standing on shore doesn't have to run at all. But apart from that, regardless of where he stands on the riverbed when he starts running there's exactly one optimal escape angle. It's independent on where he starts, the river width and the distance to the approaching river.
Quote:
no, it's not the same problem; in this reformulated problem the variable w would be equal to 2*d where d is the distance of the runner from the narrow river bed center at time 0.
As I indicated, your model seems to present problems. If you drop it and reconsider the physics you'll realize it's the same problem with the same solution indeed.
It seems your model is hard to interpret physically. And if it gives you a dependency of the river width on the optimal escape angle it's definately wrong.
Quote:
... uhm, if the "optimal" angle is indipendent on your "chances" of survival, then I wonder what do you mean by "optimal" or "chance" because that looks like a manifest contradiction ...
Well, I meant that the chance of survival doesn't enter the calculation of the optimal escape angle as an actual probability measure, only as a concept. But okay I'll remove that last sentense.
-
Re: [RESOLVED] Help with math algorithm
as already noted in earlier posts, our models give exactly the same results given the problem data ( so I do find an optimal angle that is indipendent from the river bed width, as written in post #9 ).
What we don't agree on is the interpretation of the result ( in what sense that angle is "optimal" and indipendent on the river geometry ) and how it generalizes to different or more realistic problem assumptions.
more specifically, it's false that, in all generality ( eg, for every possible input probability measure on the problem data ), the optimal angle is not a function of the river bed width, as observed by the runner. Second, it's false that the optimal angle is always only slightly pointing against the water direction. For example, for some speed ratios you get optimal angles >45°. Third, you define an "optimal angle" as an angle that maximizes the probability of escape: there can be more than one. For example, when the probability of escape can be 0 or 1 ( as in the case of a runner standing on the river bank ) you'll have infinitely many "optimal" angles ( if one is "more optimal" than the others as you seems suggesting then the escape probability cannot be 0 or 1 ) whose min and max are a function of the river bed width; the fact that you can choose an angle that always stays inside this interval does not make it more "optimal", for the reason just stated above.
BTW
>> The only way to change the distance from the runner's starting position to shore is to get oneself another river. That's a pretty tight coupling isn't it.
the problem statement specifically says that the runner is in the middle of the river bed. How do you define being in the middle of something ?
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
superbonzo
as already noted in earlier posts, our models give exactly the same results given the problem data ( so I do find an optimal angle that is indipendent from the river bed width, as written in post #9 ).
What we don't agree on is the interpretation of the result ( in what sense that angle is "optimal" and indipendent on the river geometry ) and how it generalizes to different or more realistic problem assumptions.
Of course, depending upon the distance of the person from the river bank and the oncoming water, escape may not be possible. But the strategy of running at a slight angle (in this case) towards the river bank is optimal in the following sense: if it is possible to escape from the oncoming water, then this strategy will allow escape.
Quote:
Originally Posted by
superbonzo
more specifically, it's false that, in all generality ( eg, for every possible input probability measure on the problem data ), the optimal angle is not a function of the river bed width, as observed by the runner. Second, it's false that the optimal angle is always only slightly pointing against the water direction. For example, for some speed ratios you get optimal angles >45°. Third, you define an "optimal angle" as an angle that maximizes the probability of escape: there can be more than one. For example, when the probability of escape can be 0 or 1 ( as in the case of a runner standing on the river bank ) you'll have infinitely many "optimal" angles ( if one is "more optimal" than the others as you seems suggesting then the escape probability cannot be 0 or 1 ) whose min and max are a function of the river bed width; the fact that you can choose an angle that always stays inside this interval does not make it more "optimal", for the reason just stated above.
Yes, for most cases there will be many ways to run towards the bank which will allow escape, including routes which aren't straight lines, or ones which double-back upon themselves. Or, if the water is miles upstream, routes which include a tea-break would work also :). But the strategy outlined by nuzzle and others will always work, if any strategy works.
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
superbonzo
more specifically, it's false that,
You seem stuck with model-induced corner cases that has nothing to do with generality or physical reality. For example what's this nonsense about the runner having infinitly many escape angles after he's made it safely to shore? Then there's nothing to escape from. What matters is that there's exactly one optimal escape angle (*) when he's in harms way and needs to escape.
This shows I think the importance of not over-extending the results of a mathematical model.
(*) For a specific speed ratio between river and runner. The task stipulates 8 so that's what I've assumed throughout but other values will give other optimal angles.
Quote:
the problem statement specifically says that the runner is in the middle of the river bed. How do you define being in the middle of something ?
Simple. You just set up a more general model than is strictly necessary. It's usually a good idea.
For examply nothing prevents you from expressing the runner's starting position with a free independent variable. You don't have to tie down your model to a starting position in the middle of the river. You could assume an arbitrary starting position and fix to the middle of the river afterwards.
Then you would've realized much earlier that the optimal escape angle is independent of the river width indeed. You also would've realized more readily that the narrow river variation I suggested actually is physically equivalent to the problem at hand and has the same solution.
Well, this is going in circles now so I drop it here. Thanks for the discussion.
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
Peter_B
But the strategy outlined by nuzzle and others
... including myself ( our "optimal" angles are exactly the same; please, read carefully post#9 and #10 ).
I'm just saying that there are conditions compatible with the problem data and assumptions ( eg. no strange or alternative strategies ) that give a different optimal( = probability maximing ) angle, and hence that nuzzle's statement that "the optimal angle is indipendent on the probability measure of the model parameters" is just wrong, in general.
More specifically, if 1) you add a source of uncertainty in the angle choosen by the runner as the result of its decision process and the actual angle of the resulting linear motion ( this can happen, for example, if he uses eyesight to orient himself, or a compass, etc... ; note that the problem statement speaks of chance without exactly specifying what are the assumed sources of uncertainty; and I think that the error on the runner estimation of his relative postion is a very reasonable source of error ) and if 2) you add a statistical dependency between the escape angle and the other parameters of the physical model then you'll get a different chance maximizing angle, as choosen by the runner.
If you like and if I have time, I can produce an explicit counterexample.
Alternatively, if you're so sure that nuzzle's statement holds true then you should have no problem to prove it: build a complete physical model of the problem as idealized by the OP; then, for any given probability measure over the model configuration compute the escape probability; finally, prove that it's always equal to the value expected by the naive geometrical model.
Quote:
Originally Posted by nuzzle
Well, this is going in circles
agreed :)
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
superbonzo
as already noted in earlier posts, our models give exactly the same results given the problem data ( so I do find an optimal angle that is indipendent from the river bed width, as written in post #9 ).
What we don't agree on is the interpretation of the result ( in what sense that angle is "optimal" and indipendent on the river geometry ) and how it generalizes to different or more realistic problem assumptions.
Indeed, you do get the same results. I should have read more carefully - apologies for that.
Quote:
Originally Posted by
superbonzo
... including myself ( our "optimal" angles are exactly the same; please, read carefully post#9 and #10 ).
I'm just saying that there are conditions compatible with the problem data and assumptions ( eg. no strange or alternative strategies ) that give a different optimal( = probability maximing ) angle, and hence that nuzzle's statement that "the optimal angle is indipendent on the probability measure of the model parameters" is just wrong, in general.
More specifically, if 1) you add a source of uncertainty in the angle choosen by the runner as the result of its decision process and the actual angle of the resulting linear motion ( this can happen, for example, if he uses eyesight to orient himself, or a compass, etc... ; note that the problem statement speaks of chance without exactly specifying what are the assumed sources of uncertainty; and I think that the error on the runner estimation of his relative postion is a very reasonable source of error ) and if 2) you add a statistical dependency between the escape angle and the other parameters of the physical model then you'll get a different chance maximizing angle, as choosen by the runner.
If you like and if I have time, I can produce an explicit counterexample.
Alternatively, if you're so sure that nuzzle's statement holds true then you should have no problem to prove it: build a complete physical model of the problem as idealized by the OP; then, for any given probability measure over the model configuration compute the escape probability; finally, prove that it's always equal to the value expected by the naive geometrical model.
I wasn't thinking of this problem in terms of any of the complications you mention here, e.g. errors in angle estimation etc., so I won't address them. And I really don't think the original problem was intended to be anything other than a simple idealized situation, for which you yourself have already shown (in post #16) what the optimal strategy is:
Quote:
Originally Posted by
superbonzo
This is easy when q and p are fixed ( as implied by the OP problem statement ): the resulting probability is maximized exactly when p is arccos(1/q).
But in general the result will differ arbitrarily depending on the joint probability distribution of the problem variables.
i.e. the optimal angle only depends upon q, which is the ratio of the water speed to the running speed.
Maybe the difference of opinion other the interpretation of the result arises from differing opinions of the problem you are solving?
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
superbonzo
note that the problem statement speaks of chance without exactly specifying what are the assumed sources of uncertainty;
That's because there are no assumed sources of uncertainity! The problem is meant to be solved under general and total uncertainity. If you start pinning probabilities on the problem you're reducing uncertainity and that's not asked for.
Quote:
If you like and if I have time, I can produce an explicit counterexample.
The problem is to find the direction that gives "the best chance of escape" under 100 percent uncertainity. It can be solved using ordinary high-school math & physics. There is one optimal escape direction dependent only on the river-to-runner speed ratio.
Not that I think the interviewers would've accepted it but if you want to reformulate the problem and seek solutions based on reduced uncertainity by introducing probabilities feel free to do so. It would be interesting to see if, how and why such solutions would deviate. But no unphysical or model induced corner cases please.
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
nuzzle
That's because there are no assumed sources of uncertainity! The problem is meant to be solved under general and total uncertainity.
well, you've just entered in a dangerous philosophical minefield, so it's time to prepare the typical VC++ forum reader to an even more boring and lengthy discussion ... :D
ok, let's depict the following hierarchy of uncertainties:
1) no uncertainty: every parameter of the physical model is known exactly; all properties of the model have a well defined and unique value.
say, if the model is the real line, we may consider a specific point.
2) "probabilistic" uncertainty: a probability measure on the space of parameters of the physical model is known exactly; all properties of the model have a well defined and unique probability distribution.
say, if the model is the real line with its natural measure, we may consider a specific probability distribution.
3) "epistemic" uncertainty: a set of probability measures on the space of parameters of the physical model is known exactly; to every property of the model and an element of that set we can map a unique probability distribution.
say, if the model is the real line with its natural measure, we may consider the set of all probability distributions ( as a side note, this is not identical to the set of all possible probabilty measures ).
4) "non epistemic" uncertainty: the model does not describe a statistically regular phenomenon; that is, you cannot generally assume, even in principle, that sampled frequencies converges to a fixed value in any way.
so, what do you mean by "total" or "no assumed" uncertainty ?
I assumed 3) in my reasoning: there's no fixed probability measure, we don't know it, but we can nonetheless assume one exists and insert in the model the probability measure as a yet another free parameter on which our conclusions will eventually depend on.
This is what I did and in this sense I can prove that there are two such probability measures ( ie, different <possible> sources of uncertainty ) that give different probability maximizing angles. This is sufficient to prove that the solution does depend on the probability structure of the problem.
Now, I think 3) is the correct POV for two reasons:
first, the problem specifically speaks of "chances". The word "chance", both historically and in contemporary usage in the statistical community, is a probabilty ( the converse is not true ) hence it's disallowed by definition in the general case 4), where the expression "to maximize chance" has literally no meaning.
That said, I can concede you that the vulgar usage of the word "chance" is as a synonym of "possibility" and so your interpretation of "the best chance of escape" is somehow acceptable. So, you're free to ignore this reason.
second, the hierarchy of uncertainties are inclusive from 1) to 3): 1) is a special case of 2) ( just take a point probability measure ), 2) is a special case for 3) ( just take a point set of probability measures ).
This means that if we can prove that a fixed strategy fails for j) then it must fail for j+1) as well.
Now, if 3) were also a special case of 4) then I can prove that our naive strategy fails for 4) too.
But, one could say that the "true" "non epistemic" uncertainty cannot include lower level of uncertainties, so let's add a
4.1) "total" non epistemic uncertainty: the model describes such an "unknown" phenomenon that not only we can not assume, we also must not expect any statistically regular sampling on the data.
but this definition ( and the like ) is more pathological as it seems:
first, it obtains "more uncertainty" by actually imposing an epistemic condition ( that the phemonenon is not statistically regular ); if uncertainty is a measure of absence-of-knowledge then this looks like a problem.
second, actually 3) already contains "much more" uncertainty than we need ( the set of all possible probability measures over some model is an enormous and highly pathological object ): more specifically, given an eventually huge number of samples of some phenomenon, we can always build a probabilistic model that is compatible with them ( just include correlations between samples ).
This means that there's no empirical way of distinguishing if a phenomenon is in 3) or is in 4.1); you can assume that 4.1) is empty without ever having to regret your choice, at least if your decision is based on empirical data. In no way you can claim that "if this or that is in 4.1) then this or that will happen to you".
So, in conclusion ( well, there would be many other things to say ... but this post is already too long ), 3) ( or at most 4), that includes 3) as a special case ) is the only sensible meaning of the expression "total uncertainty". In this way, I can prove that our naive strategy dependent only on the river-to-runner speed ratio is not optimal in the general "total uncertainty" case.
Quote:
Originally Posted by
nuzzle
It would be interesting to see if, how and why such solutions would deviate. But no unphysical or model induced corner cases please.
well, we already concluded that to any practical use, our solution is correct. So, I'm not fully clear on what you mean by "corner case". Anyway, I'll post a counterexample later when I have time ( at most tomorrow, I think ) ...
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
superbonzo
well, you've just entered in a dangerous philosophical minefield,
Come on, don't be dramatic. There's no dangerous philosophical minefield here.
The problem is stated and can be solved under full uncertainity. You don't have to assume anything about the runner or the river other than what's given in the question. That's the beauty of it and that insight would make you a strong candidate for the job I suppose.
If you assign additional properties to runner and river you're profoundly changing the situation. You can include the runner's ability to accurately measure distances and angles. You can include seasonal variations in the river flow. But you should know that these steps don't introduce uncertainity. On the contrary, they reduce it by pinning down different aspects of the situation. And that is so even if they're probabilistic or statistical in nature. This may give you a more realistic and useful model for sure but it won't be the problem you were asked to solve in the first place.
So please go ahead and modify the problem but as I said I'm not sure the interviewers would be impressed. Still I'm a little curious as to whether you can to come up with something that changes the optimal escape direction. I wouldn't be too shocked if you did though. It's not unusual for different problems to have different solutions.
Quote:
well, we already concluded that to any practical use, our solution is correct. So, I'm not fully clear on what you mean by "corner case". Anyway, I'll post a counterexample later when I have time ( at most tomorrow, I think ) ...
Do we have THE optimal solution to the problem or don't we? If we do then why a counter example? What are you trying to prove? That there are more than one optimal solution?
Well, maybe there is but then it shouldn't be unphysical, model induced or require a reformulation of the problem. All your attempts so far have stumbled on this.
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
nuzzle
Come on, don't be dramatic. There's no dangerous philosophical minefield here. The problem is stated and can be solved under full uncertainity.
I tried explaining why the idea of "full uncertainity" is a very delicate and possibly bad posed one, and why your specific idea of "full uncertainty" is just meaningless. That said, it's clear that you are inert to any form of argumentation so you're free to ignore the complexity of the subject and insist thinking whatever you like ... :)
Quote:
Originally Posted by
nuzzle
Still I'm a little curious as to whether you can to come up with something that changes the optimal escape direction.
well, I consider my last post a precondition to agree on such a possible example. So, if you still think that your idea of an "100% uncertainty" optimal strategy is meaningful then I'm 100 % sure that I won't succeed in convincing you. So, I won't post what I would consider a complete example.
Anyway, let's pretend you're right, that I'm guilty of having modified the problem, that this won't impress anybody and that "going to arcos(1/8)" is the universal, most elegant and beautiful solution to the OP problem. So, let me try to solve the much less ambitious task of finding a probabilistic modeling that gives a different optimal angle:
suppose the runner, standing in the middle of a river of width W, with a water front approaching him at a distance D, is going to move to an angle P relative to the river bank direction; suppose that he's using a compass to fix his direction and that there are many reference points ( trees, rocks, buildings, etc ... ) on the river bank enabling him to fix, let's pretend exactly, the direction of the river bank. Therefore, his direction of motion will take the form p = P + E where E is the error of the compass; let's pretend it is unbiased, that is that E follows a fixed symmetric unimodal distribution g(E) statistically indipendent on the other model parameters, like a reasonable true compass would be.
Now, we could probably obtain the wanted result by quite general assumptions, but, to keep things simple, let's suppose that W and D follows a joint probability density f(W,D) with support equal to some fixed cube [0,Wmax]x[Dmin,+inf). Again just to simplify the calculations take Dmin >= sqrt(63/4)*Wmax and suppose f() and g() almost everywhere differentiable.
then, the escape probability Q(P) equals ( where a(W,D) := 2*D/W, for brevity )
Q(P) = integral_from_0_to_Wmax integral_from_Dmin_to_inf { integral_from{ arccos( ( 8 + a*sqrt(a^2-63) )/( 1 + a^2 ) ) - P }_to{ arccos( ( 8 - a*sqrt(a^2-63) )/( 1 + a^2 ) ) - P }_of{ g(E) dE } f(W,D) dW dD }
then, let
S(D/W) := ( arccos( ( 8 - a*sqrt(a^2-63) )/( 1 + a^2 ) ) + arccos( ( 8 + a*sqrt(a^2-63) )/( 1 + a^2 ) ) ) / 2
L(D/W) := ( arccos( ( 8 - a*sqrt(a^2-63) )/( 1 + a^2 ) ) - arccos( ( 8 + a*sqrt(a^2-63) )/( 1 + a^2 ) ) ) / 2
S() and L() are monotonically increasing almost everywhere differentiable functions ( = almost everywhere invertible ) of d/w going from P0 := arccos(1/8) to pi/2 and from 0 to pi, resp. Let S be the corresponding random variable and h(S) its probability density; clearly E is still indipendent of S, and the support of h() is the interval [P0,pi/2].
hence, we have
Q(P) = integral_from_P0_to_{pi/2} { integral_from{ S - L - P }_to{ S + L - P }_of{ g(E) dE } h(S) dS
and differentiating under the integral sign
Q'(P) = integral_from_P0_to_{pi/2} { integral_from{ S - L - P }_to{ S + L - P }_of{ - g'(E) dE } h(S) dS
more specifically,
Q'(P0) = integral_from_P0_to_{pi/2} { integral_from{ S - L - P0 }_to{ S + L - P0 }_of{ - g'(E) dE } } h(S) dS =
= integral_from_P0_to_{pi/2} { {
integral_from{ S - L - P0 }_to{ 0 }_of{ - g'(E) dE } +
integral_from{ 0 }_to{ S + L - P0 }_of{ - g'(E) dE }
} } h(S) dS =
but |S - L - P0| is always less then S + L - P0, so
Q'(P0) = integral_from_P0_to_{pi/2} { {
integral_from{ S - L - P0 }_to{ 0 }_of{ - g'(E) dE } +
integral_from{ 0 }_to{ -( S + L - P0 ) }_of{ - g'(E) dE } +
integral_from{ -( S + L - P0 ) }_to{ S + L - P0 }_of{ - g'(E) dE }
} } h(S) dS
now, g' is an odd function <=0 for E >=0 and >=0 for E<=0, hence
Q'(P0) = integral_from_P0_to_{pi/2} { {
integral_from{ -( S + L - P0 ) }_to{ S + L - P0 }_of{ - g'(E) dE }
} } h(S) dS
the inner integral is always >= 0, but again being g unimodal there exist an epsilon > 0 such as g'(E) is strictly negative for 0<E<epsilon, so it suffices that h(S) is non zero whenever -( S + L - P0 ) < epsilon which is always true because the support of h() is [P0,pi/2].
this proves that Q'(P0) > 0, that is P0 is not a local extremum and hence is not a maximum of the escape probability.
In other words, we have proven that a runner applying the arccos(1/8) strategy with a perfectly unbiased compass will have less chances of escape of a runner going to arccos(1/8) + C, where C is a function of the compass precision given a possibly wide class of prior probability distributions of the river geometry.
as I said above, this is not meant as an argument for the "full uncertainty" thing, so spare me your comment about the obviously <<irrefutable>> fact that "under full uncerainty" C would "go" to 0, or the like ...
Quote:
Originally Posted by
nuzzle
Do we have THE optimal solution to the problem or don't we?
do you know the difference between "to any practical use, [this or that] solution is correct" and "[this or that] solution is correct" ? :confused:
Quote:
Originally Posted by
nuzzle
What are you trying to prove? All your attempts so far have stumbled on this.
do you know the difference between "I do not understand [this or that]" and "[this or that] is false" ? :confused: because it looks like your ego forbids you to accept anything that doesn't come directly from your own mouth ...
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
superbonzo
suppose that he's using a compass to fix his direction
This is where you change the problem. The original problem assumes nothing about the runner but you're putting a compass in his hands. So with all due respect for your math proficiency and effort, you've solved the wrong problem.
Quote:
because it looks like your ego forbids you to accept anything that doesn't come directly from your own mouth ...
I promise that as soon as you show the original problem has more than one optimal escape direction I'll utter the magic words: I was wrong. But I won't accept cheating; No unphysical solutions, no model induced anomalities and no problem changes.
Finally, who has the biggest ego here? You've tried every trick in the book to obscure the fact that you're wrong. Everything from linguistic acrobatics to scientific mumbo jumbo. You were wrong plain and simple. Accept that and move on.
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
nuzzle
Accept that and move on.
don't worry, I'll do. The good thing about on line forums is that everybody can come here and, if interested in, read all replies and draw their own conclusions on what the original problem was and in which ways and to which aims has been solved.
I do like arguing with people, but when dialectics resolves in a mere exercise of rhetorics and scientific or philosophical reasoning becomes a matter of mumbo jumbo and acrobatics, I admit I'm lost :)
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
superbonzo
I admit I'm lost
Well, my motivation in this thread has been to draw a clear line between the original problem and possible modifications.
--- clear line ---
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
superbonzo
In other words, we have proven that a runner applying the arccos(1/8) strategy with a perfectly unbiased compass will have less chances of escape of a runner going to arccos(1/8) + C, where C is a function of the compass precision given a possibly wide class of prior probability distributions of the river geometry.
as I said above, this is not meant as an argument for the "full uncertainty" thing, so spare me your comment about the obviously <<irrefutable>> fact that "under full uncerainty" C would "go" to 0, or the like ...
I hate to revive this thread again but since your conclusions are wrong I don't want to leave it unchallenged.
The fact is that there's an optimal escape direction and it's dependent only on the water-to-runner speed ratio (fixed to 8 in the problem formulation). A simple high-school level analysis shows that. It follows that if you want to introduce probablities for different aspects of the problem only those affecting this ratio can influence the optimal escape direction. Period.
You've introduced a compass which doesn't accurately show the direction so the runner cannot know for sure whether he's taking the optimal escape direction. But this doesn't change the optimal escape direction. It can't since it's unrelated to both the speeds of water and runner.
So what have you? After some sophisticated math you claim to have found a new optimal escape direction. It would be the old optimal escape direction modified by an additive constant. Now if your analysis is correct this just shows that if the compass has a known systematic error, that is if it's always off with a certain number of degrees, you must compensate for that to make sure you aim in the optimal escape direction indeed.
Otherwise the best you can do is trusting the compass. You set the optimal escape direction and start running knowing that the only things that can ever make this direction obsolete are new assumptions on how fast you can run or how fast water is approaching.
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
nuzzle
So what have you? After some sophisticated math you claim to have found a new optimal escape direction. It would be the old optimal escape direction modified by an additive constant. Now if your analysis is correct this just shows that if the compass has a known systematic error, that is if it's always off with a certain number of degrees, you must compensate for that to make sure you aim in the optimal escape direction indeed.
no, the compass is unbiased: if you decide to run at an angle A the compass will give you A on avarage, and any random deviation from A will be symmetrically distributed with respect to A. ( BTW, this has already been clearly stated above ... :rolleyes: BTW again, "sophisticated math" ? really ? it's just a bunch of basic integral calculus theorems :rolleyes: )
Quote:
Originally Posted by
nuzzle
Otherwise the best you can do is trusting the compass.
again no, as proven above, the "best" you (=the runner) can do is to analize the problem statistically and conclude that a different angle is better, provided some possibly very wide class of prior probability distributions of the river geometry is assumed.
that said, quoting myself, as I said above, this is not meant as an argument for the "full uncertainty" thing nor as an argument against your naive and tautological meaning of what an "optimal" strategy means in general terms. I gave up on that seemingly impossible task (sarcasm intended) many posts ago ...
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
superbonzo
no, the compass is unbiased: if you decide to run at an angle A the compass will give you A on avarage, and any random deviation from A will be symmetrically distributed with respect to A. ( BTW, this has already been clearly stated above ... :rolleyes: BTW again, "sophisticated math" ? really ? it's just a bunch of basic integral calculus theorems :rolleyes: )
Well, I meant sophisticated looking actually. Suitable to hide behind.
I was merely interpreting your results. If the compass is unbiased there shouldn't be an additive constant. Either it must be zero or your calculations are wrong.
Quote:
again no, as proven above, the "best" you (=the runner) can do is to analize the problem statistically and conclude that a different angle is better, provided some possibly very wide class of prior probability distributions of the river geometry is assumed.
Sure but such a statistic analysis must pertain to the water-to-runner speed ratio because that's the only thing that influences the optimal escape angle.
Quote:
that said, quoting myself, as I said above, this is not meant as an argument for the "full uncertainty" thing nor as an argument against your naive and tautological meaning of what an "optimal" strategy means in general terms. I gave up on that seemingly impossible task (sarcasm intended) many posts ago ...
Well I can easily back up my reasoning more formally.
Full uncertainity means that nothing at all is assumed about water or runner (except for a fixed water-to-runner speed ratio). Not where the waterfront is when the runner starts running, nor where he stands on the waterbed, nor what prompts him to start running in the first place. It could be his feet got wet, or he sees whitewater or hears a distant rumble, or he just acts on a hunch.
The waterfront will be at an unknown distance from the runner when he starts to run. One distance of special interest is the distance of no return. It is the shortest distance at which the runner can still make it dry to shore. If the waterfront is closer downstream to him when he starts to run he will drown regardless of how he runs. If it is farther upstream he can make it with a margin. This is very much like the time horizon of black holes. Once a certain border is crossed you are doomed.
I have stated without proof that the optimal escape strategy is to run at the angle that makes the distance of no return as short as possible. With other words, you run at the angle that lets the waterfront come the closest to you and you still will make it. To me intuitively this is the best strategy because it gives you the largest margin of safety regardless of where the water actually is when you start to run.
A proof is surprisingly simple:
(1) Let call the one angle associated with the distance of no return for the O angle.
(2) If the waterfront is somewhere upstream of the distance of no return the O angle will be replaced by two angles. The runner will make it if he picks any angle between those two angles. Lets call such a section of angles a window of opportunity.
(3) If a certain angle lies within every possible window of opportunity it will always take the runner dry to shore. And the only angle that does that (in this problem) is the O angle (it is even exact in the middle of any window of opportunity). So using the O angle is the optimal escape strategy and this completes the proof.
It has been shown that under full uncertainity, one and only one specific escape angle always takes the runner dry to shore. Therefore the optimal escape strategy is to always use this angle.
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
nuzzle
I was merely interpreting your results.
ah so, here is how it works: you read something that you don't understand, you "interpret" it randomly and you conclude that is wrong ... really fascinating ...
Quote:
Originally Posted by
nuzzle
Either it must be zero or your calculations are wrong.
if you're so sure, you should have no difficulty in finding a probability distribution of the compass error satisfying the condition in post #31 ( symmetric, unimodal and with avarage 0 ) and compute the angle where the escape probability is maximal to conclude that it's always equal to arccos(1/8). Good luck :rolleyes:
Quote:
Originally Posted by
nuzzle
the optimal escape strategy is to run at the angle that makes the distance of no return as short as possible[...]A proof is surprisingly simple:[...]Let call the one angle associated with the distance of no return for the optimal escape angle.[...]This completes the proof.
so, you prove that something is optimal by "calling" it optimal ... I'm again fascinated ...
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
superbonzo
so, you prove that something is optimal by "calling" it optimal ... I'm again fascinated ...
I called the angle optimal and then I showed it was optimal indeed. It's pretty kosher but okay I'll change it.
Is that all you have to say? I proved formally that you are wrong and I'm right and all you manage to come up with is nitpicking. Well, I've suspected for some time now that there isn't much of real insight behind your pompous and seemingly scientific facade and here it's in full view. Chewing formalia isn't enought if you want to discuss with me.
Face it, you're wrong on all accounts. The problem at hand has a straighforward high-school level solution. It's valid under full uncertainity. There is an optimal strategy for escape. Everybody know this, even you, but you can't back off now, can you.
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
nuzzle
I called the angle optimal and then I showed it was optimal indeed. But okay I'll change it.
you haven't changed anything, you're still "proving" that something is "optimal" by arbitrarily defining what "optimal" is for you. Nowhere in your "proof" you explain why and in which sense that angle is "optimal" in universal terms and how this relates to the idea of its being a solution of the problem under "full uncertainty". As far as the example in post#31 is concerned, I repeat again, you could just compute the maximal escape probability angle given the conditions in post #31 to prove you're right; contrary to you, I always admit the possibility of being wrong ( and I usually learn something when it happens; so it's neither offending nor something to be unpleased of ), the reason being that any non trivial argumentation can have pitfalls and sources of error. That said, I see no error in post #31 ( again, just find a counterexample ! ) and anybody reading ( and understanding ) that proof should come to the same conclusion ...
Quote:
Originally Posted by
nuzzle
Is that all you have to say?
there's nothing much to say indeed. My opinion is that you're inert to any form of argumentation, both phylosohical and mathematical, probably for both psychological reasons and cultural deficiencies on your part ( is a basic integral calculus proof "Suitable to hide behind" ? I must conclude that all the 20th century math, including modern probability theory, is an obscure-suitable-to-hide-behind object for you ... :rolleyes: ). Arguing in these conditions is just a waste of time for both. Don't worry, I promise I'll leave you your precious last word, so that everybody can appreciate your egotistic dialectics ...
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
superbonzo
you're still "proving" that something is "optimal" by arbitrarily defining what "optimal" is for you.
Every proof is constructed by someone, in this case me. And there is no universal definition of optimum. It must be defined in each case as I did. The optimal escape angle is the one that most likely takes you dry to shore regardless of where the waterfront is when you start running. Any runner will agree to that unless he has a deathwish.
Regarding #31. If you conclude that the compass influences the optimal escape angle you're wrong. No equation shuffling is necessary to know that. It can be established on pure principal grounds. It's because waterfront and compass are independent entities. To me that's pretty obvious and it should be to you too if you think about it.
Finally I think you should drop your pompous attitude. You're not the only one who knows some math around here. Your pretencious facade doesn't impress me at all. And your ad-hominem attacks aren't appropriate. The reason your argumentation falls short is because you are wrong and not because I would be stupid.
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
superbonzo
you haven't changed anything, you're still "proving" that something is "optimal" by arbitrarily defining what "optimal" is for you. Nowhere in your "proof" you explain why and in which sense that angle is "optimal" in universal terms and how this relates to the idea of its being a solution of the problem under "full uncertainty". As far as the example in post#31 is concerned, I repeat again, you could just compute the maximal escape probability angle given the conditions in post #31 to prove you're right; contrary to you, I always admit the possibility of being wrong ( and I usually learn something when it happens; so it's neither offending nor something to be unpleased of ), the reason being that any non trivial argumentation can have pitfalls and sources of error. That said, I see no error in post #31 ( again, just find a counterexample ! ) and anybody reading ( and understanding ) that proof should come to the same conclusion ...
Well, you can lead a horse to water but you can't make him drink. I'll explain one final time why you're dead wrong.
A simple high-school level analysis gives a solution in the form of a window of opportunity. Any angle within this window will take the runner dry to shore. The middle angle has the biggest safety margin. The end angles are daredevil angles and if you go for one of them you just about make it.
Most importantly, the middle angle is always the same. It's fixed regardless of the positions of runner and waterfront, and regardless of whether you assign probabilities to them or not. What varies is the width. There are three situations:
1. The waterfront is upstream of the point of no return. The window of opportunity is open. The farther upstream the wider the window of opportunity.
2. At the point of no return the width of the window of opportunity has shrunk to zero. There's no leeway. Only one escape angle is still available and that's the middle of the window of opportunity.
3. The waterfront has passed the point of no return. The window of opportunity is closed and escape is no longer possible. The runner drowns regardless of how he runs.
This is the insight you get from solving the original problem. There is an optimal escape angle and it's the middle of the window of opportunity. It's optimal because it's the only angle that always lets the runner slip into the window of opportunity if it's open. Tough luck if it isn't but since you don't know beforehand it's best to run as if it were. This is the most sensible definition of optimality. Ask any runner with a wish to live.
Now a compass is introduced to model the runner's ability to pick a certain escape angle. How does this influence the original problem? Not at all! If you want to hit a still standing target with unknown width you aim for the middle if you know where it is. That's optimal and no aiming device will change that. In case it's systematically off you compensate as to still be aiming for the middle.
So you're completely wrong in all your assumptions and your calculations in #31 is overkill at best. There does exist one optimal escape angle and a compass doesn't change that. The only time it would not make sense to set the optimal escape angle would be if the compass were off in a known way. Then you would set an off target angle to get the optimal escape angle.
-
Re: [RESOLVED] Help with math algorithm
dear nuzzle, if you're so sure that an unbiased compass cannot change the escape probability maximizing angle as read by the runner, just prove it: write down a probability distribution as of post #31 and compute the maximizing angle analitically or simply find an error in post #31 or whatever ... nobody is asking you to prove the Poincaré conjecture or solve some complex PDE; if you're still dedicating time to this thread, why can't you go a step further and prove your claims quantitatively according to modern probability theory ?
Quote:
Originally Posted by
nuzzle
the middle angle is always the same
BTW, yes, the argcos(1/8) angle is always in the "window of opportunity" but it's not the middle point of the "window of opportunity". This is also the reason why an unbiased symmetric compass response can slightly shift the optimal angle as read by the runner and it's the core of the simple proof in post #31.
-
Re: [RESOLVED] Help with math algorithm
Quote:
Originally Posted by
superbonzo
why can't you go a step further and prove your claims quantitatively according to modern probability theory ?
Because my interest in this is to use plain reasoning only.
Quote:
BTW, yes, the argcos(1/8) angle is always in the "window of opportunity" but it's not the middle point of the "window of opportunity".
Our models define the window of opportunity slightly different. In my model it's a section on shore and the optimal escape angle is the direction to its exact middle.
Quote:
This is also the reason why an unbiased symmetric compass response can slightly shift the optimal angle as read by the runner and it's the core of the simple proof in post #31.
Well, okay but it doesn't change the optimal escape angle as you claimed it would. And the compass definately is a modification of the original problem.
Still it's clear to me now where the constant in #31 comes from. I have no immediate reason to believe #31 wouldn't hold so assuming it does then: When the compass is set to the optimal escape angle it will deviate according to some probability distribution due to errors. This distribution of deviation will be symmetric in compass angles but when angles are translated to positions on shore the distribution is skewed and becomes asymmetrical. To still get as much as possible of the skewed probability mass inside any window of opportunity (making escape maximally probable) the whole distribution needs to be shifted. To do that the compass is set to the optimal escape angle adjusted by a constant.
With that I feel ready to drop this thread. Hopefully I get asked this question at a job interview sometime. :)