Geometric probabilistic problem on triangles on a plane We are given a triangle $T$ on a plane $P$, with sidelengths $a$, $b$ and $c$, where $c \ge b \ge a > 0$. A straight line $L$ on $P$ is selected uniformly at random from the set of all the horizontal and vertical straight lines cutting $T$. Note that a.s. there is $1$ and only $1$ uncut side of $T$.

Question: What maximum expected length (as a function of $a$, $b$ and $c$) of the uncut side of $T$ over all possible triangles $T$ on $P$, where the expectation is taken over the random selection of $L$?
 A: This is also too long for a comment but it shows where the real problem lies.
With the new formulation, the complementary expectation of the sum of two cut sides is just of the form
$$
\frac {\sum_i a_i^2(|\cos\theta_i|+|\sin\theta_i|)}{\max_i(a_i|\cos\theta_i|)+\max_i(a_i|\sin\theta_i|)}
$$
where $a_i$ are the sides and the angles $\theta_i$ that the sides $a_i$ make with one of the axis can be thought of as the angle $\theta$ by which the triangle is rotated plus some fixed offsets. Now, as long as no axis is parallel to one of the sides, both the numerator and the denominator are just linear combinations of $\sin\theta$ and $\cos\theta$, i.e., are proportional to $\cos(\theta+\rm{something})$. Shifting $\theta$ by that something in the denominator, we see that our function is of the form $\alpha\frac{\cos(\theta+\xi)}{\cos\theta}=\alpha(\cos\xi-\sin\xi\tan\theta)$. Since $\tan\theta$ is monotone between singularities, we conclude that the extremal coordinate systems are just the ones with one axis parallel to one of the sides.
The real question is then "to which side?". I suspect that the maximum of the original expectation is attained when one of the axes is parallel to the largest side but I'm not sure yet.
A: Let the vertices of the triangle be $A$, $B$, and $C$, which we also use for the angle measures, opposite the sides of lengths $a$, $b$ and $c$ respectively.
Suppose we know that in the ideal configuration, a horizontal line cuts the triangle at $A$, and a vertical line cuts the triangle at $B$. Let $\theta$ be the angle between the horizontal line and side $AB$.

Then the measure of the possible set of horiztonal lines is $c \sin(\theta)+b \sin(A - \theta)$, and the
expected length of the side uncut by horizontal lines is
$$h=\frac{bc \sin(\theta)+bc \sin(A - \theta)}{c \sin(\theta)+b \sin(A - \theta)}$$
Similarly the measure of the possible set of vertical lines is $c\sin(\pi/2-\theta)+a \sin(B-(\pi/2-\theta))$, or $c\cos(\theta)-a\cos(B+\theta)$, and the expected length of the side uncut by horizontal lines is
$$v=\frac{ac\cos(\theta)-ac\cos(B+\theta)}{c\cos(\theta)-a\cos(B+\theta)}$$
So the problem asks to maximize $\ell=(h+v)/2$ over all possible $\theta$. [Update: that was for the version of the problem
with equal likelihood of horizontal and vertical lines. On one interpretation of the current version, $\ell$ might instead be the sum of the numerators of the above $h$ and $v$, divided by the sum of their denominators. In any case:] The maximum has a closed-form expression, but it would be unilluminating.
So the full procedure here is:

*

*solve for $A$, $B$, and $C$.

*find $\theta$ and $\ell$ assuming that the horizontal line cuts $A$ and the vertical line cuts $B$ as above

*find $\theta$ and $\ell$ in the other eight cases for which vertex is cut by the horizontal line and which vertex is cut by the vertical line

*see which of these nine possibilities for $\theta$ and $\ell$ actually represent geometrically sensible arrangements

*choose the geometrically sensible possibility with highest $\ell$.

A: A bit too long for a comment, here's one suggestion: take $a\lt b\lt c$ and use $(0,0)$ and $(c,0)$ as two points of the triangle. The third point $(x,y)$ (taking $y\gt 0$ WLOG) can be found in whatever usual way you prefer. Now, instead of rotating the triangle, rotate the lines: we can parametrize the pencils of lines as being in the directions $(\cos\theta, \sin\theta)$ and $(-\sin\theta, \cos\theta)$ for $0\leq\theta\leq\frac\pi2$ (by symmetry). Finding the EV in question is a straightforward if annoying calculation, and then maximizing it over $\theta$ should be similarly straightforward. One problem with this approach — and a problem I suspect is innate to the question — is that the answer is likely to be sensitive to specific conditions/regions on $a,b,c$; it's hard to pin down a better one, but this parametrization feels very 'unnatural' for answering questions that are somewhat innately coordinate-centric.
