We placed 8 balls of radius $r$ on a horizontal plane such that their centers are at the vertices of a regular octagon, and adjacent balls touch each other. What is the radius of the sphere that touches the plane and the balls?
Solution. Let the radius of the sphere that touches the plane and the balls be $R$, and its center be $O_{1}$. From the arrangement of the 8 balls touching each other on the plane, it follows that the length of one side of the octagon is $2r$. Let the center of the circle circumscribed around the octagon be $O_{2}$, and its radius be $\varrho$. One of the central triangles of the octagon is $O_{2}AB$, where $\angle A O_{2} B = 45^{\circ}$.

![](https://cdn.mathpix.com/cropped/2024_05_02_5f2100fd70aa1d920a68g-1.jpg?height=258&width=328&top_left_y=310&top_left_x=888)

The value of $\varrho$ can be determined from the triangle $O_{2}AB$ using the cosine rule:

$$
(2r)^{2} = \varrho^{2} + \varrho^{2} - 2 \varrho^{2} \cos 45^{\circ} = 2 \varrho^{2} \left(1 - \frac{\sqrt{2}}{2}\right)
$$

From this, $\varrho^{2} = \frac{4r^{2}}{2 - \sqrt{2}} \quad \left[\varrho = \frac{2r}{\sqrt{2 - \sqrt{2}}}\right]$

The base plane is at a distance of $r$ from the plane of the octagon and at a distance of $R$ from the center of the tangent sphere. Let us draw a plane perpendicular to the base plane through $O_{1}O_{2}$, which also passes through $A$. This plane clearly passes through the center $O_{2}$ of the circle circumscribed around the octagon. The diagram shows the circles in which this plane intersects the spheres centered at $O_{1}$ and $A$.

![](https://cdn.mathpix.com/cropped/2024_05_02_5f2100fd70aa1d920a68g-1.jpg?height=326&width=515&top_left_y=1081&top_left_x=794)

In the right triangle $O_{1}O_{2}A$, $\overline{O_{1}O_{2}} = R - r$, $\overline{O_{1}A} = R + r$, and $\overline{O_{2}A} = \varrho$.

By the Pythagorean theorem:

$$
(R + r)^{2} = (R - r)^{2} + \varrho^{2}
$$

From this, $4Rr = \varrho^{2}$, rearranging gives $R = \frac{\varrho^{2}}{4r}$.

Substituting the previously calculated value of $\varrho^{2}$, we find that the radius of the tangent sphere is $R = \frac{(2 + \sqrt{2})r}{2}$.