4.20. The length of the hypotenuse of an isosceles right triangle is 40. A circle with a radius of 9 touches the hypotenuse at its midpoint. Find the length of the segment cut off by this circle on one of the legs.
4.20. First, let's determine whether the problem has a solution given the values of the hypotenuse length and the radius of the circle. From geometric considerations (Fig. 4.17), it is clear that for the circle with center \( O \), lying on the height \( B K \) of triangle \( A B C \), to intersect the leg \( B C \) at two points \( D \) and \( E \), it is necessary and sufficient that its radius \( O K \) be no more than half the height \( B K \), but greater than the radius of the circle inscribed in the triangle. The first condition is obvious ( \( 920 \sqrt{2} - 20 \), since squaring both sides of the equivalent inequality \( 29 > 20 \sqrt{2} \) yields the true inequality \( 841 > 800 \).

To find the length of the segment \( D E \), we draw \( O F \perp D E \) and the radius \( O E \) of the given circle. We will sequentially calculate the lengths of the segments \( B O, O F, F E \), and finally \( D E \). We have \( B O = B K - O K = 11 \), \( O F = B O \sin 45^{\circ} = \frac{11 \sqrt{2}}{2} \). \( F E = \sqrt{O E^{2} - O F^{2}} = \sqrt{81 - \frac{121}{2}} = \sqrt{\frac{41}{2}} \), \( D E = 2 F E = \sqrt{82} \).

Answer: \( \sqrt{82} \).