Determine two unknown vectors to satisfy parallel and perpendicular conditions Given the vectors $\vec{a} = (1, 2, 1)$ and $\vec{b} = (1, 2, -2)$, determine vectors $\vec{p}$ and $\vec{q}$ such that $\vec{a} = \vec{p} + \vec{q}$ and $\vec{p}$ being parallel with $\vec{b}$, while $\vec{q}$ is perpendicular to $\vec{b}$.
I know that in order for two vectors to be perpendicular, the dot product has to be 0 ($\vec{p} \cdot \vec{q} = 0$). If we assume that $\vec{q} = (x, y, z)$, we get the equation $x + 2y - 2z = 0$ or $x = 2z - 2y$. By substituting $x = 0$, we know that one vector perpendicular to $\vec{b}$ must have the coordinates $(0, 1, 1)$.
I also know that $\vec{p}$ can be expressed as $\vec{p} = k\vec{b}$, where $k$ is a constant.
However, I am struggling to figure out how how to proceed from here and satisfy all of the conditions. I suspect a system of equations has to be used due to the amount of unknown variables.
 A: Hint: The orthogonal projection of $\vec{a}$ onto $\vec{b}$ will give you the vector $\vec{p}$ 
$\left( \text{Recall that}  \hspace{10pt} \text{proj}_\vec{b}\vec{a}=\dfrac{\vec{a}\cdot \vec{b}}{|\vec{b}|^2}\vec{b} \right)$.
Take $\vec{q}=\vec{a}-\vec{p}$. 
You can verify algebraically that this works but you should also convenience yourself that this is geometrically intuitive.
A: It is probably easiest to start with noticing that since $\vec{p}$ is parallel to $\vec{b}$,
$$\vec{p}=k\vec{b}=k(1,2,-2)=(k,2k,-2k)$$
Another given condition is:
$$\vec{a}=\vec{p}+\vec{q} \implies \vec{q}=\vec{a}-\vec{p}$$
Plugging in our $\vec{p}$ and $\vec{a}$ gives:
$$\vec{q}=(1,2,1)-(k,2k,-2k)=(1-k,2-2k,1+2k)$$
Finally, we can use the fact that $\vec{b}\cdot\vec{q}=0$ to find $k$:
$$(1,2,-2)\cdot(1-k,2-2k,1+2k)=0 \implies 1-k+2(2-2k)-2(1+2k)=0 $$
$$\implies 1-k+4-4k-2-4k=0 \implies 9k=3 \implies k=\frac{1}{3}$$
To conclude,
$$\fbox{$\vec{p}=(\frac{1}{3},\frac{2}{3},-\frac{2}{3}) , \space \text{and} \space \vec{q}=(\frac{2}{3},\frac{4}{3}, \frac{5}{3})$}$$
