## Re: [RESOLVED] Help with math algorithm

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 ...

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 ...

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" ?

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" ? because it looks like your ego forbids you to accept anything that doesn't come directly from your own mouth ...