A very tiny Alice (not to be confused with the Alice from last week) is racing across a 2-by-2 chessboard, as shown below, where each smaller square has a side length of 1 cm. Alice starts at the bottom-left corner of the bottom-left black square and is trying to reach the top-right corner of the top-right black square.
There’s just one catch. Alice moves faster on the white squares than she does on the black squares. Her speed on the white squares is 1 cm per minute (again, she’s very small), while her speed on the black squares is 0.9 cm per minute. What’s the least amount of time it will take her to reach the finish?
Since within each square, Alice's speed is constant, she will travel in straight lines within each square making a piecewise straight path from the lower left corner, at (0,0), to upper right corners, at (2,2). Let's say, based on the augmented picture below, that Alice first cuts a straight line for the point (1,h) through the dark square, then heads to the point (2−k,1), before finishing at (2,2), for some 0≤h,k≤1.
The time elapsed in minutes by Alice for this path is T(h,k)=109(√1+h2+√1+k2)+√(1−h)2+(1−k)2. Taking the the gradient of the time elapsed function gives ∇T=(10h9√1+h2−1−h√(1−h)2+(1−k)210k9√1+k2−1−k√(1−h)2+(1−k)2). Setting the partial derivative with respect to h to zero, we get 10h9√1+h2=1−h√(1−h)2+(1−k)2. Setting the partial derivative with respect to k to zero, we get 10k9√1+k2=1−k√(1−h)2+(1−k)2. Combining these, we see that this would imply that h(1−h)√1+h2=k(1−k)√1+k2, which since f(x)=x(1−x)√1+x2 is monotonically increasing for x≥0 implies that h=k. In this case, we get that we must have 10h9√1+h2=1−h√(1−h)2+(1−h)2=1√2, or equivalently h√1+h2=9√220. Squaring both sides and solving for h, we get h2(1−81200)=81200, which give an optimal value of h∗=k∗=9√119. Plugging back into the time elapsed, shows that Alice can get reach the finish optimally in T∗=T(9√119,9√119)=209√1+81119+√(1−9√119)2+(1−9√119)2=200√29√119+√2(1−9√119)=√2√119(2009−9+√119)=√2(1+√1199)≈3.12835...minutes.Expanding Alice's journey to go to the final position of (8,8), we can rely on certain portions of the argument for the (2,2) case, but there are certainly some additional complications. Here we will generically have 14 possible values h1,…,h14 as shown in the figure below, we can rely on the symmetry to reduce the number of variables by a factor of two (i.e., h1=h14, h2=h13, …, h7=h8).
In this case, we find that the time elapsed by Alice in minutes is ˜T(h1,…,h7)=209(√1+h21+3∑i=1√h22i+h22i+1)+2√(1−h1)2+(1−h2)2+2√(1−h3)2+(1−h4)2+2√(1−h5)2+(1−h6)2+√2(1−h7).In this case we can take the gradient of ˜T and get ∇˜T(h)=(20h19√1+h21−2(1−h1)√(1−h1)2+(1−h2)220h29√h22+h23−2(1−h2)√(1−h1)2+(1−h2)220h39√h22+h23−2(1−h3)√(1−h3)2+(1−h4)220h49√h24+h25−2(1−h4)√(1−h3)2+(1−h4)220h59√h24+h25−2(1−h5)√(1−h5)2+(1−h6)220h69√h26+h27−2(1−h6)√(1−h5)2+(1−h6)220h79√h26+h27−√2). Let's first assume that there is some solution ˆh in the interior of [0,1]7, where ˜T is infinitely differentiable. If we set the gradient to zero and solve for the last equation, we get that h27h26+h27=81200, which implies that h26h26+h27=119200. Plugging this back into the second to last coordinate, we get that (1−h6)2(1−h5)2+(1−h6)2=1440081119200=119162, which in turn implies that (1−h5)2(1−h5)2+(1−h6)2=43162. Plugging this into the third to last coordinate, we get that h25h24+h25=81400⋅4⋅43162=43200, which implies that h24h24+h25=157200. Plugging this into the next coordinate, we get that (1−h4)2(1−h3)2+(1−h4)2=1440081157200=157162, which implies that (1−h3)2(1−h3)2+(1−h4)2=5162. Continuing onward, this implies that h23h22+h23=81400⋅4⋅5162=140, which in turn means that h22h22+h23=3940. Plugging this value into the second coordinate and solving gives (1−h2)2(1−h1)2+(1−h2)2=14400813940=6554; however, this is a contradiction since for any a,b∈R, a2a2+b2≤1. Therefore, there must not be some solution in the interior of [0,1]7.
Instead, we must have solutions with some variables on the endpoints of {0,1}. While the contradiction above was arrived at by initially setting h7 to something nonzero, we will arrive at similar contradictions unless we have h4=h5=h6=h7=0, since if let's say that h4>0=h5, then since the normal cone of [0,1]7 at h is given by N[0,1]7(h)={y∈R7−∣yihi=0} in order for h to be an optimizer of ˜T on [0,1]7 we would need to have \frac{\partial}{\partial h_5} \tilde{T} = \frac{20}{9} - \frac{2 (1-h_4)}{\sqrt{(1-h_3)^2 + (1-h_4)^2} = 0, which again since 0≤1−h4√(1−h3)2+(1−h4)2≤1 for all values of h3,h4∈[0,1] we will be hard pressed to solve. So let's then reduce the problem to optimizing the further reduced function ˇT(h1,h2,h3)=˜T(h1,h2,h3,0,0,0,0)=209(√1+h21+√h22+h23)+√(1−h1)2+(1−h2)2+√1+(1−h3)2+3√2 over [0,1]3.
Here again, we have the reduced and slightly modified gradient ∇ˇT=(20h19√1+h21−2(1−h1)√(1−h1)2+(1−h2)220h29√h22+h23−2(1−h2)√(1−h1)2+(1−h2)220h39√h22+h23−2(1−h3)√1+(1−h3)2). Since this still yields some gnarly system of quadratics, at this point, though you can also just give up and program it, finding ˆh=(0.485699…,0.0737739…,0.057801…) which yields an optimal value of ˇT∗=˜T∗=11.78815… minutes for Alice to get to (8,8).