Let \(x\) be the height of the masts, \(y\) and \(y+2\) be the lengths of the guy ropes with the anchor point on the left side of the mast holding the shorter rope. Using Pythagorean Theorem we can get: \[\sqrt{(y+2)^2-x^2}-\sqrt{y^2-x^2}=7\] giving us \[x=(3/14)\sqrt{5(2y-5)(2y+9)}\] whereby by trial and error and using the fact that \(y>7\) and \(y=a/2\) where \(a\) is an integer, we get \(y=(61/2)\) ft and \(x=30\) ft.

But your general solution is really very neat and explicit!

]]>Substituting the given values \(d=7\) and \(s=2\) and simplifing the result gives the quadratic diophantine equation \[x^2 – 5y^2=-5\] where \(x=2h/3\) and \(y=l/7\). This is a variant of Pell’s equation and has multiple solutions, the first being the trivial one \(x=0,y=1\), the n’th solution being given by expanding\[x_n+\sqrt{5}y_n=(9+4\sqrt{5})^n\] and equating the terms on either side. These solutions can also be generated recursively using: \[x_{n+1}=9x_n+20y_n\] \[y_{n+1}=4x_n+9y_n\] which provides the basis for this Python solution:

1 2 3 4 5 6 7 |
x, y = 0, 1 print('# mast height total guy length') for n in range(10): print('# {:>13d} {:>16d}'.format(3 * x // 2, 7 * y)) x, y = 9 * x + 20 * y, 4 * x + 9 * y |

with the output:

1 2 3 4 5 6 7 8 9 10 11 12 13 |
# mast height total guy length # 0 7 # 30 63 # 540 1127 # 9690 20223 # 173880 362887 # 3120150 6511743 # 55988820 116848487 # 1004678610 2096761023 # 18028226160 37624849927 # 323503392270 675150537663 |

including the intended solution of 30 feet masts.

]]>