Vectors on straight line finding value of p The position vectors of points A and B relative to an origin O are given by
$$\overrightarrow{OA}=\pmatrix{p\\1\\1}\qquad\text{and}\qquad\overrightarrow{OB}=\pmatrix{4\\2\\p},$$
where $p$ is a constant. 
(i) In the case where OAB is a straight line, state the value of p and find the unit vector in the
direction of OA.[3] 
How to find the value of p(using a mathematical sense), i try to remove constant OB out giving(2) out....

The points $O, A, B$ are collinear iff $OA$ and $OB$ are parallel (linearly dependent).
This is the case iff one is a scalar multiple of the other, and comparing the middle components gives that in this case, $$||\overline{OB}|| = 2 ||\overline{OA}||,$$ and so comparing, e.g., the last entry gives $p = 2$.
A perhaps more geometric solution would be to use the fact that the two vectors (in $\mathbb{R}^3$) are parallel iff their cross product is zero. Computing gives that
$$\overline{OA} \times \overline{OB} = \begin{pmatrix}p - 2 \\ 4 - p^2 \\ 2 p - 4\end{pmatrix},$$
and this is zero iff $p = 2$.
