Solution
= Solution
Write $\widetilde\beta=(\widetilde\gamma^T,0)^T$, where
$$
\widetilde\gamma=(Z^TZ)^{-1}Z^TY.
$$
The final coordinate is deterministic, while the first $p-1$ coordinates have the usual least-squares covariance. Hence
$$
\boxed{
\operatorname{cov}(\widetilde\beta)
=\sigma^2
\begin{pmatrix}
(Z^TZ)^{-1}&0\\
0&0
\end{pmatrix}}.
$$