5. The sphere touches all the edges of a tetrahedron, in which there is a vertex from which the edges emanate pairwise perpendicularly. Find the radius of this sphere if the radius of the sphere circumscribed around this tetrahedron is $3 \sqrt{3}$.
3.I.5. Let $PABC$ be a tetrahedron in which the edges $PA$, $PB$, and $PC$ are perpendicular to each other. Let $a = PC$, $b = PA$, and $c = PB$ (left figure).
![](https://cdn.mathpix.com/cropped/2024_05_21_46613852391e49da1fa9g-062.jpg?height=524&width=1260&top_left_y=1826&top_left_x=404)

If a sphere can be inscribed in the tetrahedron, touching all its edges, then the sums of the lengths of its opposite edges are equal to each other. Therefore, $a + \sqrt{b^2 + c^2} = b + \sqrt{a^2 + c^2}$. Consequently,

\[
\begin{aligned}
& a - b = \sqrt{a^2 + c^2} - \sqrt{b^2 + c^2} \Longleftrightarrow \\
& \Longleftrightarrow (a - b)\left(\sqrt{a^2 + c^2} + \sqrt{b^2 + c^2}\right) = a^2 + c^2 - b^2 - c^2 \Longleftrightarrow \\
& \Longleftrightarrow (a - b)\left(\sqrt{a^2 + c^2} + \sqrt{b^2 + c^2}\right) = (a - b)(a + b)
\end{aligned}
\]

Since $\sqrt{a^2 + c^2} + \sqrt{b^2 + c^2} > a + b$, it follows from the obtained equality that $a = b$. Similarly, we get that $b = c$. Therefore, $PA = PB = PC$, so the tetrahedron $PABC$ is a regular pyramid with vertex $P$.

The radius of the sphere circumscribed around the given tetrahedron is equal to half the length of the diagonal of a cube with edge $a = PA$ (right figure). Therefore, $a \sqrt{3} = 2 \cdot 3 \sqrt{3}$, so $a = 6$.

Now let's find the radius $r$ of the sphere that touches all the edges of the given tetrahedron. Let $PH$ be the height, $CK$ be the height of the base, and $O$ be the center of the sphere. Clearly, the point $O$ lies on the line $PH$. By the theorem of three perpendiculars, $OK \perp AB$. We also drop the perpendicular $OM$ to the edge $PA$. Then $OK = OM = r$ and $AM = AK$, since these are segments of tangents drawn from a point outside the sphere (figure).

![](https://cdn.mathpix.com/cropped/2024_05_21_46613852391e49da1fa9g-063.jpg?height=526&width=677&top_left_y=1636&top_left_x=701)

We have, $AB = 6 \sqrt{2}$, $AK = \frac{1}{2} AP = 3 \sqrt{2}$; $AH = \frac{BC}{\sqrt{3}} = 2 \sqrt{6}$; $PH = \sqrt{AP^2 - AH^2} = \sqrt{36 - 24} = 2 \sqrt{3}$; $MP = AP - AM = AP - AK = 6 - 3 \sqrt{2} = 3(2 - \sqrt{2})$. From the similarity of triangles $OMP$ and $APH$, it follows that

\[
\frac{OM}{AH} = \frac{PM}{PH}, \quad \text{from which it follows that} \quad r = OM = 6(\sqrt{2} - 1).
\]

Answer: the radius of the sphere is $6(\sqrt{2} - 1)$.