(i) For \(\overrightarrow{OA}\) to be parallel to \(\overrightarrow{OB}\), there must exist a scalar \(k\) such that:
\(\mathbf{i} - 2\mathbf{j} + 2\mathbf{k} = k(3\mathbf{i} + p\mathbf{j} + q\mathbf{k})\)
Equating components, we get:
\(1 = 3k\), \(-2 = pk\), \(2 = qk\)
Solving these gives \(k = \frac{1}{3}\), \(p = -6\), \(q = 6\).
(ii) Given \(q = 2p\), the vectors \(\overrightarrow{OA}\) and \(\overrightarrow{OB}\) are perpendicular if their dot product is zero:
\((1)(3) + (-2)(p) + (2)(2p) = 0\)
\(3 - 2p + 4p = 0\)
\(3 + 2p = 0\)
\(p = -1.5\)
(iii) \(\overrightarrow{AB} = \overrightarrow{OB} - \overrightarrow{OA} = (3\mathbf{i} + 1\mathbf{j} + 8\mathbf{k}) - (\mathbf{i} - 2\mathbf{j} + 2\mathbf{k})\)
\(= 2\mathbf{i} + 3\mathbf{j} + 6\mathbf{k}\)
The magnitude of \(\overrightarrow{AB}\) is \(\sqrt{2^2 + 3^2 + 6^2} = 7\).
The unit vector in the direction of \(\overrightarrow{AB}\) is \(\frac{2\mathbf{i} + 3\mathbf{j} + 6\mathbf{k}}{7}\).