5. Given that skew lines $a$ and $b$ are perpendicular to each other, $AB$ is the common perpendicular segment, and $A \in a, B \in b, |AB| = m$, a line segment $PQ$ of fixed length $n$ has its endpoints moving on $a$ and $b$ respectively. $N$ and $M$ are the midpoints of $PQ$ and $AB$ respectively. Then $MN=$ $\qquad$
5. $\frac{\sqrt{n^{2}-m^{2}}}{2}$

Analysis: As shown in the figure, from the given conditions, it is easy to know that $a \perp A Q, b \perp P B$, so in $R t \triangle B P Q$, we have $B P^{2}=n^{2}-B Q^{2}$, and in $R t \triangle A B P$, we have $B P^{2}=m^{2}+A P^{2}$. Subtracting the two equations, we get: $B Q^{2}+A P^{2}=n^{2}-m^{2}$. Taking the midpoint $H$ of $P B$, it is easy to know that $M H \perp H N$, so $M N=\sqrt{\frac{A P^{2}+B Q^{2}}{4}}=\frac{\sqrt{n^{2}-m^{2}}}{2}$