To determine the direction cosines of a vector perpendicular to \( \mathbf{a} \) and \( \mathbf{b} \), we first calculate their cross product. The given vectors are \( \mathbf{a} = \hat{i} + 2\hat{j} + 3\hat{k} \) and \( \mathbf{b} = 2\hat{i} - \hat{j} + \hat{k} \).
The cross product \( \mathbf{a} \times \mathbf{b} \) is computed as follows:
\[
\mathbf{a} \times \mathbf{b} = \left| \begin{matrix} \hat{i} & \hat{j} & \hat{k} \\ 1 & 2 & 3 \\ 2 & -1 & 1 \end{matrix} \right|
\]
Expanding the determinant:
\[
\mathbf{a} \times \mathbf{b} = \hat{i} \left( \begin{vmatrix} 2 & 3 \\ -1 & 1 \end{vmatrix} \right) - \hat{j} \left( \begin{vmatrix} 1 & 3 \\ 2 & 1 \end{vmatrix} \right) + \hat{k} \left( \begin{vmatrix} 1 & 2 \\ 2 & -1 \end{vmatrix} \right)
\]
\[
= \hat{i} \left( (2)(1) - (3)(-1) \right) - \hat{j} \left( (1)(1) - (3)(2) \right) + \hat{k} \left( (1)(-1) - (2)(2) \right)
\]
\[
= \hat{i} \left( 2 + 3 \right) - \hat{j} \left( 1 - 6 \right) + \hat{k} \left( -1 - 4 \right)
\]
\[
= 5\hat{i} + 5\hat{j} - 5\hat{k}
\]
Thus, the vector perpendicular to \( \mathbf{a} \) and \( \mathbf{b} \) is \( 5\hat{i} + 5\hat{j} - 5\hat{k} \).
Next, we find the magnitude of this vector:
\[
|\mathbf{a} \times \mathbf{b}| = \sqrt{(5)^2 + (5)^2 + (-5)^2} = \sqrt{25 + 25 + 25} = \sqrt{75} = 5\sqrt{3}
\]
Finally, the direction cosines are the components of the unit vector in the direction of \( \mathbf{a} \times \mathbf{b} \). The unit vector \( \hat{u} \) is:
\[
\hat{u} = \frac{\mathbf{a} \times \mathbf{b}}{|\mathbf{a} \times \mathbf{b}|}
\]
The direction cosines are therefore:
\[
\cos \alpha = \frac{5}{5\sqrt{3}} = \frac{1}{\sqrt{3}}, \quad \cos \beta = \frac{5}{5\sqrt{3}} = \frac{1}{\sqrt{3}}, \quad \cos \gamma = \frac{-5}{5\sqrt{3}} = \frac{-1}{\sqrt{3}}
\]
The direction cosines of the vector perpendicular to \( \mathbf{a} \) and \( \mathbf{b} \) are \( \frac{1}{\sqrt{3}}, \frac{1}{\sqrt{3}}, -\frac{1}{\sqrt{3}} \).