janmr blog

The Crossed Ladders Problem

I was recently reminded of the crossed ladders problem. The following simple figure should be adequate in defining the problem:

The Crossed Ladders Problem
Figure 1. The crossed ladders problem

If you haven't seen the problem before, I highly recommend trying to solve it before reading on.

I had previously tried to solve it, but without success. This time I couldn't get it out of my mind. I had become a (self-inflicted) victim of nerd sniping.

Nerd sniping
Figure 2. xkcd explains nerd sniping

The thing is that it looks simple. But it isn't. Below is my solution to the problem (using some inspiration for making it a bit more pretty).

First, some variables must be introduced. Consider the following figures:

Variables for the Crossed Ladders Problem
Figure 3. Variables for the crossed ladders problem

So a=AFa=|AF|, b=BEb=|BE|, and h=CDh=|CD| are given while the width w=ABw=|AB| is the sought quantity. Furthermore, p=BFp=|BF| and q=AEq=|AE| are auxilliary variables.

Consider first the special case a=ba=b. It is then clear that

w=a24h2for a=b.w = \sqrt{a^2-4h^2} \quad\text{for } a=b.

Assume now, without loss of generality, that a>ba > b. The Pythegorean theorem gives us

(1)
w2=a2p2=b2q2a2b2=p2q2=(p+q)(pq).w^2 = a^2-p^2 = b^2-q^2 \quad \Leftrightarrow \quad a^2-b^2 = p^2-q^2 = (p+q)(p-q).

We then use that the triangle ACD is similar to AFB, just like the triangle BDC is similar to BAE, and get

ADw=hpandBDw=hq.\frac{|AD|}{w} = \frac{h}{p} \quad\text{and}\quad \frac{|BD|}{w} = \frac{h}{q}.

This gives us

w=AD+BD=w(hp+hq)pq=h(p+q).w = |AD|+|BD| = w \left( \frac{h}{p} + \frac{h}{q} \right) \quad \Leftrightarrow \quad pq = h(p+q).

We use this equality to get

(2)
(pq)2=p2+q22pq=p2+q2+2pq4pq=(p+q)24h(p+q)=(p+q)(p+q4h).\begin{aligned} (p-q)^2 &= p^2+q^2-2 p q = p^2+q^2+2 p q-4 p q \\ &= (p+q)^2-4 h(p+q) = (p+q)(p+q-4h). \end{aligned}

We now start from (1) and use (2) to get

(a2b2)2=(p+q)2(pq)2=(p+q)3(p+q4h).(a^2-b^2)^2 = (p+q)^2 (p-q)^2 = (p+q)^3 (p+q-4h).

We finally divide each side by a2b24\sqrt{a^2-b^2}^4 and obtain

(3)
x3(xc)1=0x^3 (x-c) - 1 = 0

where

(4)
x=p+qa2b2andc=4ha2b2.x = \frac{p+q}{\sqrt{a^2-b^2}} \quad\text{and}\quad c = \frac{4h}{\sqrt{a^2-b^2}}.

Let us take a closer look at (3) by considering the fourth degree polynomium Q(x)=x3(xc)1Q(x)=x^3 (x-c) - 1. Note first that cc is positive. Next that QQ is decreasing for x<0x < 0 and 0<x<3c/40 < x < 3c/4 and increasing for x>3c/4x > 3c/4 (seen from the derivative Q(x)=x2(4x3c)Q'(x)=x^2(4x-3c)). And since Q(0)=1Q(0)=-1 we then know that QQ always has exactly two zeros, one negative and one positive. We are naturally interested in the positive one.

Assume now that we have found the (positive) root xx. We then have from (4) and (1),

p+q=xa2b2andpq=a2b2p+q=1xa2b2,p+q = x \sqrt{a^2-b^2} \quad \text{and} \quad p-q = \frac{a^2-b^2}{p+q} = \frac{1}{x} \sqrt{a^2-b^2},

and then

p=12(x+1x)a2b2,p = \tfrac{1}{2} \left( x + \frac{1}{x} \right) \sqrt{a^2-b^2},

and finally

w=a2p2.w = \sqrt{a^2-p^2}.

And that is the width we were looking for. Note, however, that if p>ap > a then no solution is possible. This can happen, for example, if the crossing height hh is larger than the shortest ladder.

But how do we solve (3) and find xx? It is possible to solve a quartic equation analytically, so let us turn to Abramowitz and Stegun and solve it. By carefully inserting to retrieve the positive root we get

x=14c+14c2+4u+12(12c+12c2+4u)2+2u2+42ux = \tfrac{1}{4} c + \tfrac{1}{4} \sqrt{c^2 + 4 u} + \tfrac{1}{2} \sqrt{\left( \tfrac{1}{2} c + \tfrac{1}{2} \sqrt{c^2 + 4 u} \right)^2 + 2 \sqrt{u^2+4} - 2 u}

where

u=6427+14c412c236427+14c4+12c23.u = \sqrt[3]{\sqrt{\tfrac{64}{27}+\tfrac{1}{4} c^4}-\tfrac{1}{2} c^2} - \sqrt[3]{\sqrt{\tfrac{64}{27}+\tfrac{1}{4} c^4}+\tfrac{1}{2} c^2}.

That concludes the solution to the crossed ladders problem. Let us finish by inserting some numbers.

From the initial illustration of the problem, we have a=12a=12, b=10b=10 and h=5h=5. This gives us

w4.2973280047205172448618937103219913746175.w \simeq 4.2973280047205172448618937103219913746175.

There are actually lengths that have an integer solution. Take, for instance, a=119a=119, b=70b=70, h=30h=30 and w=56w=56.

A simple, but tricky, problem.

Commenting is not possible for this post, but feel free to leave a question, correction or any comment by using the contact page